Policies define the behavior of database operations.
Policies fall into two groups: policy values and operation policies. A policy value is a single value which defines how the client behaves. An operation policy is a group of policy values which affect an operation.
Policy Values
The following are the policy values. For details, please see the documentation for each policy value
- as_policy_key
- as_policy_gen
- as_policy_retry
- as_policy_exists
Operation Policies
The following are the operation policies. Operation policies are groups of policy values for a type of operation.
|
enum | as_policy_bool {
AS_POLICY_BOOL_UNDEF = -1,
AS_POLICY_BOOL_FALSE = false,
AS_POLICY_BOOL_TRUE = true,
AS_POLICY_BOOL_UNDEF = -1,
AS_POLICY_BOOL_FALSE = false,
AS_POLICY_BOOL_TRUE = true
} |
|
enum | as_policy_bool {
AS_POLICY_BOOL_UNDEF = -1,
AS_POLICY_BOOL_FALSE = false,
AS_POLICY_BOOL_TRUE = true,
AS_POLICY_BOOL_UNDEF = -1,
AS_POLICY_BOOL_FALSE = false,
AS_POLICY_BOOL_TRUE = true
} |
|
enum | as_policy_exists {
AS_POLICY_EXISTS_UNDEF,
AS_POLICY_EXISTS_IGNORE,
AS_POLICY_EXISTS_CREATE,
AS_POLICY_EXISTS_UPDATE,
AS_POLICY_EXISTS_REPLACE,
AS_POLICY_EXISTS_CREATE_OR_REPLACE,
AS_POLICY_EXISTS_UNDEF,
AS_POLICY_EXISTS_IGNORE,
AS_POLICY_EXISTS_CREATE,
AS_POLICY_EXISTS_UPDATE,
AS_POLICY_EXISTS_REPLACE,
AS_POLICY_EXISTS_CREATE_OR_REPLACE
} |
|
enum | as_policy_exists {
AS_POLICY_EXISTS_UNDEF,
AS_POLICY_EXISTS_IGNORE,
AS_POLICY_EXISTS_CREATE,
AS_POLICY_EXISTS_UPDATE,
AS_POLICY_EXISTS_REPLACE,
AS_POLICY_EXISTS_CREATE_OR_REPLACE,
AS_POLICY_EXISTS_UNDEF,
AS_POLICY_EXISTS_IGNORE,
AS_POLICY_EXISTS_CREATE,
AS_POLICY_EXISTS_UPDATE,
AS_POLICY_EXISTS_REPLACE,
AS_POLICY_EXISTS_CREATE_OR_REPLACE
} |
|
enum | as_policy_gen {
AS_POLICY_GEN_UNDEF,
AS_POLICY_GEN_IGNORE,
AS_POLICY_GEN_EQ,
AS_POLICY_GEN_GT,
AS_POLICY_GEN_DUP,
AS_POLICY_GEN_UNDEF,
AS_POLICY_GEN_IGNORE,
AS_POLICY_GEN_EQ,
AS_POLICY_GEN_GT,
AS_POLICY_GEN_DUP
} |
|
enum | as_policy_gen {
AS_POLICY_GEN_UNDEF,
AS_POLICY_GEN_IGNORE,
AS_POLICY_GEN_EQ,
AS_POLICY_GEN_GT,
AS_POLICY_GEN_DUP,
AS_POLICY_GEN_UNDEF,
AS_POLICY_GEN_IGNORE,
AS_POLICY_GEN_EQ,
AS_POLICY_GEN_GT,
AS_POLICY_GEN_DUP
} |
|
enum | as_policy_key {
AS_POLICY_KEY_UNDEF,
AS_POLICY_KEY_DIGEST,
AS_POLICY_KEY_SEND,
AS_POLICY_KEY_STORE,
AS_POLICY_KEY_CHECK,
AS_POLICY_KEY_UNDEF,
AS_POLICY_KEY_DIGEST,
AS_POLICY_KEY_SEND,
AS_POLICY_KEY_STORE,
AS_POLICY_KEY_CHECK
} |
|
enum | as_policy_key {
AS_POLICY_KEY_UNDEF,
AS_POLICY_KEY_DIGEST,
AS_POLICY_KEY_SEND,
AS_POLICY_KEY_STORE,
AS_POLICY_KEY_CHECK,
AS_POLICY_KEY_UNDEF,
AS_POLICY_KEY_DIGEST,
AS_POLICY_KEY_SEND,
AS_POLICY_KEY_STORE,
AS_POLICY_KEY_CHECK
} |
|
enum | as_policy_retry {
AS_POLICY_RETRY_UNDEF,
AS_POLICY_RETRY_NONE,
AS_POLICY_RETRY_ONCE,
AS_POLICY_RETRY_UNDEF,
AS_POLICY_RETRY_NONE,
AS_POLICY_RETRY_ONCE
} |
|
enum | as_policy_retry {
AS_POLICY_RETRY_UNDEF,
AS_POLICY_RETRY_NONE,
AS_POLICY_RETRY_ONCE,
AS_POLICY_RETRY_UNDEF,
AS_POLICY_RETRY_NONE,
AS_POLICY_RETRY_ONCE
} |
|
#define AS_POLICY_TIMEOUT_DEFAULT 1000 |
#define AS_POLICY_TIMEOUT_DEFAULT 1000 |
Boolean Policy.
This enum provides boolean values (true,false) and an undefined value for the boolean.
Enumerator |
---|
AS_POLICY_BOOL_UNDEF |
If the value is neither true or false, then it is undefined. This is used for cases where we initialize a variable, but do not want it to have a value.
|
AS_POLICY_BOOL_FALSE |
This value is interchangable with false .
|
AS_POLICY_BOOL_TRUE |
This value is interchangable with true .
|
AS_POLICY_BOOL_UNDEF |
If the value is neither true or false, then it is undefined. This is used for cases where we initialize a variable, but do not want it to have a value.
|
AS_POLICY_BOOL_FALSE |
This value is interchangable with false .
|
AS_POLICY_BOOL_TRUE |
This value is interchangable with true .
|
Definition at line 304 of file src/include/aerospike/as_policy.h.
Boolean Policy.
This enum provides boolean values (true,false) and an undefined value for the boolean.
Enumerator |
---|
AS_POLICY_BOOL_UNDEF |
If the value is neither true or false, then it is undefined. This is used for cases where we initialize a variable, but do not want it to have a value.
|
AS_POLICY_BOOL_FALSE |
This value is interchangable with false .
|
AS_POLICY_BOOL_TRUE |
This value is interchangable with true .
|
AS_POLICY_BOOL_UNDEF |
If the value is neither true or false, then it is undefined. This is used for cases where we initialize a variable, but do not want it to have a value.
|
AS_POLICY_BOOL_FALSE |
This value is interchangable with false .
|
AS_POLICY_BOOL_TRUE |
This value is interchangable with true .
|
Definition at line 304 of file target/Darwin-i386/include/aerospike/as_policy.h.
Existence Policy.
Specifies the behavior for writing the record depending whether or not it exists.
Enumerator |
---|
AS_POLICY_EXISTS_UNDEF |
The policy is undefined.
If set, then the value will default to either as_config.policies.exists or AS_POLICY_EXISTS_DEFAULT .
|
AS_POLICY_EXISTS_IGNORE |
Write the record, regardless of existence. (i.e. create or update.)
|
AS_POLICY_EXISTS_CREATE |
Create a record, ONLY if it doesn't exist.
|
AS_POLICY_EXISTS_UPDATE |
Update a record, ONLY if it exists.
|
AS_POLICY_EXISTS_REPLACE |
Completely replace a record, ONLY if it exists.
|
AS_POLICY_EXISTS_CREATE_OR_REPLACE |
Completely replace a record if it exists, otherwise create it.
|
AS_POLICY_EXISTS_UNDEF |
The policy is undefined.
If set, then the value will default to either as_config.policies.exists or AS_POLICY_EXISTS_DEFAULT .
|
AS_POLICY_EXISTS_IGNORE |
Write the record, regardless of existence. (i.e. create or update.)
|
AS_POLICY_EXISTS_CREATE |
Create a record, ONLY if it doesn't exist.
|
AS_POLICY_EXISTS_UPDATE |
Update a record, ONLY if it exists.
|
AS_POLICY_EXISTS_REPLACE |
Completely replace a record, ONLY if it exists.
|
AS_POLICY_EXISTS_CREATE_OR_REPLACE |
Completely replace a record if it exists, otherwise create it.
|
Definition at line 258 of file target/Darwin-i386/include/aerospike/as_policy.h.
Existence Policy.
Specifies the behavior for writing the record depending whether or not it exists.
Enumerator |
---|
AS_POLICY_EXISTS_UNDEF |
The policy is undefined.
If set, then the value will default to either as_config.policies.exists or AS_POLICY_EXISTS_DEFAULT .
|
AS_POLICY_EXISTS_IGNORE |
Write the record, regardless of existence. (i.e. create or update.)
|
AS_POLICY_EXISTS_CREATE |
Create a record, ONLY if it doesn't exist.
|
AS_POLICY_EXISTS_UPDATE |
Update a record, ONLY if it exists.
|
AS_POLICY_EXISTS_REPLACE |
Completely replace a record, ONLY if it exists.
|
AS_POLICY_EXISTS_CREATE_OR_REPLACE |
Completely replace a record if it exists, otherwise create it.
|
AS_POLICY_EXISTS_UNDEF |
The policy is undefined.
If set, then the value will default to either as_config.policies.exists or AS_POLICY_EXISTS_DEFAULT .
|
AS_POLICY_EXISTS_IGNORE |
Write the record, regardless of existence. (i.e. create or update.)
|
AS_POLICY_EXISTS_CREATE |
Create a record, ONLY if it doesn't exist.
|
AS_POLICY_EXISTS_UPDATE |
Update a record, ONLY if it exists.
|
AS_POLICY_EXISTS_REPLACE |
Completely replace a record, ONLY if it exists.
|
AS_POLICY_EXISTS_CREATE_OR_REPLACE |
Completely replace a record if it exists, otherwise create it.
|
Definition at line 258 of file src/include/aerospike/as_policy.h.
Generation Policy
Specifies the behavior of record modifications with regard to the generation value.
Enumerator |
---|
AS_POLICY_GEN_UNDEF |
The policy is undefined.
If set, then the value will default to either as_config.policies.gen or AS_POLICY_GEN_DEFAULT .
|
AS_POLICY_GEN_IGNORE |
Write a record, regardless of generation.
|
AS_POLICY_GEN_EQ |
Write a record, ONLY if generations are equal
|
AS_POLICY_GEN_GT |
Write a record, ONLY if local generation is greater-than remote generation
|
AS_POLICY_GEN_DUP |
Write a record creating a duplicate, ONLY if the generation collides (?)
|
AS_POLICY_GEN_UNDEF |
The policy is undefined.
If set, then the value will default to either as_config.policies.gen or AS_POLICY_GEN_DEFAULT .
|
AS_POLICY_GEN_IGNORE |
Write a record, regardless of generation.
|
AS_POLICY_GEN_EQ |
Write a record, ONLY if generations are equal
|
AS_POLICY_GEN_GT |
Write a record, ONLY if local generation is greater-than remote generation
|
AS_POLICY_GEN_DUP |
Write a record creating a duplicate, ONLY if the generation collides (?)
|
Definition at line 145 of file src/include/aerospike/as_policy.h.
Generation Policy
Specifies the behavior of record modifications with regard to the generation value.
Enumerator |
---|
AS_POLICY_GEN_UNDEF |
The policy is undefined.
If set, then the value will default to either as_config.policies.gen or AS_POLICY_GEN_DEFAULT .
|
AS_POLICY_GEN_IGNORE |
Write a record, regardless of generation.
|
AS_POLICY_GEN_EQ |
Write a record, ONLY if generations are equal
|
AS_POLICY_GEN_GT |
Write a record, ONLY if local generation is greater-than remote generation
|
AS_POLICY_GEN_DUP |
Write a record creating a duplicate, ONLY if the generation collides (?)
|
AS_POLICY_GEN_UNDEF |
The policy is undefined.
If set, then the value will default to either as_config.policies.gen or AS_POLICY_GEN_DEFAULT .
|
AS_POLICY_GEN_IGNORE |
Write a record, regardless of generation.
|
AS_POLICY_GEN_EQ |
Write a record, ONLY if generations are equal
|
AS_POLICY_GEN_GT |
Write a record, ONLY if local generation is greater-than remote generation
|
AS_POLICY_GEN_DUP |
Write a record creating a duplicate, ONLY if the generation collides (?)
|
Definition at line 145 of file target/Darwin-i386/include/aerospike/as_policy.h.
Key Policy
Specifies the behavior for whether keys or digests should be sent to the cluster.
Enumerator |
---|
AS_POLICY_KEY_UNDEF |
The policy is undefined.
If set, then the value will default to either as_config.policies.key or AS_POLICY_KEY_DEFAULT .
|
AS_POLICY_KEY_DIGEST |
Send the digest value of the key.
This is the recommended mode of operation. This calculates the digest and send the digest to the server. The digest is only calculated on the client, and not on the server.
|
AS_POLICY_KEY_SEND |
This policy is ideal if you want to reduce the number of bytes sent over the network. This will only work if the combination the set and key value are less than 20 bytes, which is the size of the digest.
This will also cause the digest to be computed once on the client and once on the server.
If your values are not less than 20 bytes, then you should just use AS_POLICY_KEY_DIGEST.
|
AS_POLICY_KEY_STORE |
Store the key.
If you want keys to be returned when scanning or querying, the keys must be stored on the server. This policy causes a write operation to store the key. Once a key is stored, the server will keep it - there is no need to use this policy on subsequent updates of the record.
This policy is not relevant for read or delete operations. If this policy is set for operations for which it's irrelevant, AS_POLICY_KEY_DIGEST will be used instead.
|
AS_POLICY_KEY_CHECK |
Check that the key matches the stored key, if there is a stored key.
Use this policy to compare the key with the key stored on the server. A mismatch will cause AEROSPIKE_ERR_RECORD_KEY_MISMATCH to be returned.
For write operations, if the key is not already stored on the server, this policy will cause the key to be stored.
|
AS_POLICY_KEY_UNDEF |
The policy is undefined.
If set, then the value will default to either as_config.policies.key or AS_POLICY_KEY_DEFAULT .
|
AS_POLICY_KEY_DIGEST |
Send the digest value of the key.
This is the recommended mode of operation. This calculates the digest and send the digest to the server. The digest is only calculated on the client, and not on the server.
|
AS_POLICY_KEY_SEND |
This policy is ideal if you want to reduce the number of bytes sent over the network. This will only work if the combination the set and key value are less than 20 bytes, which is the size of the digest.
This will also cause the digest to be computed once on the client and once on the server.
If your values are not less than 20 bytes, then you should just use AS_POLICY_KEY_DIGEST.
|
AS_POLICY_KEY_STORE |
Store the key.
If you want keys to be returned when scanning or querying, the keys must be stored on the server. This policy causes a write operation to store the key. Once a key is stored, the server will keep it - there is no need to use this policy on subsequent updates of the record.
This policy is not relevant for read or delete operations. If this policy is set for operations for which it's irrelevant, AS_POLICY_KEY_DIGEST will be used instead.
|
AS_POLICY_KEY_CHECK |
Check that the key matches the stored key, if there is a stored key.
Use this policy to compare the key with the key stored on the server. A mismatch will cause AEROSPIKE_ERR_RECORD_KEY_MISMATCH to be returned.
For write operations, if the key is not already stored on the server, this policy will cause the key to be stored.
|
Definition at line 188 of file target/Darwin-i386/include/aerospike/as_policy.h.
Key Policy
Specifies the behavior for whether keys or digests should be sent to the cluster.
Enumerator |
---|
AS_POLICY_KEY_UNDEF |
The policy is undefined.
If set, then the value will default to either as_config.policies.key or AS_POLICY_KEY_DEFAULT .
|
AS_POLICY_KEY_DIGEST |
Send the digest value of the key.
This is the recommended mode of operation. This calculates the digest and send the digest to the server. The digest is only calculated on the client, and not on the server.
|
AS_POLICY_KEY_SEND |
This policy is ideal if you want to reduce the number of bytes sent over the network. This will only work if the combination the set and key value are less than 20 bytes, which is the size of the digest.
This will also cause the digest to be computed once on the client and once on the server.
If your values are not less than 20 bytes, then you should just use AS_POLICY_KEY_DIGEST.
|
AS_POLICY_KEY_STORE |
Store the key.
If you want keys to be returned when scanning or querying, the keys must be stored on the server. This policy causes a write operation to store the key. Once a key is stored, the server will keep it - there is no need to use this policy on subsequent updates of the record.
This policy is not relevant for read or delete operations. If this policy is set for operations for which it's irrelevant, AS_POLICY_KEY_DIGEST will be used instead.
|
AS_POLICY_KEY_CHECK |
Check that the key matches the stored key, if there is a stored key.
Use this policy to compare the key with the key stored on the server. A mismatch will cause AEROSPIKE_ERR_RECORD_KEY_MISMATCH to be returned.
For write operations, if the key is not already stored on the server, this policy will cause the key to be stored.
|
AS_POLICY_KEY_UNDEF |
The policy is undefined.
If set, then the value will default to either as_config.policies.key or AS_POLICY_KEY_DEFAULT .
|
AS_POLICY_KEY_DIGEST |
Send the digest value of the key.
This is the recommended mode of operation. This calculates the digest and send the digest to the server. The digest is only calculated on the client, and not on the server.
|
AS_POLICY_KEY_SEND |
This policy is ideal if you want to reduce the number of bytes sent over the network. This will only work if the combination the set and key value are less than 20 bytes, which is the size of the digest.
This will also cause the digest to be computed once on the client and once on the server.
If your values are not less than 20 bytes, then you should just use AS_POLICY_KEY_DIGEST.
|
AS_POLICY_KEY_STORE |
Store the key.
If you want keys to be returned when scanning or querying, the keys must be stored on the server. This policy causes a write operation to store the key. Once a key is stored, the server will keep it - there is no need to use this policy on subsequent updates of the record.
This policy is not relevant for read or delete operations. If this policy is set for operations for which it's irrelevant, AS_POLICY_KEY_DIGEST will be used instead.
|
AS_POLICY_KEY_CHECK |
Check that the key matches the stored key, if there is a stored key.
Use this policy to compare the key with the key stored on the server. A mismatch will cause AEROSPIKE_ERR_RECORD_KEY_MISMATCH to be returned.
For write operations, if the key is not already stored on the server, this policy will cause the key to be stored.
|
Definition at line 188 of file src/include/aerospike/as_policy.h.
Retry Policy
Specifies the behavior of failed operations.
Enumerator |
---|
AS_POLICY_RETRY_UNDEF |
The policy is undefined.
If set, then the value will default to either as_config.policies.retry or AS_POLICY_RETRY_DEFAULT .
|
AS_POLICY_RETRY_NONE |
Only attempt an operation once.
|
AS_POLICY_RETRY_ONCE |
If an operation fails, attempt the operation one more time.
|
AS_POLICY_RETRY_UNDEF |
The policy is undefined.
If set, then the value will default to either as_config.policies.retry or AS_POLICY_RETRY_DEFAULT .
|
AS_POLICY_RETRY_NONE |
Only attempt an operation once.
|
AS_POLICY_RETRY_ONCE |
If an operation fails, attempt the operation one more time.
|
Definition at line 113 of file target/Darwin-i386/include/aerospike/as_policy.h.
Retry Policy
Specifies the behavior of failed operations.
Enumerator |
---|
AS_POLICY_RETRY_UNDEF |
The policy is undefined.
If set, then the value will default to either as_config.policies.retry or AS_POLICY_RETRY_DEFAULT .
|
AS_POLICY_RETRY_NONE |
Only attempt an operation once.
|
AS_POLICY_RETRY_ONCE |
If an operation fails, attempt the operation one more time.
|
AS_POLICY_RETRY_UNDEF |
The policy is undefined.
If set, then the value will default to either as_config.policies.retry or AS_POLICY_RETRY_DEFAULT .
|
AS_POLICY_RETRY_NONE |
Only attempt an operation once.
|
AS_POLICY_RETRY_ONCE |
If an operation fails, attempt the operation one more time.
|
Definition at line 113 of file src/include/aerospike/as_policy.h.