org.apache.cassandra.db.compaction

## Class AbstractCompactionTask

- java.lang.Object
- - org.apache.cassandra.utils.WrappedRunnable
  - - org.apache.cassandra.io.util.DiskAwareRunnable
    - - org.apache.cassandra.db.compaction.AbstractCompactionTask

All Implemented Interfaces:
  java.lang.Runnable

Direct Known Subclasses:
  CompactionTask

    public abstract class AbstractCompactionTask
    extends DiskAwareRunnable

### Field Summary

Fields
`protected ColumnFamilyStore` `cfs`
`protected OperationType` `compactionType`
`protected boolean` `isUserDefined`
`protected java.lang.Iterable<SSTableReader>` `sstables`

### Constructor Summary

Constructors
Constructor and Description
`AbstractCompactionTask(ColumnFamilyStore cfs, java.lang.Iterable<SSTableReader> sstables)`

### Method Summary

Methods
`int` `execute(CompactionManager.CompactionExecutorStatsCollector collector)` executes the task and unmarks sstables compacting
`protected abstract int` `executeInternal(CompactionManager.CompactionExecutorStatsCollector collector)`
`protected Directories` `getDirectories()` Get sstable directories for the CF.
`AbstractCompactionTask` `setCompactionType(OperationType compactionType)`
`AbstractCompactionTask` `setUserDefined(boolean isUserDefined)`
`java.lang.String` `toString()`

### Methods inherited from class org.apache.cassandra.io.util.DiskAwareRunnable

`getExpectedWriteSize, reduceScopeForLimitedSpace, runMayThrow, runWith`

### Methods inherited from class org.apache.cassandra.utils.WrappedRunnable

`run`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### cfs

    protected final ColumnFamilyStore cfs

#### sstables

    protected java.lang.Iterable<SSTableReader> sstables

#### isUserDefined

    protected boolean isUserDefined

#### compactionType

    protected OperationType compactionType

### Constructor Detail

#### AbstractCompactionTask

    public AbstractCompactionTask(ColumnFamilyStore cfs,
                          java.lang.Iterable<SSTableReader> sstables)

Parameters:
  `cfs` -
  `sstables` - must be marked compacting

### Method Detail

#### execute

    public int execute(CompactionManager.CompactionExecutorStatsCollector collector)

executes the task and unmarks sstables compacting

#### executeInternal

    protected abstract int executeInternal(CompactionManager.CompactionExecutorStatsCollector collector)

#### getDirectories

    protected Directories getDirectories()

Description copied from class: `DiskAwareRunnable`
Get sstable directories for the CF.

Specified by:
  `getDirectories` in class `DiskAwareRunnable`
Returns:
  Directories instance for the CF.

#### setUserDefined

    public AbstractCompactionTask setUserDefined(boolean isUserDefined)

#### setCompactionType

    public AbstractCompactionTask setCompactionType(OperationType compactionType)

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`