Class 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 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:
  • 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
    • setRowMetadata

      public MultiDeleteRequest setRowMetadata(String rowMetadata)
      This method is **EXPERIMENTAL** and its behavior, signature, or even its existence may change without prior notice in future versions. Use with caution.

      Sets the row metadata to use for this request. This is an optional parameter.

      Row metadata is associated to a certain version of a row. Any subsequent write operation will use its own row metadata value. If not specified null will be used by default. NOTE that if you have previously written a record with metadata and a subsequent write does not supply metadata, the metadata associated with the row will be null. Therefore, if you wish to have metadata associated with every write operation, you must supply a valid JSON construct to this method.

      Parameters:
      rowMetadata - the row metadata, must be null or a valid JSON construct: object, array, string, number, true, false or null, otherwise an IllegalArgumentException is thrown.
      Returns:
      this
      Throws:
      IllegalArgumentException - if rowMetadata not null and invalid JSON construct
      Since:
      5.4.18
    • getRowMetadata

      public String getRowMetadata()
      Returns the row metadata set for this request, or null if not set.
      Returns:
      the row metadata
      Since:
      5.4.18
    • 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