public class LeveledCompactionStrategy extends AbstractCompactionStrategy
AbstractCompactionStrategy.ScannerList
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_LEVEL_FANOUT_SIZE |
cfs, COMPACTION_ENABLED, DEFAULT_LOG_ALL_OPTION, DEFAULT_TOMBSTONE_COMPACTION_INTERVAL, DEFAULT_TOMBSTONE_THRESHOLD, DEFAULT_UNCHECKED_TOMBSTONE_COMPACTION_OPTION, disableTombstoneCompactions, isActive, LOG_ALL_OPTION, logAll, ONLY_PURGE_REPAIRED_TOMBSTONES, options, TOMBSTONE_COMPACTION_INTERVAL_OPTION, TOMBSTONE_THRESHOLD_OPTION, tombstoneCompactionInterval, tombstoneThreshold, UNCHECKED_TOMBSTONE_COMPACTION_OPTION, uncheckedTombstoneCompaction
Constructor and Description |
---|
LeveledCompactionStrategy(ColumnFamilyStore cfs,
java.util.Map<java.lang.String,java.lang.String> options) |
Modifier and Type | Method and Description |
---|---|
void |
addSSTable(SSTableReader added)
Adds sstable, note that implementations must handle duplicate notifications here (added already being in the compaction strategy)
|
void |
addSSTables(java.lang.Iterable<SSTableReader> sstables)
Adds sstables, note that implementations must handle duplicate notifications here (added already being in the compaction strategy)
|
int[] |
getAllLevelSize() |
AbstractCompactionTask |
getCompactionTask(LifecycleTransaction txn,
int gcBefore,
long maxSSTableBytes) |
int |
getEstimatedRemainingTasks() |
int |
getLevelFanoutSize() |
int |
getLevelSize(int i) |
java.util.Collection<AbstractCompactionTask> |
getMaximalTask(int gcBefore,
boolean splitOutput) |
long |
getMaxSSTableBytes() |
AbstractCompactionTask |
getNextBackgroundTask(int gcBefore)
the only difference between background and maximal in LCS is that maximal is still allowed
(by explicit user request) even when compaction is disabled.
|
AbstractCompactionStrategy.ScannerList |
getScanners(java.util.Collection<SSTableReader> sstables,
java.util.Collection<Range<Token>> ranges)
Returns a list of KeyScanners given sstables and a range on which to scan.
|
AbstractCompactionTask |
getUserDefinedTask(java.util.Collection<SSTableReader> sstables,
int gcBefore) |
java.util.Collection<java.util.Collection<SSTableReader>> |
groupSSTablesForAntiCompaction(java.util.Collection<SSTableReader> ssTablesToGroup)
Leveled compaction strategy has guarantees on the data contained within each level so we
have to make sure we only create groups of SSTables with members from the same level.
|
void |
removeSSTable(SSTableReader sstable)
Removes sstable from the strategy, implementations must be able to handle the sstable having already been removed.
|
void |
replaceSSTables(java.util.Collection<SSTableReader> removed,
java.util.Collection<SSTableReader> added)
Replaces sstables in the compaction strategy
Note that implementations must be able to handle duplicate notifications here (that removed are already gone and
added have already been added)
|
void |
startup()
Performs any extra initialization required
|
CompactionLogger.Strategy |
strategyLogger() |
java.lang.String |
toString() |
static java.util.Map<java.lang.String,java.lang.String> |
validateOptions(java.util.Map<java.lang.String,java.lang.String> options) |
createSSTableMultiWriter, disable, enable, filterSuspectSSTables, getDirectories, getMemtableReservedSize, getName, getScanners, getScanners, isAffectedByMeteredFlusher, pause, replaceFlushed, resume, shouldBeEnabled, shutdown, supportsEarlyOpen, worthDroppingTombstones
public static final int DEFAULT_LEVEL_FANOUT_SIZE
public LeveledCompactionStrategy(ColumnFamilyStore cfs, java.util.Map<java.lang.String,java.lang.String> options)
public int getLevelSize(int i)
public int[] getAllLevelSize()
public void startup()
AbstractCompactionStrategy
startup
in class AbstractCompactionStrategy
public AbstractCompactionTask getNextBackgroundTask(int gcBefore)
getNextBackgroundTask
in class AbstractCompactionStrategy
gcBefore
- throw away tombstones older than thispublic java.util.Collection<AbstractCompactionTask> getMaximalTask(int gcBefore, boolean splitOutput)
getMaximalTask
in class AbstractCompactionStrategy
gcBefore
- throw away tombstones older than thispublic AbstractCompactionTask getUserDefinedTask(java.util.Collection<SSTableReader> sstables, int gcBefore)
getUserDefinedTask
in class AbstractCompactionStrategy
sstables
- SSTables to compact. Must be marked as compacting.gcBefore
- throw away tombstones older than thispublic AbstractCompactionTask getCompactionTask(LifecycleTransaction txn, int gcBefore, long maxSSTableBytes)
getCompactionTask
in class AbstractCompactionStrategy
public java.util.Collection<java.util.Collection<SSTableReader>> groupSSTablesForAntiCompaction(java.util.Collection<SSTableReader> ssTablesToGroup)
groupSSTablesForAntiCompaction
in class AbstractCompactionStrategy
ssTablesToGroup
- public int getEstimatedRemainingTasks()
getEstimatedRemainingTasks
in class AbstractCompactionStrategy
public long getMaxSSTableBytes()
getMaxSSTableBytes
in class AbstractCompactionStrategy
public int getLevelFanoutSize()
public AbstractCompactionStrategy.ScannerList getScanners(java.util.Collection<SSTableReader> sstables, java.util.Collection<Range<Token>> ranges)
AbstractCompactionStrategy
getScanners
in class AbstractCompactionStrategy
public void replaceSSTables(java.util.Collection<SSTableReader> removed, java.util.Collection<SSTableReader> added)
AbstractCompactionStrategy
replaceSSTables
in class AbstractCompactionStrategy
public void addSSTables(java.lang.Iterable<SSTableReader> sstables)
AbstractCompactionStrategy
addSSTables
in class AbstractCompactionStrategy
public void addSSTable(SSTableReader added)
AbstractCompactionStrategy
addSSTable
in class AbstractCompactionStrategy
public void removeSSTable(SSTableReader sstable)
AbstractCompactionStrategy
removeSSTable
in class AbstractCompactionStrategy
public java.lang.String toString()
toString
in class java.lang.Object
public CompactionLogger.Strategy strategyLogger()
strategyLogger
in class AbstractCompactionStrategy
public 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 © 2009-2022 The Apache Software Foundation