Class DefaultCompactionWriter
- java.lang.Object
-
- org.apache.cassandra.utils.concurrent.Transactional.AbstractTransactional
-
- org.apache.cassandra.db.compaction.writers.CompactionAwareWriter
-
- org.apache.cassandra.db.compaction.writers.DefaultCompactionWriter
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,Transactional
public class DefaultCompactionWriter extends CompactionAwareWriter
The default compaction writer - creates one output file in L0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.cassandra.utils.concurrent.Transactional.AbstractTransactional
Transactional.AbstractTransactional.State
-
Nested classes/interfaces inherited from interface org.apache.cassandra.utils.concurrent.Transactional
Transactional.AbstractTransactional
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Logger
logger
-
Fields inherited from class org.apache.cassandra.db.compaction.writers.CompactionAwareWriter
cfs, currentDirectory, directories, estimatedTotalKeys, isTransient, maxAge, minRepairedAt, nonExpiredSSTables, pendingRepair, sstableWriter, txn
-
-
Constructor Summary
Constructors Constructor Description DefaultCompactionWriter(ColumnFamilyStore cfs, Directories directories, LifecycleTransaction txn, java.util.Set<SSTableReader> nonExpiredSSTables)
DefaultCompactionWriter(ColumnFamilyStore cfs, Directories directories, LifecycleTransaction txn, java.util.Set<SSTableReader> nonExpiredSSTables, boolean keepOriginals, int sstableLevel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
shouldSwitchWriterInCurrentLocation(DecoratedKey key)
Returns true if the writer should be switched for reasons other than switching to a new data directory (e.g.protected long
sstableKeyCount()
Returns the key count with which created sstables should be set up.protected int
sstableLevel()
Returns the level that should be used when creating sstables.-
Methods inherited from class org.apache.cassandra.db.compaction.writers.CompactionAwareWriter
append, doAbort, doCommit, doPostCleanup, doPrepare, estimatedKeys, finish, getDirectories, getExpectedWriteSize, getSStableDirectory, getWriteDirectory, maybeSwitchLocation, maybeSwitchWriter, newWriterBuilder, realAppend, setRepairedAt, sstableWriter, switchCompactionWriter
-
Methods inherited from class org.apache.cassandra.utils.concurrent.Transactional.AbstractTransactional
abort, abort, close, commit, commit, doPreCleanup, prepareToCommit, state
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.utils.concurrent.Transactional
abort, close, commit, prepareToCommit
-
-
-
-
Constructor Detail
-
DefaultCompactionWriter
public DefaultCompactionWriter(ColumnFamilyStore cfs, Directories directories, LifecycleTransaction txn, java.util.Set<SSTableReader> nonExpiredSSTables)
-
DefaultCompactionWriter
public DefaultCompactionWriter(ColumnFamilyStore cfs, Directories directories, LifecycleTransaction txn, java.util.Set<SSTableReader> nonExpiredSSTables, boolean keepOriginals, int sstableLevel)
-
-
Method Detail
-
shouldSwitchWriterInCurrentLocation
protected boolean shouldSwitchWriterInCurrentLocation(DecoratedKey key)
Description copied from class:CompactionAwareWriter
Returns 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:
shouldSwitchWriterInCurrentLocation
in classCompactionAwareWriter
-
sstableLevel
protected int sstableLevel()
Description copied from class:CompactionAwareWriter
Returns the level that should be used when creating sstables.- Overrides:
sstableLevel
in classCompactionAwareWriter
-
sstableKeyCount
protected long sstableKeyCount()
Description copied from class:CompactionAwareWriter
Returns the key count with which created sstables should be set up.- Specified by:
sstableKeyCount
in classCompactionAwareWriter
-
-