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 SummaryConstructorsConstructorDescriptionDefaultIracTombstoneManager(Configuration config, Collection<IracXSiteBackup> backups) 
- 
Method SummaryModifier 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.container.versioning.irac.IracTombstoneManagerstoreTombstoneIfAbsent
- 
Constructor Details- 
DefaultIracTombstoneManager
 
- 
- 
Method Details- 
startpublic void start()
- 
stoppublic void stop()
- 
stopCleanupTaskpublic void stopCleanupTask()
- 
storeTombstoneDescription copied from interface:IracTombstoneManagerStores a tombstone for a removed key.It overwrites any previous tombstone associated to the key.- Specified by:
- storeTombstonein interface- IracTombstoneManager
- Parameters:
- segment- The key's segment.
- key- The key.
- metadata- The- IracMetadata.
 
- 
storeTombstoneIfAbsentDescription copied from interface:IracTombstoneManagerSame asIracTombstoneManager.storeTombstoneIfAbsent(int, Object, IracMetadata)but with aIracTombstoneInfoinstance.- Specified by:
- storeTombstoneIfAbsentin interface- IracTombstoneManager
- Parameters:
- tombstone- The tombstone to store.
 
- 
getTombstoneDescription copied from interface:IracTombstoneManagerReturns the tombstone associated to thekeyornullif it doesn't exist.- Specified by:
- getTombstonein interface- IracTombstoneManager
- Parameters:
- key- The key.
- Returns:
- The tombstone.
 
- 
removeTombstoneDescription copied from interface:IracTombstoneManagerRemoves the tombstone if it matches.- Specified by:
- removeTombstonein interface- IracTombstoneManager
- Parameters:
- tombstone- The- IracTombstoneInfo.
 
- 
removeTombstoneDescription copied from interface:IracTombstoneManagerRemoves the tombstone forkey.- Specified by:
- removeTombstonein interface- IracTombstoneManager
- Parameters:
- key- The key.
 
- 
isEmptypublic boolean isEmpty()- Specified by:
- isEmptyin interface- IracTombstoneManager
- Returns:
- trueif no tombstones are stored.
 
- 
sizepublic int size()- Specified by:
- sizein interface- IracTombstoneManager
- Returns:
- the number of tombstones stored.
 
- 
isTaskRunningpublic boolean isTaskRunning()- Specified by:
- isTaskRunningin interface- IracTombstoneManager
- Returns:
- trueif the cleanup task is currently running.
 
- 
getCurrentDelayMillispublic long getCurrentDelayMillis()- Specified by:
- getCurrentDelayMillisin interface- IracTombstoneManager
- Returns:
- The current delay between cleanup task in milliseconds.
 
- 
sendStateToDescription 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 interface- IracTombstoneManager
- Parameters:
- requestor- The requestor- Address.
- segments- The segments requested.
 
- 
checkStaleTombstoneDescription copied from interface:IracTombstoneManagerIt receives aCollectionofIracTombstoneInfoand sendsIracTombstoneCleanupCommandfor the tombstone no longer valid.- Specified by:
- checkStaleTombstonein interface- IracTombstoneManager
- Parameters:
- tombstones- The- IracTombstoneInfocollection.
 
- 
startCleanupTombstonepublic void startCleanupTombstone()
- 
runCleanupAndWaitpublic void runCleanupAndWait()
- 
contains
- 
checkStaleTombstones
- 
checkStaleKeys
 
-