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.
Creates a consistency guarantee used for read operations.
- Parameters
-
[in] | type | The type of consistency, see kv_consistency_enum. |
[out] | consistencyp | The output consistency, it should be released using kv_release_consistency(). |
- Returns
- KV_SUCCESS on success, and an error code (a negative number) on failure.
Creates a consistency policy which describes the amount of time the replica is allowed to lag the master.
- Parameters
-
[in] | time_lag | The 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_ms | The timeout_ms parameter describes how long a replica may wait for the desired consistency to be achieved before giving up. |
[out] | consistencyp | The output consistency, it should be released using kv_release_consistency(). |
- Returns
- KV_SUCCESS on success, and an error code (a negative number) on failure.
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] | version | The 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_ms | The timeout_ms parameter describes how long a replica may wait for the desired consistency to be achieved before giving up. |
[out] | consistencyp | The output consistency, it should be released using kv_release_consistency(). |
- Returns
- KV_SUCCESS on success, and an error code (a negative number) on failure.
Identifies the consistency policy type used by the provided policy.
- Parameters
-
- Returns
- the consistency policy type.
Releases the resource used by consistency structure.
- Parameters
-
[in] | consistencyp | The consistency structure to release. |