Interface IracTombstoneManager
- All Known Implementing Classes:
DefaultIracTombstoneManager,NoOpIracTombstoneManager
public interface IracTombstoneManager
Stores and manages tombstones for removed keys.
It manages the tombstones for IRAC protocol. Tombstones are used when a key is removed but the version/metadata is required to perform conflict or duplicates detection.
Tombstones are removed when they are not required by any site or its value is updated (with a non-null value).
- Since:
- 14.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidcheckStaleTombstone(Collection<? extends IracTombstoneInfo> tombstones) It receives aCollectionofIracTombstoneInfoand sendsIracTombstoneCleanupCommandfor the tombstone no longer valid.longgetTombstone(Object key) Returns the tombstone associated to thekeyornullif it doesn't exist.booleanisEmpty()booleanvoidremoveTombstone(Object key) Removes the tombstone forkey.voidremoveTombstone(IracTombstoneInfo tombstone) Removes the tombstone if it matches.voidsendStateTo(Address requestor, IntSet segments) Sends the tombstone belonging to the segments insegmentto theoriginatorintsize()voidstoreTombstone(int segment, Object key, IracMetadata metadata) Stores a tombstone for a removed key.default voidstoreTombstoneIfAbsent(int segment, Object key, IracMetadata metadata) Same asstoreTombstone(int, Object, IracMetadata)but it doesn't overwrite an existing tombstone.voidstoreTombstoneIfAbsent(IracTombstoneInfo tombstone) Same asstoreTombstoneIfAbsent(int, Object, IracMetadata)but with aIracTombstoneInfoinstance.
-
Method Details
-
storeTombstone
Stores a tombstone for a removed key.It overwrites any previous tombstone associated to the
key.- Parameters:
key- The key.segment- The key's segment.metadata- TheIracMetadata.
-
storeTombstoneIfAbsent
Same asstoreTombstone(int, Object, IracMetadata)but it doesn't overwrite an existing tombstone.- Parameters:
key- The key.segment- The key's segment.metadata- TheIracMetadata.
-
storeTombstoneIfAbsent
Same asstoreTombstoneIfAbsent(int, Object, IracMetadata)but with aIracTombstoneInfoinstance.- Parameters:
tombstone- The tombstone to store.
-
removeTombstone
Removes the tombstone if it matches.- Parameters:
tombstone- TheIracTombstoneInfo.
-
removeTombstone
Removes the tombstone forkey.- Parameters:
key- The key.
-
getTombstone
Returns the tombstone associated to thekeyornullif it doesn't exist.- Parameters:
key- The key.- Returns:
- The tombstone.
-
isEmpty
boolean isEmpty()- Returns:
trueif no tombstones are stored.
-
size
int size()- Returns:
- the number of tombstones stored.
-
isTaskRunning
boolean isTaskRunning()- Returns:
trueif the cleanup task is currently running.
-
getCurrentDelayMillis
long getCurrentDelayMillis()- Returns:
- The current delay between cleanup task in milliseconds.
-
sendStateTo
Sends the tombstone belonging to the segments insegmentto theoriginatorThe sending is done asynchronously, and it does not wait for the sending to complete.
- Parameters:
requestor- The requestorAddress.segments- The segments requested.
-
checkStaleTombstone
It receives aCollectionofIracTombstoneInfoand sendsIracTombstoneCleanupCommandfor the tombstone no longer valid.- Parameters:
tombstones- TheIracTombstoneInfocollection.
-