Class TableRequest
TableLimits
object to define the throughput desired for the
table. If TableLimits is provided with any other type of query statement an
exception is thrown.
This request is also used to modify the limits of throughput and storage for an existing table. This case is handled by specifying a table name and limits without a query statement. If all three are specified it is an error.
This request is also used to modify tags associated with an existing table. This use is mutually exclusive with respect to changing a table schema or its limits. To modify tags specify only tags and the table name without a statement.
Execution of operations specified by this request is implicitly asynchronous.
These are potentially long-running operations.
NoSQLHandle.tableRequest(oracle.nosql.driver.ops.TableRequest)
returns a TableResult
instance that
can be used to poll until the table reaches the desired state.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCloud service only.Cloud service only.Cloud service only.Returns the statement, or null if not setReturns the table limits, or null if not setReturns the type name of the request.setCompartment
(String compartment) Cloud service only.setDefaults
(NoSQLHandleConfig config) setDefinedTags
(DefinedTags definedTags) Cloud service only.setFreeFormTags
(FreeFormTags freeFormTags) Cloud service only.setMatchEtag
(String etag) Cloud service only.setNamespace
(String namespace) Sets the optional namespace.setStatement
(String statement) Sets the query statement to use for the operation.setTableLimits
(TableLimits tableLimits) Cloud service only.setTableName
(String tableName) Sets the table name to use for the operation.setTimeout
(int timeoutMs) Sets the request timeout value, in milliseconds.toString()
void
validate()
Methods inherited from class oracle.nosql.driver.ops.Request
getCompartment, getNamespace, getRateLimitDelayedMs, getReadRateLimiter, getRetryStats, getTableName, getWriteRateLimiter, setReadRateLimiter, setWriteRateLimiter
-
Constructor Details
-
TableRequest
public TableRequest()
-
-
Method Details
-
setCompartment
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 pathcompartmentA.compartmentB
, but exclude the name of the root compartment (tenant).- Returns:
- this
-
getStatement
Returns the statement, or null if not set- Returns:
- the statement
-
getTableLimits
Returns the table limits, or null if not set- Returns:
- the limits
-
getDefinedTags
Cloud service only. Returns theDefinedTags
, or null if not set- Returns:
- the tags
- Since:
- 5.4
-
getFreeFormTags
Cloud service only. Returns theFreeFormTags
, or null if not set- Returns:
- the tags
- Since:
- 5.4
-
getMatchETag
Cloud service only. Returns the matchEtag, or null if not set- Returns:
- the ETag
- Since:
- 5.4
-
setStatement
Sets the query statement to use for the operation. This parameter is required unless the operation is intended to change the limits of an existing table.- Parameters:
statement
- the statement- Returns:
- this
-
setTableName
Sets the table name to use for the operation. The table name is only used to modify the limits of an existing table, and must not be set for any other operation.- Parameters:
tableName
- the name- Returns:
- this
-
setTableLimits
Cloud service only.Sets the table limits to use for the operation. Limits are used in only 2 cases -- table creation statements and limits modification operations. It is not used for other DDL operations.
If limits are set for an on-premises service they are silently ignored.
- Parameters:
tableLimits
- the limits- Returns:
- this
-
setDefinedTags
Cloud service only.Sets the
DefinedTags
to use for the operation. DefinedTags are used in only 2 cases -- table creation statements and tag modification operations. It is not used for other DDL operations.If tags are set for an on-premises service they are silently ignored.
- Parameters:
definedTags
- the tags- Returns:
- this
- Since:
- 5.4
-
setFreeFormTags
Cloud service only.Sets the
FreeFormTags
to use for the operation. FreeFormTags are used in only 2 cases -- table creation statements and tag modification operations. It is not used for other DDL operations.If tags are set for an on-premises service they are silently ignored.
- Parameters:
freeFormTags
- the tags- Returns:
- this
- Since:
- 5.4
-
setMatchEtag
Cloud service only.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.If set for an on-premises service the ETag is silently ignored.
- Parameters:
etag
- the ETag- Returns:
- this
- Since:
- 5.4
-
setTimeout
Sets the request timeout value, in milliseconds. This overrides any default value set withNoSQLHandleConfig.setTableRequestTimeout(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
-
setNamespace
Sets the optional namespace. On-premises only. This overrides any default value set withNoSQLHandleConfig.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
-
setDefaults
-
validate
public void validate() -
getTypeName
Description copied from class:Request
Returns the type name of the request. This is used for stats.- Specified by:
getTypeName
in classRequest
- Returns:
- the type name of the request
-
toString
-