public class Node extends Object implements Closeable
| Modifier and Type | Class and Description |
|---|---|
static class |
Node.AsyncPool |
| Modifier and Type | Field and Description |
|---|---|
static int |
HAS_BATCH_ANY |
static int |
HAS_PARTITION_QUERY |
static int |
HAS_PARTITION_SCAN |
static int |
HAS_QUERY_SHOW |
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 |
addBytesIn(String namespace,
long count)
Add to the count of bytes received from the node.
|
void |
addBytesOut(String namespace,
long count)
Add to the count of bytes sent to the node.
|
void |
addError(String namespace)
Increment transaction error count.
|
void |
addKeyBusy(String namespace)
Increment the key busy counter.
|
void |
addLatency(String namespace,
LatencyType type,
long elapsed)
Add elapsed time in nanoseconds to latency buckets corresponding to latency type.
|
void |
addTimeout(String namespace)
Increment transaction timeout count.
|
boolean |
areMetricsEnabled()
Return metrics enablement status
|
void |
balanceAsyncConnections(EventLoop eventLoop) |
void |
close()
Close all socket connections.
|
void |
closeAsyncConnection(com.aerospike.client.async.AsyncConnection conn,
int index)
Close async connection on error.
|
void |
closeAsyncConnections(int index)
Close asynchronous connections.
|
void |
closeAsyncIdleConnection(com.aerospike.client.async.AsyncConnection conn,
int index)
Close async connection without incrementing error count.
|
void |
closeConnection(com.aerospike.client.cluster.Connection conn)
Close pooled connection on error and decrement connection count.
|
void |
closeConnectionOnError(com.aerospike.client.cluster.Connection conn)
Close any connection on error.
|
void |
closeConnections(AtomicInteger eventLoopCount,
int index)
Close all node socket connections from event loop.
|
void |
closeIdleConnection(com.aerospike.client.cluster.Connection conn)
Close connection without incrementing error count.
|
void |
closeSyncConnections()
Close synchronous connections.
|
void |
connectionOpened(int index) |
void |
createMinConnections() |
void |
decrAsyncConnection(int index) |
void |
enableMetrics(MetricsPolicy policy) |
boolean |
equals(Object obj) |
boolean |
errorRateWithinLimit() |
InetSocketAddress |
getAddress()
Return node IP address.
|
com.aerospike.client.async.AsyncConnection |
getAsyncConnection(int index,
ByteBuffer byteBuffer) |
ConnectionStats |
getAsyncConnectionStats() |
Node.AsyncPool |
getAsyncPool(int index) |
long |
getBytesInByNS(String namespace)
Return count of bytes in by namespace.
|
long |
getBytesOutByNS(String namespace)
Return count of bytes out by namespace.
|
com.aerospike.client.cluster.Connection |
getConnection(int timeoutMillis)
Get a socket connection from connection pool to the server node.
|
com.aerospike.client.cluster.Connection |
getConnection(int connectTimeout,
int socketTimeout)
Get a socket connection from connection pool to the server node.
|
com.aerospike.client.cluster.Connection |
getConnection(com.aerospike.client.command.SyncCommand cmd,
int connectTimeout,
int socketTimeout,
int timeoutDelay)
Get a socket connection from connection pool to the server node.
|
ConnectionStats |
getConnectionStats() |
long |
getErrorCount()
Return error count.
|
long |
getErrorCountByNS(String namespace)
Return error count by namespace.
|
Host |
getHost()
Return server node IP address and port.
|
long |
getKeyBusyCount()
Return key busy count.
|
long |
getKeyBusyCountByNS(String namespace)
Return key busy count for a given namespace.
|
NodeMetrics |
getMetrics() |
String |
getName()
Return server node name.
|
int |
getPartitionGeneration()
Return current generation of partition maps.
|
int |
getPeersGeneration()
Return current generation of cluster peers.
|
int |
getRebalanceGeneration()
Return current generation of racks.
|
byte[] |
getSessionToken()
Return node session token.
|
long |
getTimeoutCount()
Return timeout count.
|
long |
getTimeoutCountbyNS(String namespace)
Return timeout count.
|
com.aerospike.client.util.Version |
getVersion()
Return this node's build version
|
boolean |
hasBatchAny() |
int |
hashCode() |
boolean |
hasPartitionQuery() |
boolean |
hasQueryShow() |
boolean |
hasRack(String namespace,
int rackId)
Return if this node has the same rack as the client for the
given namespace.
|
void |
incrErrorRate() |
boolean |
isActive()
Return whether node is currently active.
|
boolean |
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.
|
boolean |
reserveAsyncConnectionSlot(int index) |
void |
resetErrorRate() |
void |
signalLogin() |
String |
toString()
Does server support partition scans.
|
void |
validateErrorCount() |
public static final int PARTITIONS
public static final int HAS_PARTITION_SCAN
public static final int HAS_QUERY_SHOW
public static final int HAS_BATCH_ANY
public static final int HAS_PARTITION_QUERY
public Node(com.aerospike.client.cluster.Cluster cluster,
com.aerospike.client.cluster.NodeValidator nv)
cluster - collection of active server nodesnv - connection parameterspublic final void createMinConnections()
public final void refresh(com.aerospike.client.cluster.Peers peers)
public final void signalLogin()
public final com.aerospike.client.cluster.Connection getConnection(int timeoutMillis)
public final com.aerospike.client.cluster.Connection getConnection(int connectTimeout,
int socketTimeout)
public final com.aerospike.client.cluster.Connection getConnection(com.aerospike.client.command.SyncCommand cmd,
int connectTimeout,
int socketTimeout,
int timeoutDelay)
public final void putConnection(com.aerospike.client.cluster.Connection conn)
conn - socket connectionpublic final void closeConnection(com.aerospike.client.cluster.Connection conn)
public final void closeConnectionOnError(com.aerospike.client.cluster.Connection conn)
public final void closeIdleConnection(com.aerospike.client.cluster.Connection conn)
public final ConnectionStats getConnectionStats()
public final com.aerospike.client.async.AsyncConnection getAsyncConnection(int index,
ByteBuffer byteBuffer)
public final boolean reserveAsyncConnectionSlot(int index)
public final void connectionOpened(int index)
public final boolean putAsyncConnection(com.aerospike.client.async.AsyncConnection conn,
int index)
public final void closeAsyncConnection(com.aerospike.client.async.AsyncConnection conn,
int index)
public final void closeAsyncIdleConnection(com.aerospike.client.async.AsyncConnection conn,
int index)
public final void decrAsyncConnection(int index)
public final Node.AsyncPool getAsyncPool(int index)
public final void balanceAsyncConnections(EventLoop eventLoop)
public final ConnectionStats getAsyncConnectionStats()
public final void enableMetrics(MetricsPolicy policy)
public final NodeMetrics getMetrics()
public final void addLatency(String namespace, LatencyType type, long elapsed)
public final void incrErrorRate()
public final void resetErrorRate()
public final boolean errorRateWithinLimit()
public final void validateErrorCount()
public void addError(String namespace)
public void addTimeout(String namespace)
public void addKeyBusy(String namespace)
public void addBytesOut(String namespace, long count)
public void addBytesIn(String namespace, long count)
public long getErrorCount()
public long getErrorCountByNS(String namespace)
public long getTimeoutCount()
public long getTimeoutCountbyNS(String namespace)
public long getKeyBusyCount()
public long getKeyBusyCountByNS(String namespace)
public long getBytesInByNS(String namespace)
public long getBytesOutByNS(String namespace)
public final Host getHost()
public final boolean isActive()
public final String getName()
public final InetSocketAddress getAddress()
public final byte[] getSessionToken()
public final int getPeersGeneration()
public final int getPartitionGeneration()
public final int getRebalanceGeneration()
public com.aerospike.client.util.Version getVersion()
public boolean areMetricsEnabled()
public final boolean hasRack(String namespace, int rackId)
public final boolean hasQueryShow()
public final boolean hasBatchAny()
public final boolean hasPartitionQuery()
public final String toString()
public final void close()
close in interface Closeableclose in interface AutoCloseablepublic final void closeConnections(AtomicInteger eventLoopCount, int index)
public final void closeAsyncConnections(int index)
public final void closeSyncConnections()
Copyright © 2012–2025 Aerospike, Inc. All rights reserved.