public class DefaultNodeManager extends Object implements NodeManager, NodeStateListener
NodeManager used by RiakCluster if none is
specified.
This NodeManager round-robins through a list of RiakNodes 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) |
boolean |
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 NodeManagerpublic boolean executeOnNode(FutureOperation operation, RiakNode previousNode)
executeOnNode in interface NodeManagerpublic void nodeStateChanged(RiakNode node, RiakNode.State state)
nodeStateChanged in interface NodeStateListenerpublic void addNode(RiakNode newNode)
addNode in interface NodeManagerpublic boolean removeNode(RiakNode node)
removeNode in interface NodeManagerCopyright © 2016. All rights reserved.