SystemResult¶
-
class
borneo.
SystemResult
[source]¶ Bases:
borneo.operations.Result
On-premise only.
SystemResult is returned from
NoSQLHandle.system_status()
andNoSQLHandle.system_request()
operations. It encapsulates the state of the operation requested.Some operations performed by
NoSQLHandle.system_request()
are asynchronous. When such an operation has been performed it is necessary to callNoSQLHandle.system_status()
until the status of the operation is known. The methodwait_for_completion()
exists to perform this task and should be used whenever possible.Asynchronous operations (e.g. create namespace) can be distinguished from synchronous system operations in this way:
Asynchronous operations may return a non-none operation id.
Asynchronous operations modify state, while synchronous operations are read-only.
Synchronous operations return a state of STATE.COMPLETE and have a non-none result string.
NoSQLHandle.system_status()
is synchronous, returning the known state of the operation. It should only be called if the operation was asynchronous and returned a non-none operation id.Methods Summary
get_operation_id
()Returns the operation id for the operation if it was asynchronous. get_operation_state
()Returns the operation state. get_result_string
()Returns the result string for the operation. get_statement
()Returns the statement used for the operation. wait_for_completion
(handle, wait_millis, …)Waits for the operation to be complete. Methods Documentation
-
get_operation_id
()[source]¶ Returns the operation id for the operation if it was asynchronous. This is None if the request did not generate a new operation and/or the operation state is SystemState.COMPLETE. The value can be used in
SystemStatusRequest.set_operation_id()
to get status and find potential errors resulting from the operation.This method is only useful for the result of asynchronous operations.
Returns: the operation id. Return type: str
-
get_result_string
()[source]¶ Returns the result string for the operation. This is None if the request was asynchronous or did not return an actual result. For example the “show” operations return a non-none result string, but “create, drop, grant, etc.” operations return a none result string.
Returns: the result string. Return type: str
-
get_statement
()[source]¶ Returns the statement used for the operation.
Returns: the statement. Return type: str
-
wait_for_completion
(handle, wait_millis, delay_millis)[source]¶ Waits for the operation to be complete. This is a blocking, polling style wait that delays for the specified number of milliseconds between each polling operation.
This instance is modified with any changes in state.
Parameters: - handle (NoSQLHandle) – the NoSQLHandle to use. This is required.
- wait_millis (int) – the total amount of time to wait, in milliseconds. This value must be non-zero and greater than delay_millis. This is required.
- delay_millis (int) – the amount of time to wait between polling attempts, in milliseconds. If 0 it will default to 500. This is required.
Raises: IllegalArgumentException – raises the exception if the operation times out or the parameters are not valid.
-