Class SSTableLister
- java.lang.Object
-
- org.apache.cassandra.spark.bulkwriter.cloudstorage.SSTableLister
-
- All Implemented Interfaces:
SSTableCollector
public class SSTableLister extends java.lang.Object implements SSTableCollector
SSTableListerlists the directories containing SSTables. Internally, the listed SSTables are sorted by the insertion order of the directories, and by the first and end token of the SSTables. Therefore, it is expected that the SSTables are sorted when consuming from the lister.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.cassandra.spark.bulkwriter.cloudstorage.SSTableCollector
SSTableCollector.SSTableFilesAndRange
-
-
Constructor Summary
Constructors Constructor Description SSTableLister(org.apache.cassandra.spark.data.QualifiedTableName qualifiedTableName, org.apache.cassandra.bridge.CassandraBridge bridge)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SSTableCollector.SSTableFilesAndRangeconsumeOne()Get an SSTable from the collector and remove itjava.util.Map<java.nio.file.Path,Digest>fileDigests(java.util.Set<java.nio.file.Path> files)Get the file digests of the input filesvoidincludeDirectory(java.nio.file.Path dir)Include sstables under the directoryvoidincludeFileDigests(java.util.Map<java.nio.file.Path,Digest> fileDigests)Include the digests of the filesvoidincludeSSTable(java.util.List<java.nio.file.Path> sstableComponents)Include the sstable components of an individual SSTablebooleanisEmpty()SSTableCollector.SSTableFilesAndRangepeek()Get an SSTable from the collector, but do not remove itlongtotalSize()
-
-
-
Method Detail
-
includeDirectory
public void includeDirectory(java.nio.file.Path dir)
Description copied from interface:SSTableCollectorInclude sstables under the directory- Specified by:
includeDirectoryin interfaceSSTableCollector- Parameters:
dir- directory that contains sstables
-
includeSSTable
public void includeSSTable(java.util.List<java.nio.file.Path> sstableComponents)
Description copied from interface:SSTableCollectorInclude the sstable components of an individual SSTable- Specified by:
includeSSTablein interfaceSSTableCollector- Parameters:
sstableComponents- sstable components
-
includeFileDigests
public void includeFileDigests(java.util.Map<java.nio.file.Path,Digest> fileDigests)
Description copied from interface:SSTableCollectorInclude the digests of the files- Specified by:
includeFileDigestsin interfaceSSTableCollector- Parameters:
fileDigests- digest of the files
-
fileDigests
public java.util.Map<java.nio.file.Path,Digest> fileDigests(java.util.Set<java.nio.file.Path> files)
Description copied from interface:SSTableCollectorGet the file digests of the input files- Specified by:
fileDigestsin interfaceSSTableCollector- Parameters:
files- files to gather the digests- Returns:
- file digests of the input files
-
totalSize
public long totalSize()
- Specified by:
totalSizein interfaceSSTableCollector- Returns:
- total size of all sstables included
-
peek
public SSTableCollector.SSTableFilesAndRange peek()
Description copied from interface:SSTableCollectorGet an SSTable from the collector, but do not remove it- Specified by:
peekin interfaceSSTableCollector- Returns:
- sstable or null if the collector is empty
-
consumeOne
public SSTableCollector.SSTableFilesAndRange consumeOne()
Description copied from interface:SSTableCollectorGet an SSTable from the collector and remove it- Specified by:
consumeOnein interfaceSSTableCollector- Returns:
- sstable or null if the collector is empty
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceSSTableCollector- Returns:
- true if the collector is empty; otherwise, false
-
-