Class NoOpIracVersionGenerator
java.lang.Object
org.infinispan.container.versioning.irac.NoOpIracVersionGenerator
- All Implemented Interfaces:
Lifecycle
,IracVersionGenerator
A no-op implementation of
IracVersionGenerator
for caches without asynchronous remote site backups.- 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 asIracVersionGenerator.generateNewMetadata(int)
but it makes sure the new version is higher thanversionSeen
.static NoOpIracVersionGenerator
void
onTopologyChange
(CacheTopology newTopology) Invoked when a topology change occurs in the cluster.void
start()
Invoked on component startvoid
stop()
Invoked on component stopvoid
updateVersion
(int segment, IracEntryVersion remoteVersion) Updates the version for thesegment
with a newremoteVersion
seen.
-
Method Details
-
getInstance
-
generateNewMetadata
Description copied from interface:IracVersionGenerator
Generates a newIracMetadata
for a givensegment
.The
IracEntryVersion
created is always higher than the previous one for the samesegment
.- Specified by:
generateNewMetadata
in interfaceIracVersionGenerator
- Parameters:
segment
- The segment.- Returns:
- The
IracMetadata
created.
-
generateMetadataWithCurrentVersion
Description copied from interface:IracVersionGenerator
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.- Specified by:
generateMetadataWithCurrentVersion
in interfaceIracVersionGenerator
- Parameters:
segment
- The segment.- Returns:
- The
IracMetadata
created.
-
generateNewMetadata
Description copied from interface:IracVersionGenerator
Same asIracVersionGenerator.generateNewMetadata(int)
but it makes sure the new version is higher thanversionSeen
.- Specified by:
generateNewMetadata
in interfaceIracVersionGenerator
- Parameters:
segment
- The segment.versionSeen
- TheIracEntryVersion
seen before. Can benull
.- Returns:
- The
IracMetadata
created.
-
updateVersion
Description copied from interface:IracVersionGenerator
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.- Specified by:
updateVersion
in interfaceIracVersionGenerator
- Parameters:
segment
- The segment.remoteVersion
- The remoteIracEntryVersion
received.
-
onTopologyChange
Description copied from interface:IracVersionGenerator
Invoked when a topology change occurs in the cluster.- Specified by:
onTopologyChange
in interfaceIracVersionGenerator
- Parameters:
newTopology
- The newCacheTopology
-
start
public void start()Description copied from interface:Lifecycle
Invoked on component start -
stop
public void stop()Description copied from interface:Lifecycle
Invoked on component stop
-