See: Description
| Interface | Description |
|---|---|
| Command<T> |
Base interface for operations that modify system state.
|
| Operation<T> |
Base type for Raft state operations.
|
| Query<T> |
Base interface for operations that read system state.
|
| Class | Description |
|---|---|
| NoOpCommand |
Special placeholder command representing a client operation that has no effect on the state machine.
|
| Enum | Description |
|---|---|
| Command.CompactionMode |
Constants for specifying command compaction modes.
|
| Query.ConsistencyLevel |
Constants for specifying Raft
Query consistency levels. |
The interfaces in this package are shared by both clients and servers. They are the interfaces through which clients and servers communicate state change and query information with one another.
Clients operate on Copycat replicated state machines by submitting state change operations to the cluster.
Copycat supports separate operations - Command and Query - for submitting state change
and read-only operations respectively. Each operation maps to a method of a replicated state machine. The handling of operations is dependent
on a variety of factors, including the operation type and the operation's consistency level.
When an operation is submitted to the cluster, the operation will eventually be translated into a method call on the replicated state machine
and a response will be sent back to the client.
Commands are operations that modify the state of the replicated state machine. A command is a serializable
object that will be sent to the leader of the cluster and replicated to a persisted on a majority of the servers in the Copycat cluster before
being applied to the state machine. Once a command is committed (stored on a majority of servers), it's translated into a method call on the
state machine on each server. The return value of the state machine method on the leader is sent back to the client.
Queries are operations that read but do not modify the state of the replicated state machine. Because queries
do not effect the state of the system, servers do not have to replicate them to a majority of the cluster, and no disk I/O is necessary to
complete a query of the state machine's state. Like commands, queries translate to a method call on the replicated state machine, but only
the server to which the query is submitted applies the query to its state machine. Once a query is completed, the return value of the state
machine method called is sent back to the client.Copyright © 2013–2016. All rights reserved.