Package com.couchbase.client.java.util
Class NodeLocatorHelper
java.lang.Object
com.couchbase.client.java.util.NodeLocatorHelper
@Uncommitted @Public public class NodeLocatorHelper extends Object
Helper class to provide direct access on how document IDs are mapped onto nodes.
- Since:
- 2.1.0
- Author:
- Michael Nitschinger
-
Method Summary
Modifier and Type Method Description InetAddressactiveNodeForId(String id)Returns the target active nodeInetAddressfor a given document ID on the bucket.static NodeLocatorHelpercreate(Bucket bucket)Creates a newNodeLocatorHelper, mapped on to the givenBucket.List<InetAddress>nodes()Returns all nodes known in the current config.InetAddressreplicaNodeForId(String id, int replicaNum)Returns the target replica nodeInetAddressfor a given document ID and replica number on the bucket.List<InetAddress>replicaNodesForId(String id)Returns all target replica nodesInetAddressfor a given document ID on the bucket.
-
Method Details
-
create
Creates a newNodeLocatorHelper, mapped on to the givenBucket.- Parameters:
bucket- the scoped bucket.- Returns:
- the created locator.
-
activeNodeForId
Returns the target active nodeInetAddressfor a given document ID on the bucket.- Parameters:
id- the document id to convert.- Returns:
- the node for the given document id.
-
replicaNodesForId
Returns all target replica nodesInetAddressfor a given document ID on the bucket.- Parameters:
id- the document id to convert.- Returns:
- the node for the given document id.
-
replicaNodeForId
Returns the target replica nodeInetAddressfor a given document ID and replica number on the bucket.- Parameters:
id- the document id to convert.replicaNum- the replica number.- Returns:
- the node for the given document id.
-
nodes
Returns all nodes known in the current config.- Returns:
- all currently known nodes.
-