WritePolicy MembersAerospike

The WritePolicy type exposes the following members.
Constructors

  NameDescription
Public methodWritePolicy 
Default constructor.
Public methodWritePolicy(Policy)
Copy write policy from another policy.
Public methodWritePolicy(WritePolicy)
Copy write policy from another write policy.
Back to Top
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 fieldexpiration
Record expiration. Also known as ttl (time to live). Seconds record will live before being removed by the server.

Expiration values:

  • -1: Never expire for Aerospike 2 server versions >= 2.7.2 and Aerospike 3 server versions >= 3.1.4. Do not use -1 for older servers.
  • 0: Default to namespace's "default-ttl" on the server.
  • > 0: Actual expiration in seconds.

Public fieldgeneration
Expected generation. Generation is the number of times a record has been modified (including creation) on the server. If a write operation is creating a record, the expected generation would be 0.
Public fieldgenerationPolicy
Qualify how to handle record writes based on record generation. The default (NONE) indicates that the generation is not used to restrict writes.
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 1.
(Inherited from Policy.)
Public fieldpriority
Priority of request relative to other transactions. Currently, only used for scans.
(Inherited from Policy.)
Public fieldrecordExistsAction
Qualify how to handle writes where the record already exists.
Public fieldsendKey
Send user defined key in addition to hash digest on a record put. The default is to not send the user defined key.
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