Aerospike.ClientClientPolicy
Aerospike.ClientAsyncClientPolicy
Namespace: Aerospike.Client
Assembly: AerospikeClient (in AerospikeClient.dll) Version: 5.1.1.0 (5.1.1)
public sealed class AsyncClientPolicy : ClientPolicy
The AsyncClientPolicy type exposes the following members.
Name | Description | |
---|---|---|
![]() | AsyncClientPolicy |
Default constructor.
|
![]() | AsyncClientPolicy(AsyncClientPolicy) |
Copy async client policy from another async client policy.
|
Name | Description | |
---|---|---|
![]() | asyncBufferSize |
Size of buffer allocated for each async command. The size should be a multiple of 8 KB.
If not, the size is rounded up to the nearest 8 KB increment.
If an async command requires a buffer size less than or equal to asyncBufferSize, the buffer pool will be used. If an async command requires a buffer size greater than asyncBufferSize, a new single-use buffer will be created on the heap. This field is also used to size the buffer pool for all async commands: buffer pool size = asyncBufferSize * asyncMaxCommands Default: 128 * 1024 (128 KB) |
![]() | asyncMaxCommandAction |
How to handle cases when the asynchronous maximum number of concurrent connections
have been reached.
|
![]() | asyncMaxCommands |
Maximum number of concurrent asynchronous commands that are active at any point in time.
Concurrent commands can be used to estimate concurrent connections.
The number of concurrent open connections is limited by:
max open connections = asyncMaxCommands * <number of nodes in cluster> The actual number of open connections consumed depends on how balanced the commands are between nodes.The maximum open connections should not exceed the total socket file descriptors available on the client machine. The socket file descriptors available can be determined by the following command: ulimit -n |
![]() | asyncMaxCommandsInQueue |
Maximum number of async commands that can be stored in the delay queue when
asyncMaxCommandAction is DELAY
and asyncMaxCommands is reached.
Queued commands consume memory, but they do not consume connections.
If this limit is reached, the next async command will be rejected with exception AerospikeExceptionCommandRejected. If this limit is zero, all async commands will be accepted into the delay queue. The optimal value will depend on your application's magnitude of command bursts and the amount of memory available to store commands. Default: 0 (no delay queue limit) |
![]() | asyncMaxConnsPerNode |
Maximum number of asynchronous connections allowed per server node. Transactions will go
through retry logic and potentially fail with "ResultCode.NO_MORE_CONNECTIONS" if the maximum
number of connections would be exceeded.
The number of connections used per node depends on concurrent commands in progress plus sub-commands used for parallel multi-node commands (batch, scan, and query). One connection will be used for each command. If the value is -1, the value will be set to maxConnsPerNode. Default: -1 (Use maxConnsPerNode) |
![]() | asyncMinConnsPerNode |
Minimum number of asynchronous connections allowed per server node. Preallocate min connections
on client node creation. The client will periodically allocate new connections if count falls
below min connections.
Server proto-fd-idle-ms and client maxSocketIdle should be set to zero (no reap) if asyncMinConnsPerNode is greater than zero. Reaping connections can defeat the purpose of keeping connections in reserve for a future burst of activity. Default: 0 |
![]() | authMode |
Authentication mode.
(Inherited from ClientPolicy.)Default: AuthMode.INTERNAL |
![]() | batchDeletePolicyDefault |
Default delete policy used in batch delete commands.
(Inherited from ClientPolicy.) |
![]() | batchParentPolicyWriteDefault |
Default parent policy used in batch write commands. Parent policy fields
include socketTimeout, totalTimeout, maxRetries, etc...
(Inherited from ClientPolicy.) |
![]() | batchPolicyDefault |
Default parent policy used in batch read commands. Parent policy fields
include socketTimeout, totalTimeout, maxRetries, etc...
(Inherited from ClientPolicy.) |
![]() | batchUDFPolicyDefault |
Default user defined function policy used in batch UDF excecute commands.
(Inherited from ClientPolicy.) |
![]() | batchWritePolicyDefault |
Default write policy used in batch operate commands.
Write policy fields include generation, expiration, durableDelete, etc...
(Inherited from ClientPolicy.) |
![]() | clusterName |
Expected cluster name. If populated, server nodes must return this cluster name in order to
join the client's view of the cluster. Should only be set when connecting to servers that
support the "cluster-name" info command.
(Inherited from ClientPolicy.)Default: null |
![]() | connPoolsPerNode |
Number of synchronous connection pools used for each node. Machines with 8 cpu cores or
less usually need just one connection pool per node. Machines with a large number of cpu
cores may have their synchronous performance limited by contention for pooled connections.
Contention for pooled connections can be reduced by creating multiple mini connection pools
per node.
(Inherited from ClientPolicy.)Default: 1 |
![]() | errorRateWindow |
The number of cluster tend iterations that defines the window for maxErrorRate.
One tend iteration is defined as tendInterval plus the time to tend all nodes.
At the end of the window, the error count is reset to zero and backoff state is removed
on all nodes.
(Inherited from ClientPolicy.)Default: 1 |
![]() | failIfNotConnected |
Should cluster instantiation fail if the client fails to connect to a seed or
all the seed's peers.
(Inherited from ClientPolicy.)If true, throw an exception if all seed connections fail or a seed is valid, but all peers from that seed are not reachable. If false, a partial cluster will be created and the client will automatically connect to the remaining nodes when they become available. Default: true |
![]() | infoPolicyDefault |
Default info policy that is used when info command's policy is null.
(Inherited from ClientPolicy.) |
![]() | ipMap |
A IP translation table is used in cases where different clients use different server
IP addresses. This may be necessary when using clients from both inside and outside
a local area network. Default is no translation.
(Inherited from ClientPolicy.)The key is the IP address returned from friend info requests to other servers. The value is the real IP address used to connect to the server. Default: null (no IP address translation) |
![]() | loginTimeout |
Login timeout in milliseconds. The timeout used when user authentication is enabled and
a node login is being performed.
(Inherited from ClientPolicy.)Default: 5000 |
![]() | maxConnsPerNode |
Maximum number of synchronous connections allowed per server node. Transactions will go
through retry logic and potentially fail with "ResultCode.NO_MORE_CONNECTIONS" if the maximum
number of connections would be exceeded.
(Inherited from ClientPolicy.)The number of connections used per node depends on how many concurrent threads issue database commands plus sub-threads used for parallel multi-node commands (batch, scan, and query). One connection will be used for each thread. This field is ignored by asynchronous transactions since these transactions are already bound by asyncMaxCommands by default. Each async command has a one-to-one relationship with connections. Default: 300 |
![]() | maxErrorRate |
Maximum number of errors allowed per node per errorRateWindow before backoff
algorithm throws AerospikeExceptionBackoff on database
commands to that node. If maxErrorRate is zero, there is no error limit and
the exception will not be thrown.
(Inherited from ClientPolicy.)The counted error types are any error that causes the connection to close (socket errors and client timeouts) and DEVICE_OVERLOAD. Default: 0 |
![]() | maxSocketIdle |
Maximum socket idle in seconds. Socket connection pools will discard sockets
that have been idle longer than the maximum.
(Inherited from ClientPolicy.)Connection pools are now implemented by a LIFO stack. Connections at the tail of the stack will always be the least used. These connections are checked for maxSocketIdle once every 30 tend iterations (usually 30 seconds). If server's proto-fd-idle-ms is greater than zero, then maxSocketIdle should be at least a few seconds less than the server's proto-fd-idle-ms, so the client does not attempt to use a socket that has already been reaped by the server. If server's proto-fd-idle-ms is zero (no reap), then maxSocketIdle should also be zero. Connections retrieved from a pool in transactions will not be checked for maxSocketIdle when maxSocketIdle is zero. Idle connections will still be trimmed down from peak connections to min connections (minConnsPerNode and asyncMinConnsPerNode) using a hard-coded 55 second limit in the cluster tend thread. Default: 55 |
![]() | minConnsPerNode |
Minimum number of synchronous connections allowed per server node. Preallocate min connections
on client node creation. The client will periodically allocate new connections if count falls
below min connections.
(Inherited from ClientPolicy.)Server proto-fd-idle-ms and client maxSocketIdle should be set to zero (no reap) if minConnsPerNode is greater than zero. Reaping connections can defeat the purpose of keeping connections in reserve for a future burst of activity. Default: 0 |
![]() | password |
Password authentication to cluster. The password will be stored by the client and sent to server
in hashed format. Leave null for clusters running without restricted access.
(Inherited from ClientPolicy.)Default: null |
![]() | queryPolicyDefault |
Default query policy that is used when query command's policy is null.
(Inherited from ClientPolicy.) |
![]() | rackAware |
Track server rack data. This field is useful when directing read commands to the server node
that contains the key and exists on the same rack as the client. This serves to lower cloud
provider costs when nodes are distributed across different racks/data centers.
(Inherited from ClientPolicy.)rackId or rackIds, PREFER_RACK and server rack configuration must also be set to enable this functionality. Default: false |
![]() | rackId |
Rack where this client instance resides. If rackIds is set,
rackId is ignored.
(Inherited from ClientPolicy.)rackAware, PREFER_RACK and server rack configuration must also be set to enable this functionality. Default: 0 |
![]() | rackIds |
List of acceptable racks in order of preference.
If rackIds is set, rackId is ignored.
(Inherited from ClientPolicy.)rackAware, PREFER_RACK and server rack configuration must also be set to enable this functionality. Default: null |
![]() | readPolicyDefault |
Default read policy that is used when read command's policy is null.
(Inherited from ClientPolicy.) |
![]() | scanPolicyDefault |
Default scan policy that is used when scan command's policy is null.
(Inherited from ClientPolicy.) |
![]() | tendInterval |
Interval in milliseconds between cluster tends by maintenance thread.
(Inherited from ClientPolicy.)Default: 1000 |
![]() | timeout |
Initial host connection timeout in milliseconds. The timeout when opening a connection
to the server host for the first time.
(Inherited from ClientPolicy.)Default: 1000 |
![]() | tlsPolicy |
Secure connection policy for servers that require TLS connections.
Secure connections are only supported for AerospikeClient synchronous commands.
(Inherited from ClientPolicy.)Secure connections are not supported for asynchronous commands because AsyncClient uses the best performing SocketAsyncEventArgs. Unfortunately, SocketAsyncEventArgs is not supported by the provided SslStream. Default: null (Use normal sockets) |
![]() | user |
User authentication to cluster. Leave null for clusters running without restricted access.
(Inherited from ClientPolicy.)Default: null |
![]() | useServicesAlternate |
Should use "services-alternate" instead of "services" in info request during cluster
tending. "services-alternate" returns server configured external IP addresses that client
uses to talk to nodes. "services-alternate" can be used in place of providing a client "ipMap".
(Inherited from ClientPolicy.)Default: false (use original "services" info request) |
![]() | writePolicyDefault |
Default write policy that is used when write command's policy is null.
(Inherited from ClientPolicy.) |