Class Tracker
java.lang.Object
org.apache.cassandra.db.lifecycle.Tracker
Tracker tracks live
View of data store for a table.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTracker(ColumnFamilyStore columnFamilyStore, Memtable memtable, boolean loadsstables) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInitialSSTables(Collection<SSTableReader> sstables) voidvoidaddSSTables(Collection<SSTableReader> sstables) booleancontains(INotificationConsumer consumer) voiddropSSTables(com.google.common.base.Predicate<SSTableReader> remove, OperationType operationType, Throwable accumulate) removes all sstables that are not busy compacting.dropSSTables(Throwable accumulate) dropSSTablesIfInvalid(Throwable accumulate) getMemtableFor(OpOrder.Group opGroup, CommitLogPosition commitLogPosition) get the Memtable that the ordered writeOp should be directed togetUncompacting(Iterable<SSTableReader> candidates) getView()booleanisDummy()voidmarkFlushing(Memtable memtable) voidmaybeIncrementallyBackup(Iterable<SSTableReader> sstables) static TrackervoidnotifyDeleting(SSTableReader deleting) voidnotifyDiscarded(Memtable discarded) voidnotifyRenewed(Memtable renewed) voidnotifySSTableMetadataChanged(SSTableReader levelChanged, StatsMetadata oldMetadata) voidnotifySSTableRepairedStatusChanged(Collection<SSTableReader> repairStatusesChanged) voidnotifySwitched(Memtable previous, Memtable next) voidnotifyTruncated(long truncatedAt) voidremoveUnreadableSSTables(File directory) Removes every SSTable in the directory from the Tracker's view.voidremoveUnsafe(Set<SSTableReader> toRemove) voidreplaceFlushed(Memtable memtable, Collection<SSTableReader> sstables) void(Re)initializes the tracker, purging all references.voidsubscribe(INotificationConsumer consumer) switchMemtable(boolean truncating, Memtable newMemtable) Switch the current memtable.tryModify(Iterable<? extends SSTableReader> sstables, OperationType operationType) tryModify(SSTableReader sstable, OperationType operationType) voidunsubscribe(INotificationConsumer consumer) voidupdateInitialSSTableSize(Iterable<SSTableReader> sstables) voidupdateLiveDiskSpaceUsed(long adjustment)
-
Field Details
-
cfstore
-
loadsstables
public final boolean loadsstables
-
-
Constructor Details
-
Tracker
- Parameters:
columnFamilyStore-memtable- Initial Memtable. Can be null.loadsstables- true to indicate to load SSTables (TODO: remove as this is only accessed from 2i)
-
-
Method Details
-
newDummyTracker
-
tryModify
-
tryModify
public LifecycleTransaction tryModify(Iterable<? extends SSTableReader> sstables, OperationType operationType) - Returns:
- a Transaction over the provided sstables if we are able to mark the given @param sstables as compacted, before anyone else
-
updateLiveDiskSpaceUsed
public void updateLiveDiskSpaceUsed(long adjustment) -
addInitialSSTables
-
addInitialSSTablesWithoutUpdatingSize
-
updateInitialSSTableSize
-
addSSTables
-
reset
(Re)initializes the tracker, purging all references. -
dropSSTablesIfInvalid
-
dropSSTables
public void dropSSTables() -
dropSSTables
-
dropSSTables
public Throwable dropSSTables(com.google.common.base.Predicate<SSTableReader> remove, OperationType operationType, Throwable accumulate) removes all sstables that are not busy compacting. -
removeUnreadableSSTables
Removes every SSTable in the directory from the Tracker's view.- Parameters:
directory- the unreadable directory, possibly with SSTables in it, but not necessarily.
-
getMemtableFor
get the Memtable that the ordered writeOp should be directed to -
switchMemtable
Switch the current memtable. This atomically appends a new memtable to the end of the list of active memtables, returning the previously last memtable. It leaves the previous Memtable in the list of live memtables until discarding(memtable) is called. These two methods must be synchronized/paired, i.e. m = switchMemtable must be followed by discarding(m), they cannot be interleaved.- Returns:
- the previously active memtable
-
markFlushing
-
replaceFlushed
-
getCompacting
-
getUncompacting
-
getUncompacting
-
maybeIncrementallyBackup
-
notifySSTableRepairedStatusChanged
-
notifySSTableMetadataChanged
-
notifyDeleting
-
notifyTruncated
public void notifyTruncated(long truncatedAt) -
notifyRenewed
-
notifySwitched
-
notifyDiscarded
-
isDummy
public boolean isDummy() -
subscribe
-
contains
-
unsubscribe
-
getView
-
removeUnsafe
-