Class TableLimits
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."
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionTableLimits
(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 TypeMethodDescriptiongetMode()
Returns the capacity modeint
Returns the read throughput in terms of read unitsint
Returns the storage capacity in gigabytesint
Returns the write throughput in terms of write unitssetReadUnits
(int readUnits) Sets the read throughput in terms of read units.setStorageGB
(int storageGB) Sets the storage capacity in gigabytes.setWriteUnits
(int writeUnits) Sets the write throughput in terms of write units.toString()
-
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. SeeConsistency
.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
Returns the capacity mode- Returns:
- capacity mode
- Since:
- 5.3.0
-
setReadUnits
Sets the read throughput in terms of read units.- Parameters:
readUnits
- the throughput to use, in read units- Returns:
- this
-
setWriteUnits
Sets the write throughput in terms of write units.- Parameters:
writeUnits
- the throughput to use, in write units- Returns:
- this
-
setStorageGB
Sets the storage capacity in gigabytes.- Parameters:
storageGB
- the capacity to use, in gigabytes- Returns:
- this
-
toString
-