org.apache.cassandra.db.compaction
Class CompactionTask
java.lang.Object
org.apache.cassandra.utils.WrappedRunnable
org.apache.cassandra.io.util.DiskAwareRunnable
org.apache.cassandra.db.compaction.AbstractCompactionTask
org.apache.cassandra.db.compaction.CompactionTask
- All Implemented Interfaces:
- java.lang.Runnable
- Direct Known Subclasses:
- LeveledCompactionTask
public class CompactionTask
- extends AbstractCompactionTask
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
logger
protected static final org.slf4j.Logger logger
gcBefore
protected final int gcBefore
totalBytesCompacted
protected static long totalBytesCompacted
CompactionTask
public CompactionTask(ColumnFamilyStore cfs,
java.util.Collection<SSTableReader> sstables,
int gcBefore)
addToTotalBytesCompacted
public static long addToTotalBytesCompacted(long bytesCompacted)
execute
public int execute(CompactionManager.CompactionExecutorStatsCollector collector)
- 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:
execute
in class AbstractCompactionTask
getExpectedWriteSize
public long getExpectedWriteSize()
- Description copied from class:
DiskAwareRunnable
- Get expected write size to determine which disk to use for this task.
- Specified by:
getExpectedWriteSize
in class DiskAwareRunnable
- Returns:
- expected size in bytes this task will write to disk.
reduceScopeForLimitedSpace
public boolean reduceScopeForLimitedSpace()
- Description copied from class:
DiskAwareRunnable
- Called if no disk is available with free space for the full write size.
- Overrides:
reduceScopeForLimitedSpace
in class DiskAwareRunnable
- Returns:
- true if the scope of the task was successfully reduced.
runWith
protected void runWith(java.io.File dataDirectory)
throws java.lang.Exception
- 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:
runWith
in class DiskAwareRunnable
- Parameters:
dataDirectory
- data directory to work on
- Throws:
java.lang.Exception
partialCompactionsAcceptable
protected boolean partialCompactionsAcceptable()
newSSTableSegmentThresholdReached
protected boolean newSSTableSegmentThresholdReached(SSTableWriter writer)
getMaxDataAge
public static long getMaxDataAge(java.util.Collection<SSTableReader> sstables)
Copyright © 2013 The Apache Software Foundation