C API  19.3.0
Oracle NoSQL Database C Client
Consistency

Functions

kv_error_t kv_create_simple_consistency (kv_consistency_enum type, kv_consistency_t **consistencyp)
 Creates a consistency guarantee used for read operations. More...
 
kv_error_t kv_create_time_consistency (kv_timeout_t time_lag, kv_timeout_t timeout_ms, kv_consistency_t **consistencyp)
 Creates a consistency policy which describes the amount of time the replica is allowed to lag the master. More...
 
kv_error_t kv_create_version_consistency (const kv_version_t *version, kv_timeout_t timeout_ms, kv_consistency_t **consistencyp)
 Creates a consistency policy which ensures that the environment on a replica node is at least as current as denoted by the specified version. More...
 
kv_consistency_enum kv_get_consistency_type (const kv_consistency_t *consistency)
 Identifies the consistency policy type used by the provided policy. More...
 
void kv_release_consistency (kv_consistency_t **consistencyp)
 Releases the resource used by consistency structure. More...
 

Detailed Description

Consistency policies are used with read operations to describe how likely it is that the data on your replicas will be identical to, or consistent with, the data on your master server. The most stringent consistency policy requires that the read operation be performed on the master server. In general, the stricter your consistency policy, the slower your store's read throughput.

Function Documentation

kv_error_t kv_create_simple_consistency ( kv_consistency_enum  type,
kv_consistency_t **  consistencyp 
)

Creates a consistency guarantee used for read operations.

Parameters
[in]typeThe type of consistency, see kv_consistency_enum.
[out]consistencypThe output consistency, it should be released using kv_release_consistency().
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_create_time_consistency ( kv_timeout_t  time_lag,
kv_timeout_t  timeout_ms,
kv_consistency_t **  consistencyp 
)

Creates a consistency policy which describes the amount of time the replica is allowed to lag the master.

Parameters
[in]time_lagThe time_lag parameter specifies the time interval, in milliseconds, by which the replica may be out of date with respect to the master when a transaction is initiated on the replica.
[in]timeout_msThe timeout_ms parameter describes how long a replica may wait for the desired consistency to be achieved before giving up.
[out]consistencypThe output consistency, it should be released using kv_release_consistency().
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_create_version_consistency ( const kv_version_t version,
kv_timeout_t  timeout_ms,
kv_consistency_t **  consistencyp 
)

Creates a consistency policy which ensures that the environment on a replica node is at least as current as denoted by the specified version.

Parameters
[in]versionThe version parameter identifies the version that must be seen at the replica in order to consider it current. It is obtained from the result using kv_result_get_version() or kv_result_get_prev_row_version().
[in]timeout_msThe timeout_ms parameter describes how long a replica may wait for the desired consistency to be achieved before giving up.
[out]consistencypThe output consistency, it should be released using kv_release_consistency().
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_consistency_enum kv_get_consistency_type ( const kv_consistency_t consistency)

Identifies the consistency policy type used by the provided policy.

Parameters
[in]consistency
Returns
the consistency policy type.
void kv_release_consistency ( kv_consistency_t **  consistencyp)

Releases the resource used by consistency structure.

Parameters
[in]consistencypThe consistency structure to release.