public class CommandRequest extends OperationRequest
Command requests are submitted by clients to the Raft cluster to commit commands to
the replicated state machine. Each command request must be associated with a registered
SessionRequest.session() and have a unique OperationRequest.sequenceNumber() number within that session. Commands will
be applied in the cluster in the order defined by the provided sequence number. Thus, sequence numbers
should never be skipped. In the event of a failure of a command request, the request should be resent
with the same sequence number. Commands are guaranteed to be applied in sequence order.
Command requests should always be submitted to the server to which the client is connected and will be forwarded to the current cluster leader. In the event that no leader is available, the request will fail and should be resubmitted by the client.
| Modifier and Type | Class and Description |
|---|---|
static class |
CommandRequest.Builder
Command request builder.
|
| Constructor and Description |
|---|
CommandRequest(long session,
long sequence,
RaftOperation operation) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object object) |
int |
hashCode() |
static CommandRequest.Builder |
newBuilder()
Returns a new submit request builder.
|
String |
toString() |
operation, sequenceNumbersessionpublic CommandRequest(long session,
long sequence,
RaftOperation operation)
public static CommandRequest.Builder newBuilder()
public int hashCode()
hashCode in class SessionRequestpublic boolean equals(Object object)
equals in class SessionRequestpublic String toString()
toString in class SessionRequestCopyright © 2013–2017. All rights reserved.