BatchPolicy FieldsAerospike
The BatchPolicy type exposes the following members.
Fields

  NameDescription
Public fieldallowProleReads
Allow read operations to use replicated data partitions instead of master partition. By default, both read and write operations are directed to the master partition.

This variable is currently only used in batch read/exists operations. For batch, this variable should only be set to true when the replication factor is greater than or equal to the number of nodes in the cluster.

(Inherited from Policy.)
Public fieldmaxConcurrentThreads
Maximum number of concurrent batch request threads to server nodes at any point in time. If there are 16 node/namespace combinations requested and maxConcurrentThreads is 8, then batch requests will be made for 8 node/namespace combinations in parallel threads. When a request completes, a new request will be issued until all 16 threads are complete.

Values:

  • 1: Issue batch requests sequentially. This mode has a performance advantage for small to medium sized batch sizes because requests can be issued in the main transaction thread. This is the default.
  • 0: Issue all batch requests in parallel threads. This mode has a performance advantage for extremely large batch sizes because each node can process the request immediately. The downside is extra threads will need to be created (or taken from a thread pool).
  • > 0: Issue up to maxConcurrentThreads batch requests in parallel threads. When a request completes, a new request will be issued until all threads are complete. This mode prevents too many parallel threads being created for large cluster implementations. The downside is extra threads will still need to be created (or taken from a thread pool).

Public fieldmaxRetries
Maximum number of retries before aborting the current transaction. A retry is attempted when there is a network error other than timeout. If maxRetries is exceeded, the abort will occur even if the timeout has not yet been exceeded. The default number of retries is 2.
(Inherited from Policy.)
Public fieldpriority
Priority of request relative to other transactions. Currently, only used for scans.
(Inherited from Policy.)
Public fieldsleepBetweenRetries
Milliseconds to sleep between retries if a transaction fails and the timeout was not exceeded. The default sleep between retries is 500 ms.
(Inherited from Policy.)
Public fieldtimeout
Transaction timeout in milliseconds. This timeout is used to set the socket timeout and is also sent to the server along with the transaction in the wire protocol. Default to no timeout (0).
(Inherited from Policy.)
Back to Top
See Also