public class DefaultNodeManager extends Object implements NodeManager, NodeStateListener
NodeManager
used by RiakCluster
if none is
specified.
This NodeManager round-robins through a list of RiakNode
s and attempts
to execute the operation passed to it. If a node reports that it is
health checking it is removed from the list until it sends an update that it
is again running. If the selected node cannot accept the operation because all
connections are in use or it unable to make a new connection, the next node in
the list is tried until either the operation is accepted or all nodes have
been tried. If no nodes are able to accept the operation its setException()
method is called with a NoNodesAvailableException
.Constructor and Description |
---|
DefaultNodeManager() |
Modifier and Type | Method and Description |
---|---|
void |
addNode(RiakNode newNode) |
void |
executeOnNode(FutureOperation operation,
RiakNode previousNode) |
void |
init(List<RiakNode> nodes) |
void |
nodeStateChanged(RiakNode node,
RiakNode.State state) |
boolean |
removeNode(RiakNode node) |
public void init(List<RiakNode> nodes)
init
in interface NodeManager
public void executeOnNode(FutureOperation operation, RiakNode previousNode)
executeOnNode
in interface NodeManager
public void nodeStateChanged(RiakNode node, RiakNode.State state)
nodeStateChanged
in interface NodeStateListener
public void addNode(RiakNode newNode)
addNode
in interface NodeManager
public boolean removeNode(RiakNode node)
removeNode
in interface NodeManager
Copyright © 2014. All rights reserved.