Returns the current cluster size.
Returns the current cluster size.
Returns an ActorSelection mapped to the passed cluster membership index.
Returns an ActorSelection mapped to the passed cluster membership index. This is abstract so that there can be a subclass which knows about cluster membership changes. Counter can be incremented to round-robin to find the new stable leader.
The index of the node in the cluster to resolve.
This counter modulo the cluster size is used to pick a member of the cluster to send leader messages.
This counter modulo the cluster size is used to pick a member of the cluster to send leader messages. If we get back a response that the node isn't the leader the driver will increment the counter to try the next node.
override for tests
Send a message to the cluster
Send a message to the cluster
A counter which is used to pick a node to transmit to.
A request to send.
Driver baseclass logic forwards messages to a trex cluster switching nodes until it finds the leader. The driver coverts the application command value into a byte array ready to journal on the server.
FIXME we retry on timeout yet we don't know if the command happened on a timeout and whether it is safe to retry we should have a map of what client messages types are known safe to retry (e.g. read-only) and only retry those.