Class MultiDeleteRequest
NoSQLHandle.multiDelete(oracle.nosql.driver.ops.MultiDeleteRequest)
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 setKey(oracle.nosql.driver.values.MapValue)
and providing a range
of timestamp values in the FieldRange
used in setRange(oracle.nosql.driver.FieldRange)
.
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.getContinuationKey()
and set in a new request using
setContinuationKey(byte[])
. Operations with a continuation
key still require the primary key.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Returns the continuation key if set.getKey()
Returns the key to be used for the operation.int
Returns the limit on the total KB write during this operation.getRange()
Returns theFieldRange
to be used for the operation if set.Returns the type name of the request.setCompartment
(String compartment) Cloud service only.setContinuationKey
(byte[] continuationKey) Sets the continuation key.setDurability
(Durability durability) Sets the durability to use for the operation.Sets the key to be used for the operation.setMaxWriteKB
(int maxWriteKB) Sets the limit on the total KB write during this operation, 0 means no application-defined limit.setNamespace
(String namespace) Sets the optional namespace.setRange
(FieldRange range) Sets theFieldRange
to be used for the operation.setTableName
(String tableName) Sets the table name to use for the operation.setTimeout
(int timeoutMs) Sets the request timeout value, in milliseconds.Methods inherited from class oracle.nosql.driver.ops.DurableRequest
getDurability
Methods inherited from class oracle.nosql.driver.ops.Request
getCompartment, getNamespace, getRateLimitDelayedMs, getReadRateLimiter, getRetryStats, getTableName, getWriteRateLimiter, setReadRateLimiter, setWriteRateLimiter
-
Constructor Details
-
MultiDeleteRequest
public MultiDeleteRequest()
-
-
Method Details
-
setCompartment
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
SignatureProvider.createWithInstancePrincipal()
- Parameters:
compartment
- the name or id. If using a nested compartment, specify the full compartment pathcompartmentA.compartmentB
, but exclude the name of the root compartment (tenant).- Returns:
- this
-
setTableName
Sets the table name to use for the operation. This is a required parameter.- Parameters:
tableName
- the table name- Returns:
- this
-
getKey
Returns the key to be used for the operation.- Returns:
- the key
-
setKey
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
- the key- Returns:
- this
-
getRange
Returns theFieldRange
to be used for the operation if set.- Returns:
- the range, null if no range is to be used
-
setRange
Sets theFieldRange
to be used for the operation. This parameter is optional, but required to delete a specific range of rows.- Parameters:
range
- the range- Returns:
- this
-
getMaxWriteKB
public int getMaxWriteKB()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
-
setMaxWriteKB
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:
maxWriteKB
- the limit in terms of number of KB write during this operation.- Returns:
- this
- Throws:
IllegalArgumentException
- if the maxWriteKB value is less than 0.
-
getContinuationKey
public byte[] getContinuationKey()Returns the continuation key if set.- Returns:
- the continuation key
-
setContinuationKey
Sets the continuation key.- Parameters:
continuationKey
- the key which should have been obtained fromMultiDeleteResult.getContinuationKey()
- Returns:
- this;
-
setTimeout
Sets the request timeout value, in milliseconds. This overrides any default value set withNoSQLHandleConfig.setRequestTimeout(int)
. The value must be positive.- Parameters:
timeoutMs
- the timeout value, in milliseconds- Returns:
- this
- Throws:
IllegalArgumentException
- if the timeout value is less than or equal to 0
-
setDurability
Sets the durability to use for the operation. On-premises only.- Parameters:
durability
- the durability value. Set to null for the default durability setting on the kvstore server.- Returns:
- this
- Since:
- 5.3.0
-
setNamespace
Sets the optional namespace. On-premises only. This overrides any default value set withNoSQLHandleConfig.setDefaultNamespace(java.lang.String)
. Note: if a namespace is specified in the table name for the request (using the namespace:tablename format), that value will override this setting.- Parameters:
namespace
- the namespace to use for the operation- Returns:
- this
- Since:
- 5.4.10
-
getTypeName
Description copied from class:Request
Returns the type name of the request. This is used for stats.- Specified by:
getTypeName
in classRequest
- Returns:
- the type name of the request
-