C API  19.3.0
Oracle NoSQL Database C Client
Execution future

Functions

kv_error_t kv_future_get (kv_future_t *future, const kv_statement_result_t **resultp)
 Block until the command represented by this future completes. More...
 
kv_error_t kv_future_get_with_timeout (kv_future_t *future, kv_timeout_t timeout_ms, const kv_statement_result_t **resultp)
 Block until the administrative operation has finished or the timeout period is exceeded. More...
 
kv_boolean_t kv_future_cancel (kv_future_t *future, kv_boolean_t may_interrupt_if_running)
 Attempts to cancel execution of this statement. More...
 
kv_error_t kv_future_get_execution_id (kv_future_t *future, kv_execution_id_t **idp)
 Serializes the future handle. More...
 
kv_boolean_t kv_future_is_cancelled (kv_future_t *future)
 Returns KV_TRUE if the operation was cancelled. The cancellation may still be in progress, and the operation may still be running. More...
 
kv_boolean_t kv_future_is_done (kv_future_t *future)
 Returns KV_TRUE if the operation has been terminated. More...
 
const kv_statement_result_tkv_future_get_last_status (kv_future_t *future)
 Returns information about the execution of the statement. More...
 
kv_error_t kv_future_update_status (kv_future_t *future, const kv_statement_result_t **resultp)
 Returns information about the execution of the statement. More...
 
const char * kv_future_get_statement (kv_future_t *future)
 Returns the statement which has been executed. More...
 
void kv_release_future (kv_future_t **futurep)
 Releases the resource used by future structure. More...
 
void kv_release_execution_id (kv_execution_id_t **idp)
 Releases the resource used by execution id. More...
 

Detailed Description

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.

Function Documentation

kv_boolean_t kv_future_cancel ( kv_future_t future,
kv_boolean_t  may_interrupt_if_running 
)

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]futureThe future handle
[in]may_interrupt_if_runningSince 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.
kv_error_t kv_future_get ( kv_future_t future,
const kv_statement_result_t **  resultp 
)

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]futureThe future handle
[out]resultpThe output kv_statement_result structure.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_error_t kv_future_get_execution_id ( kv_future_t future,
kv_execution_id_t **  idp 
)

Serializes the future handle.

Parameters
[in]futureThe future handle.
[out]idpThe output kv_execution_id_t structure, it should be freed using kv_release_execution_id().
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
const kv_statement_result_t* kv_future_get_last_status ( kv_future_t future)

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]futureThe 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]futureThe future handle
Returns
The statement which has been executed.
kv_error_t kv_future_get_with_timeout ( kv_future_t future,
kv_timeout_t  timeout_ms,
const kv_statement_result_t **  resultp 
)

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]futureThe future handle
[in]timeout_msThe timeout in milliseconds
[out]resultpThe output kv_statement_result structure.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
kv_boolean_t kv_future_is_cancelled ( kv_future_t future)

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]futureThe 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.
kv_boolean_t kv_future_is_done ( kv_future_t future)

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]futureThe 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.
kv_error_t kv_future_update_status ( kv_future_t future,
const kv_statement_result_t **  resultp 
)

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]futureThe future handle
[out]resultpThe output kv_statement_result structure.
Returns
KV_SUCCESS on success, and an error code (a negative number) on failure.
void kv_release_execution_id ( kv_execution_id_t **  idp)

Releases the resource used by execution id.

Parameters
[in]idpThe pointer of the execution id handle to release.
void kv_release_future ( kv_future_t **  futurep)

Releases the resource used by future structure.

Parameters
[in]futurepThe pointer of the future handle to release.