MultiDeleteRequest¶
- class borneo.MultiDeleteRequest[source]¶
Bases:
Request
Represents the input to a
NoSQLHandle.multi_delete()
operation which can be used to delete a range of values that match the primary key and range provided.A range is specified using a partial key plus a range based on the portion of the key that is not provided. For example if a table’s primary key is <id, timestamp>; and the its shard key is the id, it is possible to delete a range of timestamp values for a specific id by providing an id but no timestamp in the value used for
set_key()
and providing a range of timestamp values in theFieldRange
used inset_range()
.Because this operation can exceed the maximum amount of data modified in a single operation a continuation key can be used to continue the operation. The continuation key is obtained from
MultiDeleteResult.get_continuation_key()
and set in a new request usingset_continuation_key()
. Operations with a continuation key still require the primary key.The table name and key are required parameters.
Methods Summary
Cloud service only.
Returns the continuation key if set.
On-premise only.
get_key
()Returns the key to be used for the operation.
Returns the limit on the total KB write during this operation.
Returns the
FieldRange
to be used for the operation if set.Returns the table name to use for the operation.
Returns the timeout to use for the operation, in milliseconds.
set_compartment
(compartment)Cloud service only.
set_continuation_key
(continuation_key)Sets the continuation key.
set_durability
(durability)On-premise only.
set_key
(key)Sets the key to be used for the operation.
set_max_write_kb
(max_write_kb)Sets the limit on the total KB write during this operation, 0 means no application-defined limit.
set_range
(field_range)Sets the
FieldRange
to be used for the operation.set_table_name
(table_name)Sets the table name to use for the operation.
set_timeout
(timeout_ms)Sets the request timeout value, in milliseconds.
Methods Documentation
- get_compartment()¶
Cloud service only.
Get the compartment id or name if set for the request.
- Returns:
compartment id or name if set for the request, otherwise None if not set.
- Return type:
str
- get_continuation_key()[source]¶
Returns the continuation key if set.
- Returns:
the continuation key.
- Return type:
bytearray
- get_durability()[source]¶
On-premise only. Gets the durability to use for the operation or None if not set :returns: the Durability :versionadded: 5.3.0
- get_key()[source]¶
Returns the key to be used for the operation.
- Returns:
the key.
- Return type:
dict
- get_max_write_kb()[source]¶
Returns the limit on the total KB write during this operation. If not set by the application this value will be 0 which means the default system limit is used.
- Returns:
the limit, or 0 if not set.
- Return type:
int
- get_range()[source]¶
Returns the
FieldRange
to be used for the operation if set.- Returns:
the range, None if no range is to be used.
- Return type:
- get_table_name()¶
Returns the table name to use for the operation.
- Returns:
the table name, or None if not set.
- Returns:
str
- get_timeout()[source]¶
Returns the timeout to use for the operation, in milliseconds. A value of 0 indicates that the timeout has not been set.
- Returns:
the timeout value.
- Return type:
int
- set_compartment(compartment)[source]¶
Cloud service only.
Sets the name or id of a compartment to be used for this operation.
The compartment may be specified as either a name (or path for nested compartments) or as an id (OCID). A name (vs id) can only be used when authenticated using a specific user identity. It is not available if authenticated as an Instance Principal which can be done when calling the service from a compute instance in the Oracle Cloud Infrastructure. See
borneo.iam.SignatureProvider.create_with_instance_principal()
.- Parameters:
compartment (str) – the compartment name or id. If using a nested compartment, specify the full compartment path compartmentA.compartmentB, but exclude the name of the root compartment (tenant).
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if compartment is not a str.
- set_continuation_key(continuation_key)[source]¶
Sets the continuation key.
- Parameters:
continuation_key (bytearray) – the key which should have been obtained from
MultiDeleteResult.get_continuation_key()
.- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if continuation_key is not a bytearray.
- set_durability(durability)[source]¶
On-premise only. Sets the durability to use for the operation.
- Parameters:
durability (Durability) – the Durability to use
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if Durability is not valid
- Versionadded:
5.3.0
- set_key(key)[source]¶
Sets the key to be used for the operation. This is a required parameter and must completely specify the target table’s shard key.
- Parameters:
key (dict) – the key.
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if key is not a dictionary.
- set_max_write_kb(max_write_kb)[source]¶
Sets the limit on the total KB write during this operation, 0 means no application-defined limit. This value can only reduce the system defined limit.
- Parameters:
max_write_kb (int) – the limit in terms of number of KB write during this operation.
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if the max_write_kb value is less than 0.
- set_range(field_range)[source]¶
Sets the
FieldRange
to be used for the operation. This parameter is optional, but required to delete a specific range of rows.- Parameters:
field_range (FieldRange) – the field range.
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if field_range is not an instance of FieldRange.
- set_table_name(table_name)[source]¶
Sets the table name to use for the operation. This is a required parameter.
- Parameters:
table_name (str) – the table name.
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if table_name is not a string.
- set_timeout(timeout_ms)[source]¶
Sets the request timeout value, in milliseconds. This overrides any default value set in
NoSQLHandleConfig
. The value must be positive.- Parameters:
timeout_ms (int) – the timeout value, in milliseconds.
- Returns:
self.
- Raises:
IllegalArgumentException – raises the exception if the timeout value is less than or equal to 0.