Class CompactionTask
java.lang.Object
org.apache.cassandra.utils.WrappedRunnable
org.apache.cassandra.db.compaction.AbstractCompactionTask
org.apache.cassandra.db.compaction.CompactionTask
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
LeveledCompactionTask,SSTableSplitter.SplittingCompactionTask,TimeWindowCompactionTask,UnifiedCompactionTask
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final longprotected final booleanprotected static final org.slf4j.Loggerprotected static longFields inherited from class org.apache.cassandra.db.compaction.AbstractCompactionTask
cfs, compactionType, isUserDefined, transaction -
Constructor Summary
ConstructorsConstructorDescriptionCompactionTask(ColumnFamilyStore cfs, LifecycleTransaction txn, long gcBefore) CompactionTask(ColumnFamilyStore cfs, LifecycleTransaction txn, long gcBefore, boolean keepOriginals) -
Method Summary
Modifier and TypeMethodDescriptionstatic longaddToTotalBytesCompacted(long bytesCompacted) protected booleanbuildCompactionCandidatesForAvailableDiskSpace(Set<SSTableReader> fullyExpiredSSTables, TimeUUID taskId) protected intexecuteInternal(ActiveCompactionsTracker activeCompactions) getCompactionAwareWriter(ColumnFamilyStore cfs, Directories directories, LifecycleTransaction transaction, Set<SSTableReader> nonExpiredSSTables) protected CompactionControllergetCompactionController(Set<SSTableReader> toCompact) protected Directoriesstatic booleangetIsTransient(Set<SSTableReader> sstables) protected intgetLevel()static longgetMaxDataAge(Collection<SSTableReader> sstables) static longgetMinRepairedAt(Set<SSTableReader> actuallyCompact) static TimeUUIDgetPendingRepair(Set<SSTableReader> sstables) protected booleanbooleanreduceScopeForLimitedSpace(Set<SSTableReader> nonExpiredSSTables, long expectedSize) protected voidFor internal use and testing only.static StringupdateCompactionHistory(TimeUUID taskId, String keyspaceName, String columnFamilyName, long[] mergedRowCounts, long startSize, long endSize, Map<String, String> compactionProperties) Methods inherited from class org.apache.cassandra.db.compaction.AbstractCompactionTask
execute, setCompactionType, setUserDefined, toStringMethods inherited from class org.apache.cassandra.utils.WrappedRunnable
run
-
Field Details
-
logger
protected static final org.slf4j.Logger logger -
gcBefore
protected final long gcBefore -
keepOriginals
protected final boolean keepOriginals -
totalBytesCompacted
protected static long totalBytesCompacted
-
-
Constructor Details
-
CompactionTask
-
CompactionTask
public CompactionTask(ColumnFamilyStore cfs, LifecycleTransaction txn, long gcBefore, boolean keepOriginals)
-
-
Method Details
-
addToTotalBytesCompacted
public static long addToTotalBytesCompacted(long bytesCompacted) -
executeInternal
- Specified by:
executeInternalin classAbstractCompactionTask
-
reduceScopeForLimitedSpace
-
runMayThrow
For internal use and testing only. The rest of the system should go through the submit* methods, which are properly serialized. Caller is in charge of marking/unmarking the sstables as compacting.- Specified by:
runMayThrowin classWrappedRunnable- Throws:
Exception
-
getCompactionAwareWriter
public CompactionAwareWriter getCompactionAwareWriter(ColumnFamilyStore cfs, Directories directories, LifecycleTransaction transaction, Set<SSTableReader> nonExpiredSSTables) - Specified by:
getCompactionAwareWriterin classAbstractCompactionTask
-
updateCompactionHistory
-
getDirectories
-
getMinRepairedAt
-
getPendingRepair
-
getIsTransient
-
buildCompactionCandidatesForAvailableDiskSpace
protected boolean buildCompactionCandidatesForAvailableDiskSpace(Set<SSTableReader> fullyExpiredSSTables, TimeUUID taskId) -
getLevel
protected int getLevel() -
getCompactionController
-
partialCompactionsAcceptable
protected boolean partialCompactionsAcceptable() -
getMaxDataAge
-