public class SizeTieredCompactionStrategy extends AbstractCompactionStrategy
AbstractCompactionStrategy.ScannerList
Modifier and Type | Field and Description |
---|---|
protected int |
estimatedRemainingTasks |
protected SizeTieredCompactionStrategyOptions |
sizeTieredOptions |
protected java.util.Set<SSTableReader> |
sstables |
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 |
---|
SizeTieredCompactionStrategy(ColumnFamilyStore cfs,
java.util.Map<java.lang.String,java.lang.String> options) |
Modifier and Type | Method and Description |
---|---|
void |
addSSTable(SSTableReader added) |
static java.util.List<Pair<SSTableReader,java.lang.Long>> |
createSSTableAndLengthPairs(java.lang.Iterable<SSTableReader> sstables) |
static <T> java.util.List<java.util.List<T>> |
getBuckets(java.util.Collection<Pair<T,java.lang.Long>> files,
double bucketHigh,
double bucketLow,
long minSSTableSize) |
static int |
getEstimatedCompactionsByTasks(ColumnFamilyStore cfs,
java.util.List<java.util.List<SSTableReader>> tasks) |
int |
getEstimatedRemainingTasks() |
java.util.Collection<AbstractCompactionTask> |
getMaximalTask(int gcBefore,
boolean splitOutput) |
long |
getMaxSSTableBytes() |
AbstractCompactionTask |
getNextBackgroundTask(int gcBefore) |
protected java.util.Set<SSTableReader> |
getSSTables()
Returns the sstables managed by this strategy instance
|
AbstractCompactionTask |
getUserDefinedTask(java.util.Collection<SSTableReader> sstables,
int gcBefore) |
static java.util.List<SSTableReader> |
mostInterestingBucket(java.util.List<java.util.List<SSTableReader>> buckets,
int minThreshold,
int maxThreshold) |
void |
removeSSTable(SSTableReader sstable) |
boolean |
shouldDefragment() |
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) |
addSSTables, createSSTableMultiWriter, filterSuspectSSTables, getCompactionTask, getDirectories, getName, getScanners, getScanners, getScanners, groupSSTablesForAntiCompaction, metadataChanged, pause, removeSSTables, replaceSSTables, resume, shutdown, startup, strategyLogger, supportsEarlyOpen, worthDroppingTombstones
protected SizeTieredCompactionStrategyOptions sizeTieredOptions
protected volatile int estimatedRemainingTasks
protected final java.util.Set<SSTableReader> sstables
public SizeTieredCompactionStrategy(ColumnFamilyStore cfs, java.util.Map<java.lang.String,java.lang.String> options)
public static java.util.List<SSTableReader> mostInterestingBucket(java.util.List<java.util.List<SSTableReader>> buckets, int minThreshold, int maxThreshold)
buckets
- list of buckets from which to return the most interesting, where "interesting" is the total hotness for readsminThreshold
- minimum number of sstables in a bucket to qualify as interestingmaxThreshold
- maximum number of sstables to compact at once (the returned bucket will be trimmed down to this)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 int getEstimatedRemainingTasks()
getEstimatedRemainingTasks
in class AbstractCompactionStrategy
public static java.util.List<Pair<SSTableReader,java.lang.Long>> createSSTableAndLengthPairs(java.lang.Iterable<SSTableReader> sstables)
public static <T> java.util.List<java.util.List<T>> getBuckets(java.util.Collection<Pair<T,java.lang.Long>> files, double bucketHigh, double bucketLow, long minSSTableSize)
public static int getEstimatedCompactionsByTasks(ColumnFamilyStore cfs, java.util.List<java.util.List<SSTableReader>> tasks)
public long getMaxSSTableBytes()
getMaxSSTableBytes
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
public boolean shouldDefragment()
shouldDefragment
in class AbstractCompactionStrategy
public void addSSTable(SSTableReader added)
addSSTable
in class AbstractCompactionStrategy
public void removeSSTable(SSTableReader sstable)
removeSSTable
in class AbstractCompactionStrategy
protected java.util.Set<SSTableReader> getSSTables()
AbstractCompactionStrategy
getSSTables
in class AbstractCompactionStrategy
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2009-2020 The Apache Software Foundation