Configuration such as timeout durations.
The unique identifier of this node. This *must* be unique in the cluster which is required as of the Paxos algorithm to work properly and be safe.
The durable journal required to store the state of the node in a stable manner between crashes.
The host application finite state machine invocation.
The host application finite state machine invocation. This method is abstract as the implementation is specific to the host application.
The deliver method is called when a command is committed after having been selected by consensus.
The deliver method is called when a command is committed after having been selected by consensus.
The selected value and a delivery id that can be used to deduplicate deliveries during crash recovery.
The response to the value command that has been delivered. May be an empty array.
The cluster membership finite state machine.
The cluster membership finite state machine. The new membership has been chosen but will come into effect only for the next message for which we generate an accept message.
The consensus algorithm my commit noop values which are filtered out rather than being passed to the client code.
Returns the next timeout put using a testable clock.
The durable journal required to store the state of the node in a stable manner between crashes.
The durable journal required to store the state of the node in a stable manner between crashes.
The unique identifier of this node.
The unique identifier of this node. This *must* be unique in the cluster which is required as of the Paxos algorithm to work properly and be safe.
If you require transactions in the host application then you need to supply a custom Journal which participates in your transactions.
If you require transactions in the host application then you need to supply a custom Journal which participates in your transactions. You also need to override this method to buffer the messages then either send them post commit else delete them post rollback. Paxos is safe to lost messages so it is safe to crash after committing the journal before having sent out the messages. Paxos is *not* safe to "forgotten outcomes" so it is never safe to send messages when you rolled back your custom Journal.
Notifies clients that it is no longer the leader by sending them an exception.
Notifies clients that it is no longer the leader by sending them an exception.
Note that for testing this class does not schedule and manage its own timeouts. Use the subclass which schedules its timeout rather than this baseclass.