![]() |
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.
The following are the policy values. For details, please see the documentation for each policy value
The following are the operation policies. Operation policies are groups of policy values for a type of operation.
Data Structures | |
struct | as_policy_admin |
struct | as_policy_apply |
struct | as_policy_base |
struct | as_policy_batch |
struct | as_policy_info |
struct | as_policy_operate |
struct | as_policy_query |
struct | as_policy_read |
struct | as_policy_remove |
struct | as_policy_scan |
struct | as_policy_write |
Macros | |
#define | AS_POLICY_COMMIT_LEVEL_DEFAULT AS_POLICY_COMMIT_LEVEL_ALL |
#define | AS_POLICY_COMPRESSION_THRESHOLD_DEFAULT 0 |
#define | AS_POLICY_CONSISTENCY_LEVEL_DEFAULT AS_POLICY_CONSISTENCY_LEVEL_ONE |
#define | AS_POLICY_EXISTS_DEFAULT AS_POLICY_EXISTS_IGNORE |
#define | AS_POLICY_GEN_DEFAULT AS_POLICY_GEN_IGNORE |
#define | AS_POLICY_KEY_DEFAULT AS_POLICY_KEY_DIGEST |
#define | AS_POLICY_MAX_RETRIES_DEFAULT 2 |
#define | AS_POLICY_REPLICA_DEFAULT AS_POLICY_REPLICA_SEQUENCE |
#define | AS_POLICY_SLEEP_BETWEEN_RETRIES_DEFAULT 0 |
#define | AS_POLICY_SOCKET_TIMEOUT_DEFAULT 0 |
#define | AS_POLICY_TOTAL_TIMEOUT_DEFAULT 1000 |
#define AS_POLICY_COMMIT_LEVEL_DEFAULT AS_POLICY_COMMIT_LEVEL_ALL |
Default as_policy_commit_level value for write
Definition at line 141 of file as_policy.h.
#define AS_POLICY_COMPRESSION_THRESHOLD_DEFAULT 0 |
Default value for compression threshold
Definition at line 99 of file as_policy.h.
#define AS_POLICY_CONSISTENCY_LEVEL_DEFAULT AS_POLICY_CONSISTENCY_LEVEL_ONE |
Default as_policy_consistency_level value for read
Definition at line 134 of file as_policy.h.
#define AS_POLICY_EXISTS_DEFAULT AS_POLICY_EXISTS_IGNORE |
Default as_policy_exists value
Definition at line 120 of file as_policy.h.
#define AS_POLICY_GEN_DEFAULT AS_POLICY_GEN_IGNORE |
Default as_policy_gen value
Definition at line 106 of file as_policy.h.
#define AS_POLICY_KEY_DEFAULT AS_POLICY_KEY_DIGEST |
Default as_policy_key value
Definition at line 113 of file as_policy.h.
#define AS_POLICY_MAX_RETRIES_DEFAULT 2 |
Default number of retries when a transaction fails due to a network error.
Definition at line 85 of file as_policy.h.
#define AS_POLICY_REPLICA_DEFAULT AS_POLICY_REPLICA_SEQUENCE |
Default as_policy_replica value
Definition at line 127 of file as_policy.h.
#define AS_POLICY_SLEEP_BETWEEN_RETRIES_DEFAULT 0 |
Default milliseconds to sleep before a command retry.
Definition at line 92 of file as_policy.h.
#define AS_POLICY_SOCKET_TIMEOUT_DEFAULT 0 |
Default socket idle timeout value
Definition at line 71 of file as_policy.h.
#define AS_POLICY_TOTAL_TIMEOUT_DEFAULT 1000 |
Default total timeout value
Definition at line 78 of file as_policy.h.
Commit Level
Specifies the number of replicas required to be successfully committed before returning success in a write operation to provide the desired consistency guarantee.
Enumerator | |
---|---|
AS_POLICY_COMMIT_LEVEL_ALL |
Return succcess only after successfully committing all replicas. |
AS_POLICY_COMMIT_LEVEL_MASTER |
Return succcess after successfully committing the master replica. |
Definition at line 331 of file as_policy.h.
Consistency Level
Specifies the number of replicas to be consulted in a read operation to provide the desired consistency guarantee.
Enumerator | |
---|---|
AS_POLICY_CONSISTENCY_LEVEL_ONE |
Involve a single replica in the operation. |
AS_POLICY_CONSISTENCY_LEVEL_ALL |
Involve all replicas in the operation. |
Definition at line 308 of file as_policy.h.
enum as_policy_exists |
Existence Policy
Specifies the behavior for writing the record depending whether or not it exists.
Definition at line 241 of file as_policy.h.
enum as_policy_gen |
Generation Policy
Specifies the behavior of record modifications with regard to the generation value.
Definition at line 177 of file as_policy.h.
enum as_policy_key |
Key Policy
Specifies the behavior for whether keys or digests should be sent to the cluster.
Definition at line 205 of file as_policy.h.
enum as_policy_replica |
Replica Policy
Specifies which partition replica to read from.
Definition at line 277 of file as_policy.h.
enum as_policy_retry |
Retry Policy
Specifies the behavior of failed operations.
Enumerator | |
---|---|
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 154 of file as_policy.h.