Class CSNGenerator
java.lang.Object
org.opends.server.replication.common.CSNGenerator
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdjust the lastTime of thisCSNGeneratorwith aCSNthat we have received from another server.voidadjust(ServerState state) Adjust utility method that takes ServerState as a parameter.Generate a newCSN.static CSNGeneratornewCSNGenerator(ReplicaId replicaId, long timestamp) Create a newCSNGenerator.static CSNGeneratornewCSNGenerator(ReplicaId replicaId, ServerState state) Create a newCSNGenerator.static CSNGeneratornewCSNGenerator(DomainReplicaId replicaId, long timestamp) Create a newCSNGenerator.
-
Method Details
-
newCSNGenerator
Create a newCSNGenerator.- Parameters:
replicaId- id to use when creatingCSNs.timestamp- time to start with.- Returns:
- the new
CSNGenerator
-
newCSNGenerator
Create a newCSNGenerator.- Parameters:
replicaId- id to use when creatingCSNs.timestamp- time to start with.- Returns:
- the new
CSNGenerator
-
newCSNGenerator
Create a newCSNGenerator.- Parameters:
replicaId- replicaId to use when creatingCSNs.state- This generator will be created in a way that makes sure that allCSNs generated will be larger than all theCSNs currently in state.- Returns:
- the new
CSNGenerator
-
generateCsn
Generate a newCSN.- Returns:
- the generated
CSN
-
adjust
Adjust utility method that takes ServerState as a parameter.- Parameters:
state- the ServerState to adjust with
-
adjust
Adjust the lastTime of thisCSNGeneratorwith aCSNthat we have received from another server.This is necessary because we need that the
CSNgenerated after processing an update received from other hosts to be as close as possible to the receivedCSNin order to have a global ordering that is close to wall-clock time.- Parameters:
csn- theCSNto adjust with
-