Package oracle.nosql.driver.ops

# Class MultiDeleteRequest

java.lang.Object
oracle.nosql.driver.ops.Request
oracle.nosql.driver.ops.DurableRequest
oracle.nosql.driver.ops.MultiDeleteRequest

public class MultiDeleteRequest extends DurableRequest
Represents the input to a `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.

See Also:
  - `NoSQLHandle.multiDelete(oracle.nosql.driver.ops.MultiDeleteRequest)`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MultiDeleteRequest()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `byte[]`
  `getContinuationKey()`
  Returns the continuation key if set.
  `MapValue`
  `getKey()`
  Returns the key to be used for the operation.
  `int`
  `getMaxWriteKB()`
  Returns the limit on the total KB write during this operation.
  `FieldRange`
  `getRange()`
  Returns the `FieldRange` to be used for the operation if set.
  `String`
  `getTypeName()`
  Returns the type name of the request.
  `MultiDeleteRequest`
  `setCompartment(String compartment)`
  Cloud service only.
  `MultiDeleteRequest`
  `setContinuationKey(byte[] continuationKey)`
  Sets the continuation key.
  `MultiDeleteRequest`
  `setDurability(Durability durability)`
  Sets the durability to use for the operation.
  `MultiDeleteRequest`
  `setKey(MapValue key)`
  Sets the key to be used for the operation.
  `MultiDeleteRequest`
  `setMaxWriteKB(int maxWriteKB)`
  Sets the limit on the total KB write during this operation, 0 means no application-defined limit.
  `MultiDeleteRequest`
  `setNamespace(String namespace)`
  Sets the optional namespace.
  `MultiDeleteRequest`
  `setRange(FieldRange range)`
  Sets the `FieldRange` to be used for the operation.
  `MultiDeleteRequest`
  `setTableName(String tableName)`
  Sets the table name to use for the operation.
  `MultiDeleteRequest`
  `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`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### MultiDeleteRequest

    public MultiDeleteRequest()

- ## Method Details

  - ### setCompartment

    public MultiDeleteRequest setCompartment(String compartment)
    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 path `compartmentA.compartmentB`, but exclude the name of the root compartment (tenant).
    Returns:
      this

  - ### setTableName

    public MultiDeleteRequest setTableName(String tableName)
    Sets the table name to use for the operation. This is a required parameter.
    Parameters:
      `tableName` - the table name
    Returns:
      this

  - ### getKey

    public MapValue getKey()
    Returns the key to be used for the operation.
    Returns:
      the key

  - ### setKey

    public MultiDeleteRequest setKey(MapValue key)
    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

    public FieldRange getRange()
    Returns the `FieldRange` to be used for the operation if set.
    Returns:
      the range, null if no range is to be used

  - ### setRange

    public MultiDeleteRequest setRange(FieldRange range)
    Sets the `FieldRange` 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

    public MultiDeleteRequest setMaxWriteKB(int maxWriteKB)
    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

    public MultiDeleteRequest setContinuationKey(byte[] continuationKey)
    Sets the continuation key.
    Parameters:
      `continuationKey` - the key which should have been obtained from `MultiDeleteResult.getContinuationKey()`
    Returns:
      this;

  - ### setTimeout

    public MultiDeleteRequest setTimeout(int timeoutMs)
    Sets the request timeout value, in milliseconds. This overrides any default value set with `NoSQLHandleConfig.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

    public MultiDeleteRequest setDurability(Durability durability)
    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

    public MultiDeleteRequest setNamespace(String namespace)
    Sets the optional namespace. On-premises only. This overrides any default value set with `NoSQLHandleConfig.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

    public String getTypeName()
    Description copied from class: `Request`
    Returns the type name of the request. This is used for stats.
    Specified by:
      `getTypeName` in class `Request`
    Returns:
      the type name of the request