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 CSN
s of changes.
-
Method Summary
Modifier and TypeMethodDescriptionasCsn()
Returns this stream as csn.int
boolean
int
hashCode()
static StreamId
Returns a more readable string representation of thisStreamId
.Returns theReplicaId
of the replica which created this stream.long
Returns the timestamp at which this stream has been created.toJson()
Returns a JSON representation of thisStreamId
.toString()
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<StreamId>
-
replicaId
Returns theReplicaId
of the replica which created this stream.- Returns:
- the
ReplicaId
of 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
-