Class CSNGenerator
- java.lang.Object
-
- org.opends.server.replication.common.CSNGenerator
-
public final class CSNGenerator extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
adjust(CSN csn)
Adjust the lastTime of thisCSNGenerator
with aCSN
that we have received from another server.void
adjust(ServerState state)
Adjust utility method that takes ServerState as a parameter.CSN
newCSN()
Generate a newCSN
.static CSNGenerator
newCSNGenerator(ReplicaId replicaId, long timestamp)
Create a newCSNGenerator
.static CSNGenerator
newCSNGenerator(ReplicaId replicaId, ServerState state)
Create a newCSNGenerator
.static CSNGenerator
newCSNGenerator(DomainReplicaId replicaId, long timestamp)
Create a newCSNGenerator
.
-
-
-
Method Detail
-
newCSNGenerator
public static CSNGenerator newCSNGenerator(DomainReplicaId replicaId, long timestamp)
Create a newCSNGenerator
.- Parameters:
replicaId
- id to use when creatingCSN
s.timestamp
- time to start with.- Returns:
- the new
CSNGenerator
-
newCSNGenerator
public static CSNGenerator newCSNGenerator(ReplicaId replicaId, long timestamp)
Create a newCSNGenerator
.- Parameters:
replicaId
- id to use when creatingCSN
s.timestamp
- time to start with.- Returns:
- the new
CSNGenerator
-
newCSNGenerator
public static CSNGenerator newCSNGenerator(ReplicaId replicaId, ServerState state)
Create a newCSNGenerator
.- Parameters:
replicaId
- replicaId to use when creatingCSN
s.state
- This generator will be created in a way that makes sure that allCSN
s generated will be larger than all theCSN
s currently in state.- Returns:
- the new
CSNGenerator
-
adjust
public void adjust(ServerState state)
Adjust utility method that takes ServerState as a parameter.- Parameters:
state
- the ServerState to adjust with
-
adjust
public void adjust(CSN csn)
Adjust the lastTime of thisCSNGenerator
with aCSN
that we have received from another server.This is necessary because we need that the
CSN
generated after processing an update received from other hosts to be as close as possible to the receivedCSN
in order to have a global ordering that is close to wall-clock time.- Parameters:
csn
- theCSN
to adjust with
-
-