public interface IracVersionGenerator extends Lifecycle
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.
Modifier and Type | Method and Description |
---|---|
IracMetadata |
generateNewMetadata(int segment)
Generator a new
IracMetadata for a given segment . |
IracMetadata |
getTombstone(Object key)
Returns the tombstone associated to the
key or null if it doesn't exist. |
void |
onTopologyChange(CacheTopology newTopology)
Invoked when a topology change occurs in the cluster.
|
void |
removeTombstone(Object key)
Removes the tombstone for
key . |
void |
removeTombstone(Object key,
IracMetadata iracMetadata)
Removes the tombstone for
key if the metadata matches. |
void |
storeTombstone(Object key,
IracMetadata metadata)
Stores a tombstone for a key removed.
|
void |
storeTombstoneIfAbsent(Object key,
IracMetadata metadata)
Same as
storeTombstone(Object, IracMetadata) but it doesn't overwrite an existing tombstone. |
void |
updateVersion(int segment,
IracEntryVersion remoteVersion)
Updates the version for the
segment with a new remoteVersion seen. |
IracMetadata generateNewMetadata(int segment)
IracMetadata
for a given segment
.
The IracEntryVersion
created is always higher than the previous one for the same segment
.
segment
- The segment.IracMetadata
created.void updateVersion(int segment, IracEntryVersion remoteVersion)
segment
with a new remoteVersion
seen.
This method should merge both the current version internally stored and the remoteVersion
to achieve an
IracEntryVersion
higher than both.
segment
- The segment.remoteVersion
- The remote IracEntryVersion
received.void storeTombstone(Object key, IracMetadata metadata)
It overwrites any existing tombstone.
key
- The key.metadata
- The IracMetadata
.void storeTombstoneIfAbsent(Object key, IracMetadata metadata)
storeTombstone(Object, IracMetadata)
but it doesn't overwrite an existing tombstone.key
- The key.metadata
- The IracMetadata
.IracMetadata getTombstone(Object key)
key
or null
if it doesn't exist.key
- The key.void removeTombstone(Object key, IracMetadata iracMetadata)
key
if the metadata matches.key
- The key.iracMetadata
- The expected IracMetadata
.void removeTombstone(Object key)
key
.key
- The key.void onTopologyChange(CacheTopology newTopology)
newTopology
- The new CacheTopology
Copyright © 2021 JBoss by Red Hat. All rights reserved.