|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.aerospike.client.cluster.Node
public class Node
Server node representation. This class manages server node connections and health status.
Field Summary | |
---|---|
static int |
PARTITIONS
Number of partitions for each namespace. |
Constructor Summary | |
---|---|
Node(com.aerospike.client.cluster.Cluster cluster,
com.aerospike.client.cluster.NodeValidator nv)
Initialize server node with connection parameters. |
Method Summary | |
---|---|
void |
addAlias(Host aliasToAdd)
Add node alias to list. |
void |
close()
Close all server node socket connections. |
void |
decreaseHealth()
Decrease server health status after a connection failure. |
boolean |
equals(Object obj)
|
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. |
boolean |
isUnhealthy()
Has consecutive node connection errors become critical. |
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. |
void |
restoreHealth()
Set node status as healthy after successful database operation. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int PARTITIONS
Constructor Detail |
---|
public Node(com.aerospike.client.cluster.Cluster cluster, com.aerospike.client.cluster.NodeValidator nv)
cluster
- collection of active server nodesnv
- connection parametersMethod Detail |
---|
public final void refresh(List<Host> friends) throws Exception
friends
- other nodes in the cluster, populated by this method
Exception
- if status request failspublic final com.aerospike.client.cluster.Connection getConnection(int timeoutMillis) throws AerospikeException.Connection
timeoutMillis
- connection timeout value in milliseconds if a new connection is created
AerospikeException
- if a connection could not be provided
AerospikeException.Connection
public final void putConnection(com.aerospike.client.cluster.Connection conn)
conn
- socket connectionpublic final void restoreHealth()
public final void decreaseHealth()
public final boolean isUnhealthy()
public final Host getHost()
public final boolean isActive()
public final String getName()
public final Host[] getAliases()
public final void addAlias(Host aliasToAdd)
public final void close()
public final String toString()
toString
in class Object
public final int hashCode()
hashCode
in class Object
public final boolean equals(Object obj)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |