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 voidadjust(CSN csn)Adjust the lastTime of thisCSNGeneratorwith aCSNthat we have received from another server.voidadjust(ServerState state)Adjust utility method that takes ServerState as a parameter.CSNnewCSN()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 Detail
-
newCSNGenerator
public static CSNGenerator newCSNGenerator(DomainReplicaId replicaId, long timestamp)
Create a newCSNGenerator.- Parameters:
replicaId- id to use when creatingCSNs.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 creatingCSNs.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 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
-
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 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
-
-