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 TypeMethodDescriptionvoid
checkStaleTombstone
(Collection<? extends IracTombstoneInfo> tombstones) It receives aCollection
ofIracTombstoneInfo
and sendsIracTombstoneCleanupCommand
for the tombstone no longer valid.long
getTombstone
(Object key) Returns the tombstone associated to thekey
ornull
if it doesn't exist.boolean
isEmpty()
boolean
void
removeTombstone
(Object key) Removes the tombstone forkey
.void
removeTombstone
(IracTombstoneInfo tombstone) Removes the tombstone if it matches.void
sendStateTo
(Address requestor, IntSet segments) Sends the tombstone belonging to the segments insegment
to theoriginator
int
size()
void
storeTombstone
(int segment, Object key, IracMetadata metadata) Stores a tombstone for a removed key.default void
storeTombstoneIfAbsent
(int segment, Object key, IracMetadata metadata) Same asstoreTombstone(int, Object, IracMetadata)
but it doesn't overwrite an existing tombstone.void
storeTombstoneIfAbsent
(IracTombstoneInfo tombstone) Same asstoreTombstoneIfAbsent(int, Object, IracMetadata)
but with aIracTombstoneInfo
instance.
-
Method Details
-
storeTombstone
Stores a tombstone for a removed key.It overwrites any previous tombstone associated to the
key
.- Parameters:
segment
- The key's segment.key
- The key.metadata
- TheIracMetadata
.
-
storeTombstoneIfAbsent
Same asstoreTombstone(int, Object, IracMetadata)
but it doesn't overwrite an existing tombstone.- Parameters:
segment
- The key's segment.key
- The key.metadata
- TheIracMetadata
.
-
storeTombstoneIfAbsent
Same asstoreTombstoneIfAbsent(int, Object, IracMetadata)
but with aIracTombstoneInfo
instance.- 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 thekey
ornull
if it doesn't exist.- Parameters:
key
- The key.- Returns:
- The tombstone.
-
isEmpty
boolean isEmpty()- Returns:
true
if no tombstones are stored.
-
size
int size()- Returns:
- the number of tombstones stored.
-
isTaskRunning
boolean isTaskRunning()- Returns:
true
if 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 insegment
to theoriginator
The 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 aCollection
ofIracTombstoneInfo
and sendsIracTombstoneCleanupCommand
for the tombstone no longer valid.- Parameters:
tombstones
- TheIracTombstoneInfo
collection.
-