Class AbstractStrategyHolder
- java.lang.Object
-
- org.apache.cassandra.db.compaction.AbstractStrategyHolder
-
- Direct Known Subclasses:
CompactionStrategyHolder
,PendingRepairHolder
public abstract class AbstractStrategyHolder extends java.lang.Object
Wrapper that's aware of how sstables are divided between separate strategies, and provides a standard interface to them not threadsafe, calls must be synchronized by caller
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AbstractStrategyHolder.DestinationRouter
static class
AbstractStrategyHolder.GroupedSSTableContainer
Maps sstables to their token partition bucketstatic class
AbstractStrategyHolder.TaskSupplier
-
Field Summary
Fields Modifier and Type Field Description protected ColumnFamilyStore
cfs
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
addSSTables(AbstractStrategyHolder.GroupedSSTableContainer sstables)
abstract java.lang.Iterable<AbstractCompactionStrategy>
allStrategies()
abstract boolean
containsSSTable(SSTableReader sstable)
AbstractStrategyHolder.GroupedSSTableContainer
createGroupedSSTableContainer()
abstract SSTableMultiWriter
createSSTableMultiWriter(Descriptor descriptor, long keyCount, long repairedAt, java.util.UUID pendingRepair, boolean isTransient, MetadataCollector collector, SerializationHeader header, java.util.Collection<Index> indexes, LifecycleNewTracker lifecycleNewTracker)
abstract java.util.Collection<AbstractStrategyHolder.TaskSupplier>
getBackgroundTaskSuppliers(int gcBefore)
abstract java.util.Collection<AbstractCompactionTask>
getMaximalTasks(int gcBefore, boolean splitOutput)
abstract java.util.List<ISSTableScanner>
getScanners(AbstractStrategyHolder.GroupedSSTableContainer sstables, java.util.Collection<Range<Token>> ranges)
abstract AbstractCompactionStrategy
getStrategyFor(SSTableReader sstable)
abstract int
getStrategyIndex(AbstractCompactionStrategy strategy)
Return the directory index the given compaction strategy belongs to, or -1 if it's not held by this holderabstract java.util.Collection<AbstractCompactionTask>
getUserDefinedTasks(AbstractStrategyHolder.GroupedSSTableContainer sstables, int gcBefore)
abstract boolean
managesRepairedGroup(boolean isRepaired, boolean isPendingRepair, boolean isTransient)
SSTables are grouped by their repaired and pending repair status.boolean
managesSSTable(SSTableReader sstable)
abstract void
removeSSTables(AbstractStrategyHolder.GroupedSSTableContainer sstables)
abstract void
replaceSSTables(AbstractStrategyHolder.GroupedSSTableContainer removed, AbstractStrategyHolder.GroupedSSTableContainer added)
protected abstract void
setStrategyInternal(CompactionParams params, int numTokenPartitions)
abstract void
shutdown()
abstract void
startup()
-
-
-
Field Detail
-
cfs
protected final ColumnFamilyStore cfs
-
-
Method Detail
-
startup
public abstract void startup()
-
shutdown
public abstract void shutdown()
-
setStrategyInternal
protected abstract void setStrategyInternal(CompactionParams params, int numTokenPartitions)
-
managesRepairedGroup
public abstract boolean managesRepairedGroup(boolean isRepaired, boolean isPendingRepair, boolean isTransient)
SSTables are grouped by their repaired and pending repair status. This method determines if this holder holds the sstable for the given repaired/grouped statuses. Holders should be mutually exclusive in the groups they deal with. IOW, if one holder returns true for a given isRepaired/isPendingRepair combo, none of the others should.
-
managesSSTable
public boolean managesSSTable(SSTableReader sstable)
-
getStrategyFor
public abstract AbstractCompactionStrategy getStrategyFor(SSTableReader sstable)
-
allStrategies
public abstract java.lang.Iterable<AbstractCompactionStrategy> allStrategies()
-
getBackgroundTaskSuppliers
public abstract java.util.Collection<AbstractStrategyHolder.TaskSupplier> getBackgroundTaskSuppliers(int gcBefore)
-
getMaximalTasks
public abstract java.util.Collection<AbstractCompactionTask> getMaximalTasks(int gcBefore, boolean splitOutput)
-
getUserDefinedTasks
public abstract java.util.Collection<AbstractCompactionTask> getUserDefinedTasks(AbstractStrategyHolder.GroupedSSTableContainer sstables, int gcBefore)
-
createGroupedSSTableContainer
public AbstractStrategyHolder.GroupedSSTableContainer createGroupedSSTableContainer()
-
addSSTables
public abstract void addSSTables(AbstractStrategyHolder.GroupedSSTableContainer sstables)
-
removeSSTables
public abstract void removeSSTables(AbstractStrategyHolder.GroupedSSTableContainer sstables)
-
replaceSSTables
public abstract void replaceSSTables(AbstractStrategyHolder.GroupedSSTableContainer removed, AbstractStrategyHolder.GroupedSSTableContainer added)
-
getScanners
public abstract java.util.List<ISSTableScanner> getScanners(AbstractStrategyHolder.GroupedSSTableContainer sstables, java.util.Collection<Range<Token>> ranges)
-
createSSTableMultiWriter
public abstract SSTableMultiWriter createSSTableMultiWriter(Descriptor descriptor, long keyCount, long repairedAt, java.util.UUID pendingRepair, boolean isTransient, MetadataCollector collector, SerializationHeader header, java.util.Collection<Index> indexes, LifecycleNewTracker lifecycleNewTracker)
-
getStrategyIndex
public abstract int getStrategyIndex(AbstractCompactionStrategy strategy)
Return the directory index the given compaction strategy belongs to, or -1 if it's not held by this holder
-
containsSSTable
public abstract boolean containsSSTable(SSTableReader sstable)
-
-