![]() |
Operate Policy
Definition at line 780 of file as_policy.h.
#include "as_policy.h"
Related Symbols | |
(Note that these are not member symbols.) | |
static void | as_policy_operate_copy (const as_policy_operate *src, as_policy_operate *trg) |
static as_policy_operate * | as_policy_operate_init (as_policy_operate *p) |
|
related |
Shallow copy as_policy_operate values.
src | The source policy. |
trg | The target policy. |
Definition at line 1792 of file as_policy.h.
|
related |
Initialize as_policy_operate to default values.
p | The policy to initialize. |
Definition at line 1763 of file as_policy.h.
References as_policy_base_write_init(), AS_POLICY_COMMIT_LEVEL_DEFAULT, AS_POLICY_EXISTS_DEFAULT, AS_POLICY_GEN_DEFAULT, AS_POLICY_KEY_DEFAULT, AS_POLICY_READ_MODE_AP_DEFAULT, AS_POLICY_READ_MODE_SC_DEFAULT, AS_POLICY_REPLICA_DEFAULT, async_heap_rec, base, commit_level, deserialize, durable_delete, exists, gen, key, on_locking_only, read_mode_ap, read_mode_sc, read_touch_ttl_percent, replica, respond_all_ops, and ttl.
bool as_policy_operate::async_heap_rec |
Should as_record instance be allocated on the heap before user listener is called in async commands. If true, the user is responsible for calling as_record_destroy() when done with the record. If false, as_record_destroy() is automatically called by the client after the user listener function completes. This field is ignored for sync commands.
Default: false
Definition at line 898 of file as_policy.h.
as_policy_base as_policy_operate::base |
Generic policy fields.
Definition at line 785 of file as_policy.h.
as_policy_commit_level as_policy_operate::commit_level |
Specifies the number of replicas required to be committed successfully when writing before returning command succeeded.
Definition at line 813 of file as_policy.h.
bool as_policy_operate::deserialize |
Should raw bytes representing a list or map be deserialized to as_list or as_map. Set to false for backup programs that just need access to raw bytes.
Default: true
Definition at line 867 of file as_policy.h.
bool as_policy_operate::durable_delete |
If the command results in a record deletion, leave a tombstone for the record. This prevents deleted records from reappearing after node failures. Valid for Aerospike Server Enterprise Edition only.
Default: false (do not tombstone deleted records).
Definition at line 876 of file as_policy.h.
as_policy_exists as_policy_operate::exists |
Specifies the behavior for the existence of the record.
Definition at line 823 of file as_policy.h.
as_policy_gen as_policy_operate::gen |
Specifies the behavior for the generation value.
Definition at line 818 of file as_policy.h.
as_policy_key as_policy_operate::key |
Specifies the behavior for the key.
Definition at line 790 of file as_policy.h.
bool as_policy_operate::on_locking_only |
Execute the write command only if the record is not already locked by this transaction. If this field is true and the record is already locked by this transaction, the command will return AEROSPIKE_MRT_ALREADY_LOCKED.
This field is useful for safely retrying non-idempotent writes as an alternative to simply aborting the transaction.
Default: false.
Definition at line 888 of file as_policy.h.
as_policy_read_mode_ap as_policy_operate::read_mode_ap |
Read policy for AP (availability) namespaces. Default: AS_POLICY_READ_MODE_AP_ONE
Definition at line 801 of file as_policy.h.
as_policy_read_mode_sc as_policy_operate::read_mode_sc |
Read policy for SC (strong consistency) namespaces. Default: AS_POLICY_READ_MODE_SC_SESSION
Definition at line 807 of file as_policy.h.
int as_policy_operate::read_touch_ttl_percent |
Determine how record TTL (time to live) is affected on reads. When enabled, the server can efficiently operate as a read-based LRU cache where the least recently used records are expired. The value is expressed as a percentage of the TTL sent on the most recent write such that a read within this interval of the record’s end of life will generate a touch.
For example, if the most recent write had a TTL of 10 hours and read_touch_ttl_percent is set to 80, the next read within 8 hours of the record's end of life (equivalent to 2 hours after the most recent write) will result in a touch, resetting the TTL to another 10 hours.
Values:
Default: 0
Definition at line 859 of file as_policy.h.
as_policy_replica as_policy_operate::replica |
Algorithm used to determine target node.
Definition at line 795 of file as_policy.h.
bool as_policy_operate::respond_all_ops |
Should the client return a result for every operation.
Some operations do not return a result by default. This can make it difficult to determine the result offset in the returned bin's result list. Setting this field to true makes it easier to identify the desired result offset.
This field defaults to false for older operations (basic read/write/incr/touch and list) to preserve legacy behavior. Newer operations (map, expression, bit or HLL and batch write operations) force respond_all_ops to be true regardless of it's initial setting.
Definition at line 911 of file as_policy.h.
uint32_t as_policy_operate::ttl |
The default time-to-live (expiration) of the record in seconds. This field will only be used if one or more of the operations is a write operation and if "as_operations.ttl" is set to AS_RECORD_CLIENT_DEFAULT_TTL. The as_operations instance is passed in to operate functions along with as_policy_operate.
There are also special values that can be set in the record ttl:
Definition at line 838 of file as_policy.h.