Struct aerospike::WritePolicy [] [src]

pub struct WritePolicy {
    pub base_policy: BasePolicy,
    pub record_exists_action: RecordExistsAction,
    pub generation_policy: GenerationPolicy,
    pub commit_level: CommitLevel,
    pub generation: u32,
    pub expiration: Expiration,
    pub send_key: bool,
    pub respond_per_each_op: bool,
}

WritePolicy encapsulates parameters for all write operations.

Fields

Base policy instance

RecordExistsAction qualifies how to handle writes where the record already exists.

GenerationPolicy qualifies how to handle record writes based on record generation. The default (NONE) indicates that the generation is not used to restrict writes.

Desired consistency guarantee when committing a transaction on the server. The default (COMMIT_ALL) indicates that the server should wait for master and all replica commits to be successful before returning success to the client.

Generation determines 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.

Expiration determimes record expiration in seconds. Also known as TTL (Time-To-Live). Seconds record will live before being removed by the server.

Send user defined key in addition to hash digest on a record put. The default is to not send the user defined key.

For Client::operate() method, return a result for every operation. Some list operations do not return results by default (operations::list::clear() for example). This can sometimes make it difficult to determine the desired result offset in the returned bin's result list.

Setting RespondPerEachOp to true makes it easier to identify the desired result offset (result offset equals bin's operate sequence). This only makes sense when multiple list operations are used in one operate call and some of those operations do not return results by default.

Methods

impl WritePolicy
[src]

Create a new write policy instance with the specified generation and expiration parameters.

Trait Implementations

impl Default for WritePolicy
[src]

Returns the "default value" for a type. Read more