Class AbstractStrategyHolder
- java.lang.Object
-
- org.apache.cassandra.db.compaction.AbstractStrategyHolder
-
- Direct Known Subclasses:
CompactionStrategyHolder,PendingRepairHolder
public abstract class AbstractStrategyHolder extends java.lang.ObjectWrapper 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 interfaceAbstractStrategyHolder.DestinationRouterstatic classAbstractStrategyHolder.GroupedSSTableContainerMaps sstables to their token partition bucketstatic classAbstractStrategyHolder.TaskSupplier
-
Field Summary
Fields Modifier and Type Field Description protected ColumnFamilyStorecfs
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidaddSSTable(SSTableReader sstable)abstract voidaddSSTables(AbstractStrategyHolder.GroupedSSTableContainer sstables)abstract java.lang.Iterable<AbstractCompactionStrategy>allStrategies()abstract booleancontainsSSTable(SSTableReader sstable)AbstractStrategyHolder.GroupedSSTableContainercreateGroupedSSTableContainer()abstract SSTableMultiWritercreateSSTableMultiWriter(Descriptor descriptor, long keyCount, long repairedAt, TimeUUID 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 AbstractCompactionStrategygetStrategyFor(SSTableReader sstable)abstract intgetStrategyIndex(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 booleanmanagesRepairedGroup(boolean isRepaired, boolean isPendingRepair, boolean isTransient)SSTables are grouped by their repaired and pending repair status.booleanmanagesSSTable(SSTableReader sstable)abstract voidremoveSSTables(AbstractStrategyHolder.GroupedSSTableContainer sstables)abstract voidreplaceSSTables(AbstractStrategyHolder.GroupedSSTableContainer removed, AbstractStrategyHolder.GroupedSSTableContainer added)protected abstract voidsetStrategyInternal(CompactionParams params, int numTokenPartitions)abstract voidshutdown()abstract voidstartup()
-
-
-
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()
-
addSSTable
public abstract void addSSTable(SSTableReader sstable)
-
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, TimeUUID 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)
-
-