public class CompactionStrategyManager extends java.lang.Object implements INotificationConsumer
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
COMPACTION_ENABLED |
boolean |
isActive |
Constructor and Description |
---|
CompactionStrategyManager(ColumnFamilyStore cfs) |
Modifier and Type | Method and Description |
---|---|
void |
disable() |
void |
enable() |
AbstractCompactionTask |
getCompactionTask(LifecycleTransaction txn,
int gcBefore,
long maxSSTableBytes) |
int |
getEstimatedRemainingTasks() |
java.util.Collection<AbstractCompactionTask> |
getMaximalTasks(int gcBefore,
boolean splitOutput) |
long |
getMaxSSTableBytes() |
java.lang.String |
getName() |
AbstractCompactionTask |
getNextBackgroundTask(int gcBefore)
Return the next background task
Returns a task for the compaction strategy that needs it the most (most estimated remaining tasks)
|
AbstractCompactionStrategy.ScannerList |
getScanners(java.util.Collection<SSTableReader> sstables) |
AbstractCompactionStrategy.ScannerList |
getScanners(java.util.Collection<SSTableReader> sstables,
Range<Token> range)
Create ISSTableScanner from the given sstables
Delegates the call to the compaction strategies to allow LCS to create a scanner
|
int[] |
getSSTableCountPerLevel() |
java.util.List<AbstractCompactionStrategy> |
getStrategies() |
int |
getUnleveledSSTables() |
AbstractCompactionTask |
getUserDefinedTask(java.util.Collection<SSTableReader> sstables,
int gcBefore) |
java.util.Collection<java.util.Collection<SSTableReader>> |
groupSSTablesForAntiCompaction(java.util.Collection<SSTableReader> sstablesToGroup) |
void |
handleNotification(INotification notification,
java.lang.Object sender) |
boolean |
isEnabled() |
void |
maybeReload(CFMetaData metadata) |
void |
pause()
pause compaction while we cancel all ongoing compactions
Separate call from enable/disable to not have to save the enabled-state externally
|
void |
reload(CFMetaData metadata)
Reload the compaction strategies
Called after changing configuration and at startup.
|
void |
replaceFlushed(Memtable memtable,
SSTableReader sstable) |
void |
resume() |
boolean |
shouldBeEnabled() |
boolean |
shouldDefragment() |
void |
shutdown() |
protected static final java.lang.String COMPACTION_ENABLED
public boolean isActive
public CompactionStrategyManager(ColumnFamilyStore cfs)
public AbstractCompactionTask getNextBackgroundTask(int gcBefore)
public boolean isEnabled()
public void resume()
public void pause()
public void shutdown()
public void maybeReload(CFMetaData metadata)
public void reload(CFMetaData metadata)
metadata
- public void replaceFlushed(Memtable memtable, SSTableReader sstable)
public int getUnleveledSSTables()
public int[] getSSTableCountPerLevel()
public boolean shouldDefragment()
public void handleNotification(INotification notification, java.lang.Object sender)
handleNotification
in interface INotificationConsumer
public void enable()
public void disable()
public AbstractCompactionStrategy.ScannerList getScanners(java.util.Collection<SSTableReader> sstables, Range<Token> range)
sstables
- range
- public AbstractCompactionStrategy.ScannerList getScanners(java.util.Collection<SSTableReader> sstables)
public java.util.Collection<java.util.Collection<SSTableReader>> groupSSTablesForAntiCompaction(java.util.Collection<SSTableReader> sstablesToGroup)
public long getMaxSSTableBytes()
public AbstractCompactionTask getCompactionTask(LifecycleTransaction txn, int gcBefore, long maxSSTableBytes)
public java.util.Collection<AbstractCompactionTask> getMaximalTasks(int gcBefore, boolean splitOutput)
public AbstractCompactionTask getUserDefinedTask(java.util.Collection<SSTableReader> sstables, int gcBefore)
public int getEstimatedRemainingTasks()
public boolean shouldBeEnabled()
public java.lang.String getName()
public java.util.List<AbstractCompactionStrategy> getStrategies()
Copyright © 2015 The Apache Software Foundation