Interface IracVersionGenerator
- All Superinterfaces:
Lifecycle
- All Known Implementing Classes:
DefaultIracVersionGenerator
,NoOpIracVersionGenerator
A version generator for the IRAC protocol.
The version is segment based and the new version is also after than the previous one.
- Since:
- 11.0
- Author:
- Pedro Ruivo
-
Method Summary
Modifier and TypeMethodDescriptiongenerateMetadataWithCurrentVersion
(int segment) Generate a newIracMetadata
for a givensegment
.generateNewMetadata
(int segment) Generates a newIracMetadata
for a givensegment
.generateNewMetadata
(int segment, IracEntryVersion versionSeen) Same asgenerateNewMetadata(int)
but it makes sure the new version is higher thanversionSeen
.void
onTopologyChange
(CacheTopology newTopology) Invoked when a topology change occurs in the cluster.void
updateVersion
(int segment, IracEntryVersion remoteVersion) Updates the version for thesegment
with a newremoteVersion
seen.
-
Method Details
-
generateNewMetadata
Generates a newIracMetadata
for a givensegment
.The
IracEntryVersion
created is always higher than the previous one for the samesegment
.- Parameters:
segment
- The segment.- Returns:
- The
IracMetadata
created.
-
generateMetadataWithCurrentVersion
Generate a newIracMetadata
for a givensegment
.The
IracEntryVersion
created will be the same as the previous one for the samesegment
. If there was no version prior then it will create an initial version.- Parameters:
segment
- The segment.- Returns:
- The
IracMetadata
created.
-
generateNewMetadata
Same asgenerateNewMetadata(int)
but it makes sure the new version is higher thanversionSeen
.- Parameters:
segment
- The segment.versionSeen
- TheIracEntryVersion
seen before. Can benull
.- Returns:
- The
IracMetadata
created.
-
updateVersion
Updates the version for thesegment
with a newremoteVersion
seen.This method should merge both the current version internally stored and the
remoteVersion
to achieve anIracEntryVersion
higher than both.- Parameters:
segment
- The segment.remoteVersion
- The remoteIracEntryVersion
received.
-
onTopologyChange
Invoked when a topology change occurs in the cluster.- Parameters:
newTopology
- The newCacheTopology
-