Class DefaultIracTombstoneManager
java.lang.Object
org.infinispan.container.versioning.irac.DefaultIracTombstoneManager
- All Implemented Interfaces:
IracTombstoneManager
A default implementation for
IracTombstoneManager.
This class is responsible to keep track of the tombstones for the IRAC algorithm. Tombstones are used when a key is removed but its metadata is necessary to detect possible conflicts in this and remote sites. When all sites have updated the key, the tombstone can be removed.
Tombstones are removed periodically in the background.
- Since:
- 14.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckStaleTombstone(Collection<? extends IracTombstoneInfo> tombstones) It receives aCollectionofIracTombstoneInfoand sendsIracTombstoneCleanupCommandfor the tombstone no longer valid.booleancontains(IracTombstoneInfo tombstone) 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.voidvoidsendStateTo(Address requestor, IntSet segments) Sends the tombstone belonging to the segments insegmentto theoriginatorintsize()voidstart()voidvoidstop()voidvoidstoreTombstone(int segment, Object key, IracMetadata metadata) Stores a tombstone for a removed key.voidstoreTombstoneIfAbsent(IracTombstoneInfo tombstone) Same asIracTombstoneManager.storeTombstoneIfAbsent(int, Object, IracMetadata)but with aIracTombstoneInfoinstance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.container.versioning.irac.IracTombstoneManager
storeTombstoneIfAbsent
-
Constructor Details
-
DefaultIracTombstoneManager
-
-
Method Details
-
start
public void start() -
stop
public void stop() -
stopCleanupTask
public void stopCleanupTask() -
storeTombstone
Description copied from interface:IracTombstoneManagerStores a tombstone for a removed key.It overwrites any previous tombstone associated to the
key.- Specified by:
storeTombstonein interfaceIracTombstoneManager- Parameters:
segment- The key's segment.key- The key.metadata- TheIracMetadata.
-
storeTombstoneIfAbsent
Description copied from interface:IracTombstoneManagerSame asIracTombstoneManager.storeTombstoneIfAbsent(int, Object, IracMetadata)but with aIracTombstoneInfoinstance.- Specified by:
storeTombstoneIfAbsentin interfaceIracTombstoneManager- Parameters:
tombstone- The tombstone to store.
-
getTombstone
Description copied from interface:IracTombstoneManagerReturns the tombstone associated to thekeyornullif it doesn't exist.- Specified by:
getTombstonein interfaceIracTombstoneManager- Parameters:
key- The key.- Returns:
- The tombstone.
-
removeTombstone
Description copied from interface:IracTombstoneManagerRemoves the tombstone if it matches.- Specified by:
removeTombstonein interfaceIracTombstoneManager- Parameters:
tombstone- TheIracTombstoneInfo.
-
removeTombstone
Description copied from interface:IracTombstoneManagerRemoves the tombstone forkey.- Specified by:
removeTombstonein interfaceIracTombstoneManager- Parameters:
key- The key.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceIracTombstoneManager- Returns:
trueif no tombstones are stored.
-
size
public int size()- Specified by:
sizein interfaceIracTombstoneManager- Returns:
- the number of tombstones stored.
-
isTaskRunning
public boolean isTaskRunning()- Specified by:
isTaskRunningin interfaceIracTombstoneManager- Returns:
trueif the cleanup task is currently running.
-
getCurrentDelayMillis
public long getCurrentDelayMillis()- Specified by:
getCurrentDelayMillisin interfaceIracTombstoneManager- Returns:
- The current delay between cleanup task in milliseconds.
-
sendStateTo
Description copied from interface:IracTombstoneManagerSends the tombstone belonging to the segments insegmentto theoriginatorThe sending is done asynchronously, and it does not wait for the sending to complete.
- Specified by:
sendStateToin interfaceIracTombstoneManager- Parameters:
requestor- The requestorAddress.segments- The segments requested.
-
checkStaleTombstone
Description copied from interface:IracTombstoneManagerIt receives aCollectionofIracTombstoneInfoand sendsIracTombstoneCleanupCommandfor the tombstone no longer valid.- Specified by:
checkStaleTombstonein interfaceIracTombstoneManager- Parameters:
tombstones- TheIracTombstoneInfocollection.
-
startCleanupTombstone
public void startCleanupTombstone() -
runCleanupAndWait
public void runCleanupAndWait() -
contains
-