@InterfaceStability.Uncommitted @InterfaceAudience.Public public class NodeLocatorHelper extends Object
Helper class to provide direct access on how document IDs are mapped onto nodes.
Modifier and Type | Method and Description |
---|---|
InetAddress |
activeNodeForId(String id)
Returns the target active node
InetAddress for a given document ID on the bucket. |
static NodeLocatorHelper |
create(Bucket bucket)
Creates a new
NodeLocatorHelper , mapped on to the given Bucket . |
List<InetAddress> |
nodes()
Returns all nodes known in the current config.
|
InetAddress |
replicaNodeForId(String id,
int replicaNum)
Returns the target replica node
InetAddress for a given document ID and replica number on the bucket. |
List<InetAddress> |
replicaNodesForId(String id)
Returns all target replica nodes
InetAddress for a given document ID on the bucket. |
public static NodeLocatorHelper create(Bucket bucket)
Creates a new NodeLocatorHelper
, mapped on to the given Bucket
.
bucket
- the scoped bucket.public InetAddress activeNodeForId(String id)
Returns the target active node InetAddress
for a given document ID on the bucket.
id
- the document id to convert.public List<InetAddress> replicaNodesForId(String id)
Returns all target replica nodes InetAddress
for a given document ID on the bucket.
id
- the document id to convert.public InetAddress replicaNodeForId(String id, int replicaNum)
Returns the target replica node InetAddress
for a given document ID and replica number on the bucket.
id
- the document id to convert.replicaNum
- the replica number.public List<InetAddress> nodes()
Returns all nodes known in the current config.
Copyright © 2014 Couchbase, Inc.