Class ShardedCompactionWriter
java.lang.Object
org.apache.cassandra.utils.concurrent.Transactional.AbstractTransactional
org.apache.cassandra.db.compaction.writers.CompactionAwareWriter
org.apache.cassandra.db.compaction.unified.ShardedCompactionWriter
- All Implemented Interfaces:
AutoCloseable,Transactional
A
CompactionAwareWriter that splits the output sstable at the partition boundaries of the compaction
shards used by UnifiedCompactionStrategy.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.cassandra.utils.concurrent.Transactional.AbstractTransactional
Transactional.AbstractTransactional.StateNested classes/interfaces inherited from interface org.apache.cassandra.utils.concurrent.Transactional
Transactional.AbstractTransactional -
Field Summary
FieldsFields inherited from class org.apache.cassandra.db.compaction.writers.CompactionAwareWriter
cfs, currentDirectory, directories, estimatedTotalKeys, isTransient, maxAge, minRepairedAt, nonExpiredSSTables, pendingRepair, sstableWriter, txn -
Constructor Summary
ConstructorsConstructorDescriptionShardedCompactionWriter(ColumnFamilyStore cfs, Directories directories, LifecycleTransaction txn, Set<SSTableReader> nonExpiredSSTables, boolean keepOriginals, ShardTracker boundaries) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidDo any preparatory work prior to commit.protected booleanReturns true if the writer should be switched for reasons other than switching to a new data directory (e.g.protected longReturns the key count with which created sstables should be set up.protected SSTableWritersstableWriter(Directories.DataDirectory directory, DecoratedKey nextKey) Methods inherited from class org.apache.cassandra.db.compaction.writers.CompactionAwareWriter
append, doAbort, doCommit, doPostCleanup, estimatedKeys, finish, getDirectories, getExpectedWriteSize, getSStableDirectory, getWriteDirectory, maybeSwitchLocation, maybeSwitchWriter, newWriterBuilder, realAppend, setRepairedAt, sstableLevel, switchCompactionWriterMethods inherited from class org.apache.cassandra.utils.concurrent.Transactional.AbstractTransactional
abort, abort, close, commit, commit, doPreCleanup, prepareToCommit, stateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cassandra.utils.concurrent.Transactional
abort, close, commit, prepareToCommit
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
ShardedCompactionWriter
public ShardedCompactionWriter(ColumnFamilyStore cfs, Directories directories, LifecycleTransaction txn, Set<SSTableReader> nonExpiredSSTables, boolean keepOriginals, ShardTracker boundaries)
-
-
Method Details
-
shouldSwitchWriterInCurrentLocation
Description copied from class:CompactionAwareWriterReturns true if the writer should be switched for reasons other than switching to a new data directory (e.g. because an sstable size limit has been reached).- Specified by:
shouldSwitchWriterInCurrentLocationin classCompactionAwareWriter
-
sstableWriter
- Overrides:
sstableWriterin classCompactionAwareWriter
-
sstableKeyCount
protected long sstableKeyCount()Description copied from class:CompactionAwareWriterReturns the key count with which created sstables should be set up.- Specified by:
sstableKeyCountin classCompactionAwareWriter
-
doPrepare
protected void doPrepare()Description copied from class:Transactional.AbstractTransactionalDo any preparatory work prior to commit. This method should throw any exceptions that can be encountered during the finalization of the behaviour.- Overrides:
doPreparein classCompactionAwareWriter
-