Package org.apache.cassandra.spark.data
Class LocalDataLayer
- java.lang.Object
-
- org.apache.cassandra.spark.data.DataLayer
-
- org.apache.cassandra.spark.data.LocalDataLayer
-
- All Implemented Interfaces:
java.io.Serializable
public class LocalDataLayer extends DataLayer implements java.io.Serializable
Basic DataLayer implementation to read SSTables from local file system. Mostly used for testing.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLocalDataLayer.Serializer
-
Field Summary
Fields Modifier and Type Field Description static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description LocalDataLayer(org.apache.cassandra.bridge.CassandraVersion version, java.lang.String keyspace, java.lang.String createStatement, java.lang.String... paths)LocalDataLayer(org.apache.cassandra.bridge.CassandraVersion version, java.lang.String keyspace, java.lang.String createStatement, java.util.Set<java.lang.String> udtStatements, java.lang.String... paths)LocalDataLayer(org.apache.cassandra.bridge.CassandraVersion version, org.apache.cassandra.spark.data.partitioner.Partitioner partitioner, java.lang.String keyspace, java.lang.String createStatement, java.util.Set<java.lang.String> udts, java.util.List<org.apache.cassandra.spark.config.SchemaFeature> requestedFeatures, boolean useBufferingInputStream, java.lang.String statsClass, java.lang.String... paths)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.cassandra.bridge.CassandraBridgebridge()org.apache.cassandra.spark.data.CqlTablecqlTable()booleanequals(java.lang.Object other)protected java.util.concurrent.ExecutorServiceexecutorService()DataLayer implementation should provide an ExecutorService for doing blocking I/O when opening SSTable readers.static LocalDataLayerfrom(java.util.Map<java.lang.String,java.lang.String> options)Builds a newDataLayerfrom theoptionsmap.inthashCode()booleanisInPartition(int partitionId, java.math.BigInteger token, java.nio.ByteBuffer key)java.lang.StringjobId()intpartitionCount()org.apache.cassandra.spark.data.partitioner.Partitionerpartitioner()java.util.List<org.apache.cassandra.spark.config.SchemaFeature>requestedFeatures()voidsetDataFilePaths(java.util.Set<java.nio.file.Path> dataFilePaths)org.apache.cassandra.spark.data.SSTablesSuppliersstables(int partitionId, org.apache.cassandra.spark.sparksql.filters.SparkRangeFilter sparkRangeFilter, java.util.List<org.apache.cassandra.spark.sparksql.filters.PartitionKeyFilter> partitionKeyFilters)org.apache.cassandra.analytics.stats.Statsstats()Override to plug in your own Stats instrumentation for recording internal eventsorg.apache.cassandra.spark.utils.TimeProvidertimeProvider()LocalDataLayerwithMinimumReplicasPerMutation(int minimumReplicasPerMutation)-
Methods inherited from class org.apache.cassandra.spark.data.DataLayer
bigNumberConfig, openCompactionScanner, openCompactionScanner, openPartitionSizeIterator, partitionKeyFiltersInRange, partitionSizeStructType, readIndexOffset, sparkRangeFilter, structType, typeConverter, unsupportedPushDownFilters, useIncrementalRepair, version
-
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LocalDataLayer
public LocalDataLayer(@NotNull org.apache.cassandra.bridge.CassandraVersion version, @NotNull java.lang.String keyspace, @NotNull java.lang.String createStatement, java.lang.String... paths)
-
LocalDataLayer
public LocalDataLayer(@NotNull org.apache.cassandra.bridge.CassandraVersion version, @NotNull java.lang.String keyspace, @NotNull java.lang.String createStatement, @NotNull java.util.Set<java.lang.String> udtStatements, java.lang.String... paths)
-
LocalDataLayer
public LocalDataLayer(@NotNull org.apache.cassandra.bridge.CassandraVersion version, @NotNull org.apache.cassandra.spark.data.partitioner.Partitioner partitioner, @NotNull java.lang.String keyspace, @NotNull java.lang.String createStatement, @NotNull java.util.Set<java.lang.String> udts, @NotNull java.util.List<org.apache.cassandra.spark.config.SchemaFeature> requestedFeatures, boolean useBufferingInputStream, @Nullable java.lang.String statsClass, java.lang.String... paths)
-
-
Method Detail
-
from
public static LocalDataLayer from(java.util.Map<java.lang.String,java.lang.String> options)
Builds a newDataLayerfrom theoptionsmap. The keys for the map must be lower-cased to guarantee compatibility with maps where the keys are all lower-cased.- Parameters:
options- the map with options- Returns:
- a new
DataLayer
-
requestedFeatures
public java.util.List<org.apache.cassandra.spark.config.SchemaFeature> requestedFeatures()
- Overrides:
requestedFeaturesin classDataLayer
-
bridge
public org.apache.cassandra.bridge.CassandraBridge bridge()
-
partitioner
public org.apache.cassandra.spark.data.partitioner.Partitioner partitioner()
- Specified by:
partitionerin classDataLayer
-
partitionCount
public int partitionCount()
- Specified by:
partitionCountin classDataLayer
-
isInPartition
public boolean isInPartition(int partitionId, java.math.BigInteger token, java.nio.ByteBuffer key)- Specified by:
isInPartitionin classDataLayer
-
timeProvider
public org.apache.cassandra.spark.utils.TimeProvider timeProvider()
- Specified by:
timeProviderin classDataLayer- Returns:
- a TimeProvider
-
cqlTable
public org.apache.cassandra.spark.data.CqlTable cqlTable()
-
stats
public org.apache.cassandra.analytics.stats.Stats stats()
Description copied from class:DataLayerOverride to plug in your own Stats instrumentation for recording internal events
-
setDataFilePaths
public void setDataFilePaths(java.util.Set<java.nio.file.Path> dataFilePaths)
-
sstables
public org.apache.cassandra.spark.data.SSTablesSupplier sstables(int partitionId, @Nullable org.apache.cassandra.spark.sparksql.filters.SparkRangeFilter sparkRangeFilter, @NotNull java.util.List<org.apache.cassandra.spark.sparksql.filters.PartitionKeyFilter> partitionKeyFilters)
-
withMinimumReplicasPerMutation
public LocalDataLayer withMinimumReplicasPerMutation(int minimumReplicasPerMutation)
-
jobId
public java.lang.String jobId()
-
executorService
protected java.util.concurrent.ExecutorService executorService()
Description copied from class:DataLayerDataLayer implementation should provide an ExecutorService for doing blocking I/O when opening SSTable readers. It is the responsibility of the DataLayer implementation to appropriately size and manage this ExecutorService.- Specified by:
executorServicein classDataLayer- Returns:
- executor service
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
-