Class NumericVersionGenerator
java.lang.Object
org.infinispan.container.versioning.NumericVersionGenerator
- All Implemented Interfaces:
VersionGenerator
Generates unique numeric versions for both local and clustered environments.
When used on clustered caches, node information is used to guarantee versions
are unique cluster-wide.
If the cache is configured to be local, the version generated is based
around an atomic counter. On the contrary, if the cache is clustered, the
generated version is composed of:
[view id (2 bytes)][rank (2 bytes)][version counter (4 bytes)], where rank
refers to the position of this node within the view.
- Since:
- 5.3
- Author:
- Galder ZamarreƱo
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGenerates a new entry versionincrement
(IncrementableEntryVersion initialVersion) void
start()
-
Constructor Details
-
NumericVersionGenerator
public NumericVersionGenerator()
-
-
Method Details
-
start
public void start() -
generateNew
Description copied from interface:VersionGenerator
Generates a new entry version- Specified by:
generateNew
in interfaceVersionGenerator
- Returns:
- a new entry version
-
increment
- Specified by:
increment
in interfaceVersionGenerator
-
nonExistingVersion
- Specified by:
nonExistingVersion
in interfaceVersionGenerator
-