public interface Commit<T>
| Modifier and Type | Method and Description |
|---|---|
long |
index()
Returns the commit index.
|
LogicalTimestamp |
logicalTime()
Returns the logical time at which the operation was committed.
|
<U> Commit<U> |
map(Function<T,U> transcoder)
Converts the commit from one type to another.
|
Commit<Void> |
mapToNull()
Converts the commit to a null valued commit.
|
OperationId |
operation()
Returns the operation identifier.
|
Session |
session()
Returns the session that submitted the operation.
|
T |
value()
Returns the operation submitted by the client.
|
WallClockTimestamp |
wallClockTime()
Returns the time at which the operation was committed.
|
long index()
This is the index at which the committed PrimitiveOperation was written in the Raft log.
Raft guarantees that this index will be unique for PrimitiveOperation commits and will be the same for all
instances of the given operation on all servers in the cluster.
For PrimitiveOperation operations, the returned index may actually be representative of the last committed
index in the Raft log since queries are not actually written to disk. Thus, query commits cannot be assumed
to have unique indexes.
Session session()
The returned Session is representative of the session that submitted the operation
that resulted in this Commit. The session can be used to Session.publish(PrimitiveEvent)
event messages to the client.
LogicalTimestamp logicalTime()
WallClockTimestamp wallClockTime()
The time is representative of the time at which the leader wrote the operation to its log. Because instants are replicated through the Raft consensus algorithm, they are guaranteed to be consistent across all servers and therefore can be used to perform time-dependent operations such as expiring keys or timeouts. Additionally, commit times are guaranteed to progress monotonically, never going back in time.
Users should never use System time to control behavior in a state machine and should instead rely
upon Commit times or use the ServiceExecutor for time-based controls.
OperationId operation()
T value()
<U> Commit<U> map(Function<T,U> transcoder)
U - the output commit value typetranscoder - the transcoder with which to transcode the commit valueCopyright © 2013–2018. All rights reserved.