Package oracle.nosql.driver.ops

# Class TableLimits

java.lang.Object
oracle.nosql.driver.ops.TableLimits

public class TableLimits extends Object
Cloud service only.

A TableLimits instance is used during table creation to specify the throughput and capacity to be consumed by the table. It is also used in an operation to change the limits of an existing table. `NoSQLHandle.tableRequest(oracle.nosql.driver.ops.TableRequest)` and `TableRequest` are used to perform these operations. These values are enforced by the system and used for billing purposes.

Throughput limits are defined in terms of read units and write units. A read unit represents 1 eventually consistent read per second for data up to 1 KB in size. A read that is absolutely consistent is double that, consuming 2 read units for a read of up to 1 KB in size. This means that if an application is to use `Consistency.ABSOLUTE` it may need to specify additional read units when creating a table. A write unit represents 1 write per second of data up to 1 KB in size.

In addition to throughput table capacity must be specified to indicate the maximum amount of storage, in gigabytes, allowed for the table.

All 3 values must be used whenever using this object. There are no defaults and no mechanism to indicate "no change."

See Also:
  - `NoSQLHandle.tableRequest(oracle.nosql.driver.ops.TableRequest)`

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `TableLimits.CapacityMode`
  Table limits option

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TableLimits(int storageGB)`
  Constructs a TableLimits instance for on demand capacity table.
  `TableLimits(int readUnits, int writeUnits, int storageGB)`
  Constructs a TableLimits instance for provisioned capacity table.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TableLimits.CapacityMode`
  `getMode()`
  Returns the capacity mode
  `int`
  `getReadUnits()`
  Returns the read throughput in terms of read units
  `int`
  `getStorageGB()`
  Returns the storage capacity in gigabytes
  `int`
  `getWriteUnits()`
  Returns the write throughput in terms of write units
  `TableLimits`
  `setReadUnits(int readUnits)`
  Sets the read throughput in terms of read units.
  `TableLimits`
  `setStorageGB(int storageGB)`
  Sets the storage capacity in gigabytes.
  `TableLimits`
  `setWriteUnits(int writeUnits)`
  Sets the write throughput in terms of write units.
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### TableLimits

    public TableLimits(int readUnits, int writeUnits, int storageGB)
    Constructs a TableLimits instance for provisioned capacity table.
    Parameters:
      `readUnits` - the desired throughput of read operation in terms of read units. A read unit represents 1 eventually consistent read per second for data up to 1 KB in size. A read that is absolutely consistent is double that, consuming 2 read units for a read of up to 1 KB in size. See `Consistency`.
      `writeUnits` - the desired throughput of write operation in terms of write units. A write unit represents 1 write per second of data up to 1 KB in size.
      `storageGB` - the maximum storage to be consumed by the table, in gigabytes

  - ### TableLimits

    public TableLimits(int storageGB)
    Constructs a TableLimits instance for on demand capacity table.
    Parameters:
      `storageGB` - the maximum storage to be consumed by the table, in gigabytes
    Since:
      5.3.0

- ## Method Details

  - ### getReadUnits

    public int getReadUnits()
    Returns the read throughput in terms of read units
    Returns:
      read units

  - ### getWriteUnits

    public int getWriteUnits()
    Returns the write throughput in terms of write units
    Returns:
      write units

  - ### getStorageGB

    public int getStorageGB()
    Returns the storage capacity in gigabytes
    Returns:
      provisioned storage size in GB

  - ### getMode

    public TableLimits.CapacityMode getMode()
    Returns the capacity mode
    Returns:
      capacity mode
    Since:
      5.3.0

  - ### setReadUnits

    public TableLimits setReadUnits(int readUnits)
    Sets the read throughput in terms of read units.
    Parameters:
      `readUnits` - the throughput to use, in read units
    Returns:
      this

  - ### setWriteUnits

    public TableLimits setWriteUnits(int writeUnits)
    Sets the write throughput in terms of write units.
    Parameters:
      `writeUnits` - the throughput to use, in write units
    Returns:
      this

  - ### setStorageGB

    public TableLimits setStorageGB(int storageGB)
    Sets the storage capacity in gigabytes.
    Parameters:
      `storageGB` - the capacity to use, in gigabytes
    Returns:
      this

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`