public class Node extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
boolean |
hasBatchIndex |
boolean |
hasDouble |
boolean |
hasGeo |
boolean |
hasReplicasAll |
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.
|
void |
closeConnection(com.aerospike.client.cluster.Connection conn)
Close connection and decrement connection count.
|
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() |
boolean |
useNewBatch(BatchPolicy policy)
Use new batch protocol if server supports it and useBatchDirect is not set.
|
public static final int PARTITIONS
public final boolean hasGeo
public final boolean hasDouble
public final boolean hasBatchIndex
public final boolean hasReplicasAll
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 void closeConnection(com.aerospike.client.cluster.Connection conn)
public 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 boolean useNewBatch(BatchPolicy policy)
public final void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2012–2016 Aerospike, Inc. All rights reserved.