Package org.apache.cassandra.service
Class SSTablesGlobalTracker
- java.lang.Object
-
- org.apache.cassandra.service.SSTablesGlobalTracker
-
- All Implemented Interfaces:
INotificationConsumer
public class SSTablesGlobalTracker extends java.lang.Object implements INotificationConsumer
Tracks all sstables in use on the local node.Each table tracks its own SSTables in
ColumnFamilyStore
(throughTracker
) for most purposes, but this class groups information we need on all the sstables the node has.
-
-
Constructor Summary
Constructors Constructor Description SSTablesGlobalTracker(SSTableFormat<?,?> currentSSTableFormat)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handleNotification(INotification notification, java.lang.Object sender)
boolean
register(INotificationConsumer subscriber)
Register a new subscriber to this tracker.boolean
unregister(INotificationConsumer subscriber)
Unregister a subscriber from this tracker.java.util.Set<Version>
versionsInUse()
The set of all sstable versions currently in use on this node.
-
-
-
Constructor Detail
-
SSTablesGlobalTracker
public SSTablesGlobalTracker(SSTableFormat<?,?> currentSSTableFormat)
-
-
Method Detail
-
versionsInUse
public java.util.Set<Version> versionsInUse()
The set of all sstable versions currently in use on this node.
-
register
public boolean register(INotificationConsumer subscriber)
Register a new subscriber to this tracker. Registered subscribers are currently notified when the set of sstable versions in use changes, using aSSTablesVersionsInUseChangeNotification
.- Parameters:
subscriber
- the new subscriber to register. If this subscriber is already registered, this method does nothing (meaning that even if a subscriber is registered multiple times, it will only be notified once on every change).- Returns:
- whether the subscriber was register (so whether it was not already registered).
-
unregister
public boolean unregister(INotificationConsumer subscriber)
Unregister a subscriber from this tracker.- Parameters:
subscriber
- the subscriber to unregister. If this subscriber is not registered, this method does nothing.- Returns:
- whether the subscriber was unregistered (so whether it was registered subscriber of this tracker).
-
handleNotification
public void handleNotification(INotification notification, java.lang.Object sender)
- Specified by:
handleNotification
in interfaceINotificationConsumer
-
-