Class AbstractStrategyHolder
java.lang.Object
org.apache.cassandra.db.compaction.AbstractStrategyHolder
- Direct Known Subclasses:
CompactionStrategyHolder,PendingRepairHolder
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 ClassesModifier and TypeClassDescriptionstatic interfacestatic classMaps sstables to their token partition bucketstatic class -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddSSTable(SSTableReader sstable) abstract voidabstract Iterable<AbstractCompactionStrategy>abstract booleancontainsSSTable(SSTableReader sstable) abstract SSTableMultiWritercreateSSTableMultiWriter(Descriptor descriptor, long keyCount, long repairedAt, TimeUUID pendingRepair, boolean isTransient, IntervalSet<CommitLogPosition> commitLogPositions, int sstableLevel, SerializationHeader header, Collection<Index.Group> indexGroups, LifecycleNewTracker lifecycleNewTracker) getBackgroundTaskSuppliers(long gcBefore) abstract intabstract Collection<AbstractCompactionTask>getMaximalTasks(long gcBefore, boolean splitOutput) abstract List<ISSTableScanner>getScanners(AbstractStrategyHolder.GroupedSSTableContainer sstables, 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 Collection<AbstractCompactionTask>getUserDefinedTasks(AbstractStrategyHolder.GroupedSSTableContainer sstables, long gcBefore) abstract booleanmanagesRepairedGroup(boolean isRepaired, boolean isPendingRepair, boolean isTransient) SSTables are grouped by their repaired and pending repair status.booleanmanagesSSTable(SSTableReader sstable) abstract voidabstract voidreplaceSSTables(AbstractStrategyHolder.GroupedSSTableContainer removed, AbstractStrategyHolder.GroupedSSTableContainer added) protected abstract voidsetStrategyInternal(CompactionParams params, int numTokenPartitions) abstract voidshutdown()abstract voidstartup()
-
Field Details
-
cfs
-
-
Method Details
-
startup
public abstract void startup() -
shutdown
public abstract void shutdown() -
setStrategyInternal
-
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
-
getStrategyFor
-
allStrategies
-
getBackgroundTaskSuppliers
public abstract Collection<AbstractStrategyHolder.TaskSupplier> getBackgroundTaskSuppliers(long gcBefore) -
getMaximalTasks
public abstract Collection<AbstractCompactionTask> getMaximalTasks(long gcBefore, boolean splitOutput) -
getUserDefinedTasks
public abstract Collection<AbstractCompactionTask> getUserDefinedTasks(AbstractStrategyHolder.GroupedSSTableContainer sstables, long gcBefore) -
createGroupedSSTableContainer
-
addSSTable
-
addSSTables
-
removeSSTables
-
replaceSSTables
public abstract void replaceSSTables(AbstractStrategyHolder.GroupedSSTableContainer removed, AbstractStrategyHolder.GroupedSSTableContainer added) -
getScanners
public abstract List<ISSTableScanner> getScanners(AbstractStrategyHolder.GroupedSSTableContainer sstables, Collection<Range<Token>> ranges) -
createSSTableMultiWriter
public abstract SSTableMultiWriter createSSTableMultiWriter(Descriptor descriptor, long keyCount, long repairedAt, TimeUUID pendingRepair, boolean isTransient, IntervalSet<CommitLogPosition> commitLogPositions, int sstableLevel, SerializationHeader header, Collection<Index.Group> indexGroups, LifecycleNewTracker lifecycleNewTracker) -
getStrategyIndex
Return the directory index the given compaction strategy belongs to, or -1 if it's not held by this holder -
containsSSTable
-
getEstimatedRemainingTasks
public abstract int getEstimatedRemainingTasks()
-