public abstract class AbstractCompactionStrategy
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ColumnFamilyStore |
cfs |
protected static java.lang.String |
COMPACTION_ENABLED |
protected static long |
DEFAULT_TOMBSTONE_COMPACTION_INTERVAL |
protected static float |
DEFAULT_TOMBSTONE_THRESHOLD |
protected boolean |
enabled |
protected boolean |
isActive
pause/resume/getNextBackgroundTask must synchronize.
|
java.util.Map<java.lang.String,java.lang.String> |
options |
protected static java.lang.String |
TOMBSTONE_COMPACTION_INTERVAL_OPTION |
protected static java.lang.String |
TOMBSTONE_THRESHOLD_OPTION |
protected long |
tombstoneCompactionInterval |
protected float |
tombstoneThreshold |
Modifier | Constructor and Description |
---|---|
protected |
AbstractCompactionStrategy(ColumnFamilyStore cfs,
java.util.Map<java.lang.String,java.lang.String> options) |
Modifier and Type | Method and Description |
---|---|
void |
disable() |
void |
enable() |
static java.lang.Iterable<SSTableReader> |
filterSuspectSSTables(java.lang.Iterable<SSTableReader> originalCandidates)
Filters SSTables that are to be blacklisted from the given collection
|
abstract int |
getEstimatedRemainingTasks() |
abstract AbstractCompactionTask |
getMaximalTask(int gcBefore) |
abstract long |
getMaxSSTableSize() |
abstract AbstractCompactionTask |
getNextBackgroundTask(int gcBefore) |
java.util.List<ICompactionScanner> |
getScanners(java.util.Collection<SSTableReader> toCompact) |
java.util.List<ICompactionScanner> |
getScanners(java.util.Collection<SSTableReader> sstables,
Range<Token> range)
Returns a list of KeyScanners given sstables and a range on which to scan.
|
abstract AbstractCompactionTask |
getUserDefinedTask(java.util.Collection<SSTableReader> sstables,
int gcBefore) |
boolean |
isEnabled() |
void |
pause()
For internal, temporary suspension of background compactions so that we can do exceptional
things like truncate or major compaction
|
void |
resume()
For internal, temporary suspension of background compactions so that we can do exceptional
things like truncate or major compaction
|
void |
shutdown()
Releases any resources if this strategy is shutdown (when the CFS is reloaded after a schema change).
|
static java.util.Map<java.lang.String,java.lang.String> |
validateOptions(java.util.Map<java.lang.String,java.lang.String> options) |
protected boolean |
worthDroppingTombstones(SSTableReader sstable,
int gcBefore)
Check if given sstable is worth dropping tombstones at gcBefore.
|
protected static final float DEFAULT_TOMBSTONE_THRESHOLD
protected static final long DEFAULT_TOMBSTONE_COMPACTION_INTERVAL
protected static final java.lang.String TOMBSTONE_THRESHOLD_OPTION
protected static final java.lang.String TOMBSTONE_COMPACTION_INTERVAL_OPTION
protected static final java.lang.String COMPACTION_ENABLED
public final java.util.Map<java.lang.String,java.lang.String> options
protected final ColumnFamilyStore cfs
protected float tombstoneThreshold
protected long tombstoneCompactionInterval
protected boolean isActive
protected volatile boolean enabled
protected AbstractCompactionStrategy(ColumnFamilyStore cfs, java.util.Map<java.lang.String,java.lang.String> options)
public void pause()
public void resume()
public void shutdown()
public abstract AbstractCompactionTask getNextBackgroundTask(int gcBefore)
gcBefore
- throw away tombstones older than thispublic abstract AbstractCompactionTask getMaximalTask(int gcBefore)
gcBefore
- throw away tombstones older than thispublic abstract AbstractCompactionTask getUserDefinedTask(java.util.Collection<SSTableReader> sstables, int gcBefore)
sstables
- SSTables to compact. Must be marked as compacting.gcBefore
- throw away tombstones older than thispublic abstract int getEstimatedRemainingTasks()
public abstract long getMaxSSTableSize()
public boolean isEnabled()
public void enable()
public void disable()
public static java.lang.Iterable<SSTableReader> filterSuspectSSTables(java.lang.Iterable<SSTableReader> originalCandidates)
originalCandidates
- The collection to check for blacklisted SSTablespublic java.util.List<ICompactionScanner> getScanners(java.util.Collection<SSTableReader> sstables, Range<Token> range)
public java.util.List<ICompactionScanner> getScanners(java.util.Collection<SSTableReader> toCompact)
protected boolean worthDroppingTombstones(SSTableReader sstable, int gcBefore)
sstable
- SSTable to checkgcBefore
- time to drop tombstonespublic static java.util.Map<java.lang.String,java.lang.String> validateOptions(java.util.Map<java.lang.String,java.lang.String> options) throws ConfigurationException
ConfigurationException
Copyright © 2013 The Apache Software Foundation