Skip navigation links

Package io.atomix.copycat

Core interfaces for operating on replicated state machines in the Copycat cluster.

See: Description

Package io.atomix.copycat Description

Core interfaces for operating on replicated state machines in the Copycat cluster.

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

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

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.
Author:
Jordan Halterman
Skip navigation links

Copyright © 2013–2017. All rights reserved.