com.aerospike.client.async
Class AsyncClientPolicy

java.lang.Object
  extended by com.aerospike.client.policy.ClientPolicy
      extended by com.aerospike.client.async.AsyncClientPolicy

public final class AsyncClientPolicy
extends ClientPolicy

Container object for client policy Command.


Field Summary
 MaxCommandAction asyncMaxCommandAction
          How to handle cases when the asynchronous maximum number of concurrent connections have been reached.
 int asyncMaxCommands
          Maximum number of concurrent asynchronous commands that are active at any point in time.
 int asyncSelectorThreads
          Number of selector threads used to process asynchronous network events.
 int asyncSelectorTimeout
          Maximum milliseconds to wait for an asynchronous network selector event.
 java.util.concurrent.ExecutorService asyncTaskThreadPool
          Asynchronous socket read/user callback task thread pool.
 
Fields inherited from class com.aerospike.client.policy.ClientPolicy
failIfNotConnected, maxSocketIdle, maxThreads, timeout
 
Constructor Summary
AsyncClientPolicy()
           
 
Method Summary
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

asyncMaxCommandAction

public MaxCommandAction asyncMaxCommandAction
How to handle cases when the asynchronous maximum number of concurrent connections have been reached.


asyncMaxCommands

public int 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 *

The actual number of open connections consumed depends on how balanced the commands are between nodes and if asyncMaxConnAction is ACCEPT.

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


asyncSelectorTimeout

public int asyncSelectorTimeout
Maximum milliseconds to wait for an asynchronous network selector event. The default value of zero indicates the selector should not timeout.


asyncSelectorThreads

public int asyncSelectorThreads
Number of selector threads used to process asynchronous network events. The default is a single threaded network handler. Some applications may benefit from increasing this value to the number of CPU cores on the executing machine.


asyncTaskThreadPool

public java.util.concurrent.ExecutorService asyncTaskThreadPool
Asynchronous socket read/user callback task thread pool. The default, null, indicates asynchronous tasks should be run in the same thread as the selector.

Example: asyncTaskThreadPool = Executors.newCachedThreadPool();

Constructor Detail

AsyncClientPolicy

public AsyncClientPolicy()