public class Node extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
static int |
HAS_BATCH_INDEX |
static int |
HAS_CLUSTER_STABLE |
static int |
HAS_DOUBLE |
static int |
HAS_GEO |
static int |
HAS_PEERS |
static int |
HAS_REPLICAS |
static int |
HAS_REPLICAS_ALL |
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 |
close()
Close all socket connections.
|
void |
closeAsyncConnection(com.aerospike.client.async.AsyncConnection conn,
int index) |
void |
closeAsyncConnections(int index)
Close asynchronous connections.
|
void |
closeConnection(com.aerospike.client.cluster.Connection conn)
Close connection and decrement connection count.
|
void |
closeConnections(AtomicInteger eventLoopCount,
int index)
Close all node socket connections from event loop.
|
void |
closeSyncConnections()
Close synchronous connections.
|
void |
decrAsyncConnection(int index) |
boolean |
equals(Object obj) |
InetSocketAddress |
getAddress()
Return node IP address.
|
com.aerospike.client.async.AsyncConnection |
getAsyncConnection(int index,
ByteBuffer byteBuffer) |
ConnectionStats |
getAsyncConnectionStats() |
com.aerospike.client.cluster.Connection |
getConnection(int timeoutMillis)
Get a socket connection from connection pool to the server node.
|
ConnectionStats |
getConnectionStats() |
Host |
getHost()
Return server node IP address and port.
|
String |
getName()
Return server node name.
|
byte[] |
getSessionToken()
Return node session token.
|
boolean |
hasBatchIndex()
Does server support batch index protocol.
|
boolean |
hasClusterStable()
Does server support cluster-stable info command.
|
boolean |
hasDouble()
Does server support double particle types.
|
int |
hashCode() |
boolean |
hasPeers()
Does server support peers info command.
|
boolean |
hasReplicas()
Does server support replicas info command.
|
boolean |
hasReplicasAll()
Does server support replicas-all info command.
|
boolean |
isActive()
Return whether node is currently active.
|
void |
putAsyncConnection(com.aerospike.client.async.AsyncConnection conn,
int index) |
void |
putConnection(com.aerospike.client.cluster.Connection conn)
Put connection back into connection pool.
|
void |
refresh(com.aerospike.client.cluster.Peers peers)
Request current status from server node.
|
void |
signalLogin() |
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 static final int HAS_GEO
public static final int HAS_DOUBLE
public static final int HAS_BATCH_INDEX
public static final int HAS_REPLICAS_ALL
public static final int HAS_PEERS
public static final int HAS_REPLICAS
public static final int HAS_CLUSTER_STABLE
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(com.aerospike.client.cluster.Peers peers)
public final void signalLogin()
public 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 ConnectionStats getConnectionStats()
public final com.aerospike.client.async.AsyncConnection getAsyncConnection(int index, ByteBuffer byteBuffer)
public final void putAsyncConnection(com.aerospike.client.async.AsyncConnection conn, int index)
public final void closeAsyncConnection(com.aerospike.client.async.AsyncConnection conn, int index)
public final void decrAsyncConnection(int index)
public final ConnectionStats getAsyncConnectionStats()
public final Host getHost()
public final boolean isActive()
public final String getName()
public final InetSocketAddress getAddress()
public final byte[] getSessionToken()
public final boolean useNewBatch(BatchPolicy policy)
public final boolean hasBatchIndex()
public final boolean hasClusterStable()
public final boolean hasDouble()
public final boolean hasReplicas()
public final boolean hasReplicasAll()
public final boolean hasPeers()
public final void close()
close
in interface Closeable
close
in interface AutoCloseable
public final void closeConnections(AtomicInteger eventLoopCount, int index)
public final void closeAsyncConnections(int index)
public final void closeSyncConnections()
Copyright ? 2012–2018 Aerospike, Inc. All rights reserved.