Class TableLimits
Namespace: Oracle.NoSQL.SDK
Assembly: Oracle.NoSQL.SDK.dll
Syntax
public class TableLimits : Object
Remarks
These operations are performed by ExecuteTableDDLAsync, ExecuteTableDDLWithCompletionAsync, SetTableLimitsAsync(String, TableLimits, TableDDLOptions, CancellationToken) and SetTableLimitsWithCompletionAsync(String, TableLimits, TableDDLOptions, CancellationToken) methods. The values provided are enforced by the system and are 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 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.
The way to initialize TableLimits instance depends on the chosen CapacityMode of the table:
In Provisioned mode, all 3 values for throughput and storage limits must be specified. There are no defaults and no mechanism to indicate "no change".
In OnDemand mode, only storage limit must be specified.
You may also pass TableLimits to SetTableLimitsAsync(String, TableLimits, TableDDLOptions, CancellationToken) or SetTableLimitsWithCompletionAsync(String, TableLimits, TableDDLOptions, CancellationToken) APIs to change CapacityMode of the existing table, that is to switch the table from Provisioned to On Demand or vice versa.
TableLimits are also returned as part of TableResult from operations listed above as well as GetTableAsync and WaitForCompletionAsync(Nullable<TimeSpan>, Nullable<TimeSpan>, CancellationToken). For returned TableLimits, when using with Cloud Service, ReadUnits and WriteUnits will be available for both Provisioned and OnDemand tables. For OnDemand tables, these values will indicate the maximum limits set by the service for on-demand tables. Note that these values are not available for on-demand tables when using Cloud Simulator (see CloudSim).
var result = await client.ExecuteTableDDLWithCompletionAsync(
"CREATE TABLE table1(id INTEGER, name STRING, PRIMARY KEY(id))",
new TableLimits(100, 200, 100));
var result = await client.ExecuteTableDDLWithCompletionAsync(
"CREATE TABLE table1(id INTEGER, name STRING, PRIMARY KEY(id))",
new TableLimits(100));
Constructors
Name | Description |
---|---|
TableLimits(Int32) | Initializes a new instance of the TableLimits class with OnDemand capacity mode. |
TableLimits(Int32, Int32, Int32) | Initializes a new instance of the TableLimits class with Provisioned capacity mode. |
Properties
Name | Description |
---|---|
CapacityMode | Gets table capacity mode. |
ReadUnits | Gets read units. |
StorageGB | Gets maximum storage capacity in GB. |
WriteUnits | Gets write units. |