Execution future provides a way to check on the interim status of the administrative statement that has been issued and is being processed by the kvstore, wait for the operation completion, or cancel the operation.
Attempts to cancel execution of this statement.
Attempts to cancel execution of this statement. Returns KV_FALSE if the statement couldn't be cancelled, possibly because it has already finished. If the statement hasn't succeeded already, and is stopped, the operation will deem to have failed.
- Parameters
-
[in] | future | The future handle |
[in] | may_interrupt_if_running | Since command execution begins immediately, if mayInterreuptIfRunning is KV_FALSE, cancel returns KV_FALSE |
- Returns
- KV_TRUE if the statement is cancelled or KV_FALSE if it couldn't be cancelled, and an error code (a negative number) on failure.
Block until the command represented by this future completes.
Returns information about the execution of the statement. This call will result in communication with the kvstore server.
- Note
- The returned kv_statement_result_t structure is owned by the future handle and released implicitly when it is released, your application should ignore the kv_statement_result structure.
- Parameters
-
[in] | future | The future handle |
[out] | resultp | The output kv_statement_result structure. |
- Returns
- KV_SUCCESS on success, and an error code (a negative number) on failure.
Serializes the future handle.
- Parameters
-
- Returns
- KV_SUCCESS on success, and an error code (a negative number) on failure.
Returns information about the execution of the statement.
The information returned is that obtained by the last communication with the kvstore server, and will not cause any additional communication. To request a current check, use kv_future_update_status().
- Note
- The returned kv_statement_result_t structure is owned by the future handle and released implicitly when it is released, your application should ignore the kv_statement_result structure.
- Parameters
-
[in] | future | The future handle |
- Returns
- The statement result structure.
const char* kv_future_get_statement |
( |
kv_future_t * |
future | ) |
|
Returns the statement which has been executed.
- Parameters
-
[in] | future | The future handle |
- Returns
- The statement which has been executed.
Block until the administrative operation has finished or the timeout period is exceeded.
Returns information about the execution of the statement. This call will result in communication with the kvstore server.
- Note
- The returned kv_statement_result_t structure is owned by the future handle and released implicitly when it is released, your application should ignore the kv_statement_result structure.
- Parameters
-
[in] | future | The future handle |
[in] | timeout_ms | The timeout in milliseconds |
[out] | resultp | The output kv_statement_result structure. |
- Returns
- KV_SUCCESS on success, and an error code (a negative number) on failure.
Returns KV_TRUE if the operation was cancelled. The cancellation may still be in progress, and the operation may still be running.
If the operation is still executing, this call will result in communication with the kvstore server to obtain up to date status.
- Parameters
-
[in] | future | The future handle |
- Returns
- KV_TRUE if the operation was cancelled or KV_FALSE it if it is not, and an error code (a negative number) on failure.
Returns KV_TRUE if the operation has been terminated.
If the operation is still executing, this call will result in communication with the kvstore server to obtain up to date status. When the statement has terminated, results and status can be obtained via calling kv_future_get_last_status().
- Parameters
-
[in] | future | The future handle |
- Returns
- KV_TRUE if the operation was terminated or KV_FALSE it if it is not, and an error code (a negative number) on failure.
Returns information about the execution of the statement.
If the statement is still executing, this call will result in communication with the kvstore server to obtain up to date status, and the status returned will reflect interim information.
- Note
- The returned kv_statement_result_t structure is owned by the future handle and released implicitly when it is released, your application should ignore the kv_statement_result structure.
- Parameters
-
[in] | future | The future handle |
[out] | resultp | The output kv_statement_result structure. |
- Returns
- KV_SUCCESS on success, and an error code (a negative number) on failure.
Releases the resource used by execution id.
- Parameters
-
[in] | idp | The pointer of the execution id handle to release. |
Releases the resource used by future structure.
- Parameters
-
[in] | futurep | The pointer of the future handle to release. |