Class StreamId
java.lang.Object
org.forgerock.opendj.server.leaderbasedreplication.StreamId
- All Implemented Interfaces:
Comparable<StreamId>
Uniquely identifies a replication stream.
A replication stream is a sequence of changes that have been produced by a replica during its lifetime. Each time a replica is started, a new replication stream is created. This is allowing a single replica to apply simultaneously changes coming from client as well as its own previously produced changes coming from other replicas during a recovery from backup.
A StreamId is referencing the ReplicaId which created it as well as the timestamp at which it has
been created.
A StreamId can be encoded/decoded to/from a ReplicaId, allowing StreamId to be embedded
into the CSNs of changes.
-
Method Summary
Modifier and TypeMethodDescriptionasCsn()Returns this stream as csn.intbooleaninthashCode()static StreamIdReturns a more readable string representation of thisStreamId.Returns theReplicaIdof the replica which created this stream.longReturns the timestamp at which this stream has been created.toJson()Returns a JSON representation of thisStreamId.toString()
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<StreamId>
-
replicaId
Returns theReplicaIdof the replica which created this stream.- Returns:
- the
ReplicaIdof the replica which created this stream
-
streamTimeStamp
public long streamTimeStamp()Returns the timestamp at which this stream has been created.- Returns:
- the timestamp at which this stream has been created
-
of
- Parameters:
csn- the csn- Returns:
- the new
StreamId
-
asCsn
Returns this stream as csn.- Returns:
- this stream as csn
-
toString
-
equals
-
hashCode
public int hashCode() -
toJson
Returns a JSON representation of thisStreamId.- Returns:
- the JSON representation
-
prettyPrint
Returns a more readable string representation of thisStreamId.- Returns:
- a more readable string representation of this
StreamId
-