Interface IracVersionGenerator
-
- All Superinterfaces:
org.infinispan.commons.api.Lifecycle
- All Known Implementing Classes:
DefaultIracVersionGenerator,NoOpIracVersionGenerator
public interface IracVersionGenerator extends org.infinispan.commons.api.LifecycleA version generator for the IRAC protocol.It also stores the tombstone from the keys removed.
The version is segment based and the new version is also after than the previous one.
- Since:
- 11.0
- Author:
- Pedro Ruivo
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IracMetadatagenerateNewMetadata(int segment)Generator a newIracMetadatafor a givensegment.IracMetadatagetTombstone(Object key)Returns the tombstone associated to thekeyornullif it doesn't exist.voidonTopologyChange(CacheTopology newTopology)Invoked when a topology change occurs in the cluster.voidremoveTombstone(Object key)Removes the tombstone forkey.voidremoveTombstone(Object key, IracMetadata iracMetadata)Removes the tombstone forkeyif the metadata matches.voidstoreTombstone(Object key, IracMetadata metadata)Stores a tombstone for a key removed.voidstoreTombstoneIfAbsent(Object key, IracMetadata metadata)Same asstoreTombstone(Object, IracMetadata)but it doesn't overwrite an existing tombstone.voidupdateVersion(int segment, IracEntryVersion remoteVersion)Updates the version for thesegmentwith a newremoteVersionseen.
-
-
-
Method Detail
-
generateNewMetadata
IracMetadata generateNewMetadata(int segment)
Generator a newIracMetadatafor a givensegment.The
IracEntryVersioncreated is always higher than the previous one for the samesegment.- Parameters:
segment- The segment.- Returns:
- The
IracMetadatacreated.
-
updateVersion
void updateVersion(int segment, IracEntryVersion remoteVersion)Updates the version for thesegmentwith a newremoteVersionseen.This method should merge both the current version internally stored and the
remoteVersionto achieve anIracEntryVersionhigher than both.- Parameters:
segment- The segment.remoteVersion- The remoteIracEntryVersionreceived.
-
storeTombstone
void storeTombstone(Object key, IracMetadata metadata)
Stores a tombstone for a key removed.It overwrites any existing tombstone.
- Parameters:
key- The key.metadata- TheIracMetadata.
-
storeTombstoneIfAbsent
void storeTombstoneIfAbsent(Object key, IracMetadata metadata)
Same asstoreTombstone(Object, IracMetadata)but it doesn't overwrite an existing tombstone.- Parameters:
key- The key.metadata- TheIracMetadata.
-
getTombstone
IracMetadata getTombstone(Object key)
Returns the tombstone associated to thekeyornullif it doesn't exist.- Parameters:
key- The key.- Returns:
- The tombstone.
-
removeTombstone
void removeTombstone(Object key, IracMetadata iracMetadata)
Removes the tombstone forkeyif the metadata matches.- Parameters:
key- The key.iracMetadata- The expectedIracMetadata.
-
removeTombstone
void removeTombstone(Object key)
Removes the tombstone forkey.- Parameters:
key- The key.
-
onTopologyChange
void onTopologyChange(CacheTopology newTopology)
Invoked when a topology change occurs in the cluster.- Parameters:
newTopology- The newCacheTopology
-
-