TableResult¶
- class borneo.TableResult[source]¶
Bases:
ResultTableResult is returned from
NoSQLHandle.get_table()andNoSQLHandle.table_request()operations. It encapsulates the state of the table that is the target of the request.Operations available in
NoSQLHandle.table_request()such as table creation, modification, and drop are asynchronous operations. When such an operation has been performed, it is necessary to callNoSQLHandle.get_table()until the status of the table is State.ACTIVE, State.DROPPED or there is an error condition. The methodwait_for_completion()exists to perform this task and should be used to wait for an operation to complete.NoSQLHandle.get_table()is synchronous, returning static information about the table as well as its current state.Methods Summary
Returns compartment id of the target table.
Returns compartment id of the target table.
get_ddl()Returns the DDL (create table) statement used to create this table if available.
Returns defined tags
Returns free form tags
Returns the match etag
Returns the namespace of the table or null if it is not in a namespace.
Returns the operation id for an asynchronous operation.
Returns a list of
Replicaif the table is replicated, otherwise NoneReturns the schema for the table.
Returns the table state.
Returns the OCID of the table.
Returns the throughput and capacity limits for the table.
Returns the table name of the target table.
Returns True if the table is a replica and its initialization process has been completed, otherwise False
Returns True if the table is replicated
Returns True if the schema for this table is frozen.
wait_for_completion(handle, wait_millis, ...)Waits for a table operation to complete.
Methods Documentation
- get_compartment()[source]¶
Returns compartment id of the target table.
Cloud service only.
- Returns:
compartment id.
- Return type:
str
- get_compartment_id()[source]¶
Returns compartment id of the target table.
Cloud service only.
- Returns:
compartment id.
- Return type:
str
- get_ddl()[source]¶
Returns the DDL (create table) statement used to create this table if available. If the table has been altered since initial creation the statement is also altered to reflect the current table schema. This value, when non-null, is functionally equivalent to the schema returned by
set_schema(). table.- Returns:
the ddl statement used to create the table
- Return type:
str
- Versionadded::
5.4.0
- get_defined_tags()[source]¶
Returns defined tags
Cloud service only.
- Returns:
the tags
- Return type:
dict[str, dict[str, object]]
- Versionadded::
5.4.0
- get_free_form_tags()[source]¶
Returns free form tags
Cloud service only.
- Returns:
the tags
- Return type:
dict[str, str]
- Versionadded::
5.4.0
- get_match_etag()[source]¶
Returns the match etag
Cloud service only.
- Returns:
the tag
- Return type:
str
- Versionadded::
5.4.0
- get_namespace()[source]¶
Returns the namespace of the table or null if it is not in a namespace.
On-premises only.
- Returns:
namespace
- Return type:
str
- get_operation_id()[source]¶
Returns the operation id for an asynchronous operation. This is none if the request did not generate a new operation. The value can be used in
set_operation_id()to find potential errors resulting from the operation.- Returns:
the operation id for an asynchronous operation.
- Return type:
str
- get_replicas()[source]¶
Returns a list of
Replicaif the table is replicated, otherwise NoneCloud service only.
- Returns:
list of replicas or None
- Return type:
list[
Replica]- Versionadded::
5.4.2
- get_schema()[source]¶
Returns the schema for the table.
- Returns:
the schema for the table.
- Return type:
str
- get_state()[source]¶
Returns the table state. A table in state State.ACTIVE or State.UPDATING is usable for normal operation.
- Returns:
the state.
- Return type:
- get_table_id()[source]¶
Returns the OCID of the table. This value will be null if used with the on-premises service.
Cloud service only.
- Returns:
the table OCID
- Return type:
str
- Versionadded::
5.4.0
- get_table_limits()[source]¶
Returns the throughput and capacity limits for the table. Limits from an on-premises service will always be None.
- Returns:
the limits.
- Return type:
- get_table_name()[source]¶
Returns the table name of the target table.
- Returns:
the table name.
- Return type:
str
- is_local_replica_initialized()[source]¶
Returns True if the table is a replica and its initialization process has been completed, otherwise False
Cloud service only.
- Returns:
True if is an initialized replica
- Return type:
bool
- Versionadded::
5.4.2
- is_replicated()[source]¶
Returns True if the table is replicated
Cloud service only.
- Returns:
True if table is replicated
- Return type:
bool
- Versionadded::
5.4.2
- is_schema_frozen()[source]¶
Returns True if the schema for this table is frozen.
Cloud service only.
- Returns:
frozen state
- Return type:
bool
- Versionadded::
5.4.2
- wait_for_completion(handle, wait_millis, delay_millis)[source]¶
Waits for a table operation to complete. Table operations are asynchronous. This is a blocking, polling style wait that delays for the specified number of milliseconds between each polling operation. This call returns when the table reaches a terminal state, which is either State.ACTIVE or State.DROPPED.
This instance must be the return value of a previous
NoSQLHandle.table_request()and contain a non-none operation id representing the in-progress operation unless the operation has already completed.This instance is modified with any change in table state or metadata.
- Parameters:
handle (NoSQLHandle) – the NoSQLHandle to use.
wait_millis (int) – the total amount of time to wait, in milliseconds. This value must be non-zero and greater than delay_millis.
delay_millis (int) – the amount of time to wait between polling attempts, in milliseconds. If 0 it will default to 500.
- Raises:
IllegalArgumentException – raises the exception if the parameters are not valid.
RequestTimeoutException – raises the exception if the operation times out.