public class Node extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
static int |
PARTITIONS
Number of partitions for each namespace.
|
Constructor and Description |
---|
Node(com.aerospike.client.cluster.Cluster cluster,
com.aerospike.client.cluster.NodeValidator nv)
Initialize server node with connection parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addAlias(Host aliasToAdd)
Add node alias to list.
|
void |
close()
Close all server node socket connections.
|
boolean |
equals(Object obj) |
InetSocketAddress |
getAddress() |
Host[] |
getAliases()
Return server node IP address aliases.
|
com.aerospike.client.cluster.Connection |
getConnection(int timeoutMillis)
Get a socket connection from connection pool to the server node.
|
Host |
getHost()
Return server node IP address and port.
|
String |
getName()
Return server node name.
|
int |
hashCode() |
boolean |
isActive()
Return whether node is currently active.
|
void |
putConnection(com.aerospike.client.cluster.Connection conn)
Put connection back into connection pool.
|
void |
refresh(List<Host> friends)
Request current status from server node.
|
String |
toString() |
public static final int PARTITIONS
public Node(com.aerospike.client.cluster.Cluster cluster, com.aerospike.client.cluster.NodeValidator nv)
cluster
- collection of active server nodesnv
- connection parameterspublic final void refresh(List<Host> friends) throws Exception
friends
- other nodes in the cluster, populated by this methodException
- if status request failspublic final com.aerospike.client.cluster.Connection getConnection(int timeoutMillis) throws AerospikeException
timeoutMillis
- connection timeout value in milliseconds if a new connection is createdAerospikeException
- if a connection could not be providedpublic final void putConnection(com.aerospike.client.cluster.Connection conn)
conn
- socket connectionpublic final Host getHost()
public final boolean isActive()
public final String getName()
public final Host[] getAliases()
public final void addAlias(Host aliasToAdd)
public InetSocketAddress getAddress()
public final void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2012–2014 Aerospike, Inc. All rights reserved.