org.apache.cassandra.db.compaction
Class CompactionTask

java.lang.Object
  extended by org.apache.cassandra.db.compaction.AbstractCompactionTask
      extended by org.apache.cassandra.db.compaction.CompactionTask
Direct Known Subclasses:
LeveledCompactionTask

public class CompactionTask
extends AbstractCompactionTask


Field Summary
protected  java.lang.String compactionFileLocation
           
protected  int gcBefore
           
protected  boolean isUserDefined
           
protected static long totalBytesCompacted
           
 
Fields inherited from class org.apache.cassandra.db.compaction.AbstractCompactionTask
cfs, sstables
 
Constructor Summary
CompactionTask(ColumnFamilyStore cfs, java.util.Collection<SSTableReader> sstables, int gcBefore)
           
 
Method Summary
static long addToTotalBytesCompacted(long bytesCompacted)
           
protected  boolean allowSingletonCompaction()
          extend this if the overridden compaction strategy requires single files to be compacted to function properly
 CompactionTask compactionFileLocation(java.lang.String compactionFileLocation)
           
 int execute(CompactionManager.CompactionExecutorStatsCollector collector)
          For internal use and testing only.
static long getMaxDataAge(java.util.Collection<SSTableReader> sstables)
           
 CompactionTask isUserDefined(boolean isUserDefined)
           
protected  boolean newSSTableSegmentThresholdReached(SSTableWriter writer, long position)
           
 
Methods inherited from class org.apache.cassandra.db.compaction.AbstractCompactionTask
getColumnFamilyStore, getSSTables, markSSTablesForCompaction, markSSTablesForCompaction, unmarkSSTables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

compactionFileLocation

protected java.lang.String compactionFileLocation

gcBefore

protected final int gcBefore

isUserDefined

protected boolean isUserDefined

totalBytesCompacted

protected static long totalBytesCompacted
Constructor Detail

CompactionTask

public CompactionTask(ColumnFamilyStore cfs,
                      java.util.Collection<SSTableReader> sstables,
                      int gcBefore)
Method Detail

addToTotalBytesCompacted

public static long addToTotalBytesCompacted(long bytesCompacted)

execute

public int execute(CompactionManager.CompactionExecutorStatsCollector collector)
            throws java.io.IOException
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
Throws:
java.io.IOException

newSSTableSegmentThresholdReached

protected boolean newSSTableSegmentThresholdReached(SSTableWriter writer,
                                                    long position)

allowSingletonCompaction

protected boolean allowSingletonCompaction()
extend this if the overridden compaction strategy requires single files to be compacted to function properly

Returns:
boolean

getMaxDataAge

public static long getMaxDataAge(java.util.Collection<SSTableReader> sstables)

compactionFileLocation

public CompactionTask compactionFileLocation(java.lang.String compactionFileLocation)

isUserDefined

public CompactionTask isUserDefined(boolean isUserDefined)


Copyright © 2011 The Apache Software Foundation