Class AddReplicaRequest

java.lang.Object
oracle.nosql.driver.ops.Request
oracle.nosql.driver.ops.AddReplicaRequest

public class AddReplicaRequest extends Request
Cloud service only. AddReplicaRequest is used to add new replica (region) to a table.
Since:
5.4.13
  • Constructor Details

    • AddReplicaRequest

      public AddReplicaRequest()
  • Method Details

    • setTableName

      public AddReplicaRequest setTableName(String tableName)
      Sets the table name to replicate
      Parameters:
      tableName - the name
      Returns:
      this
    • setReplicaName

      public AddReplicaRequest setReplicaName(String replicaName)
      Sets the replica name (region) to be added
      Parameters:
      replicaName - the name of the replica
      Returns:
      this
    • getReplicaName

      public String getReplicaName()
      Returns the replica name. This is the region name
      Returns:
      the replica name
    • setReadUnits

      public AddReplicaRequest setReadUnits(int readUnits)
      Sets the read units for the replica table. This defaults to the units on the existing table
      Parameters:
      readUnits - the read units
      Returns:
      this
    • getReadUnits

      public int getReadUnits()
      Returns the read units set for the replica table or 0 if not set
      Returns:
      the read units
    • setWriteUnits

      public AddReplicaRequest setWriteUnits(int writeUnits)
      Sets the write units for the replica table. This defaults to the units on the existing table
      Parameters:
      writeUnits - the write units
      Returns:
      this
    • getWriteUnits

      public int getWriteUnits()
      Returns the write units set for the replica table or 0 if not set
      Returns:
      the write units
    • setMatchEtag

      public AddReplicaRequest setMatchEtag(String etag)
      Sets an ETag in the request that must be matched for the operation to proceed. The ETag must be non-null and have been returned in a previous TableResult. This is a form of optimistic concurrency control allowing an application to ensure no unexpected modifications have been made to the table.
      Parameters:
      etag - the ETag
      Returns:
      this
      Since:
      5.4.15
    • getMatchETag

      public String getMatchETag()
      Returns the matchEtag, or null if not set
      Returns:
      the ETag
      Since:
      5.4.15
    • setCompartment

      public AddReplicaRequest setCompartment(String compartment)

      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
    • setTimeout

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

      public AddReplicaRequest setDefaults(NoSQLHandleConfig config)
    • validate

      public void validate()
    • createSerializer

      public oracle.nosql.driver.ops.serde.Serializer createSerializer(oracle.nosql.driver.ops.serde.SerializerFactory factory)
    • createDeserializer

      public oracle.nosql.driver.ops.serde.Serializer createDeserializer(oracle.nosql.driver.ops.serde.SerializerFactory factory)
    • 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