Package oracle.nosql.driver.ops
Class TableResult
- java.lang.Object
-
- oracle.nosql.driver.ops.Result
-
- oracle.nosql.driver.ops.TableResult
-
public class TableResult extends Result
TableResult is returned fromNoSQLHandle.getTable(oracle.nosql.driver.ops.GetTableRequest)
andNoSQLHandle.tableRequest(oracle.nosql.driver.ops.TableRequest)
operations. It encapsulates the state of the table that is the target of the request.Operations available in
NoSQLHandle.tableRequest(oracle.nosql.driver.ops.TableRequest)
such as table creation, modification, and drop are asynchronous operations. When such an operation has been performend it is necessary to callNoSQLHandle.getTable(oracle.nosql.driver.ops.GetTableRequest)
until the status of the table isTableResult.State.ACTIVE
or there is an error condition. The methodwaitForCompletion(oracle.nosql.driver.NoSQLHandle, int, int)
exists to perform this task and should be used to wait for an operation to complete.NoSQLHandle.getTable(oracle.nosql.driver.ops.GetTableRequest)
is synchronous, returning static information about the table as well as its current state.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TableResult.State
The current state of the table
-
Constructor Summary
Constructors Constructor Description TableResult()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getCompartmentId()
Cloud service only.String
getOperationId()
Returns the operation id for an asynchronous operation.String
getSchema()
TableLimits
getTableLimits()
Returns the throughput and capacity limits for the table.String
getTableName()
Returns the table name of the target tableTableResult.State
getTableState()
Returns the table state.String
toString()
void
waitForCompletion(NoSQLHandle handle, int waitMillis, int delayMillis)
Waits for a table operation to complete.static TableResult
waitForState(NoSQLHandle handle, String tableName, String operationId, TableResult.State state, int waitMillis, int delayMillis)
Deprecated.static TableResult
waitForState(NoSQLHandle handle, String tableName, TableResult.State state, int waitMillis, int delayMillis)
Deprecated.static TableResult
waitForState(NoSQLHandle handle, TableResult result, TableResult.State state, int waitMillis, int delayMillis)
Deprecated.-
Methods inherited from class oracle.nosql.driver.ops.Result
getRateLimitDelayedMs, getRetryStats
-
-
-
-
Method Detail
-
getTableState
public TableResult.State getTableState()
Returns the table state. A table in stateTableResult.State.ACTIVE
orTableResult.State.UPDATING
is usable for normal operation.- Returns:
- the state
-
getCompartmentId
public String getCompartmentId()
Cloud service only.Returns compartment id of the target table
- Returns:
- the domain
-
getTableName
public String getTableName()
Returns the table name of the target table- Returns:
- the table name
-
getSchema
public String getSchema()
-
getTableLimits
public TableLimits getTableLimits()
Returns the throughput and capacity limits for the table. Limits from an on-premise service will always be null.- Returns:
- the limits
-
getOperationId
public String getOperationId()
Returns the operation id for an asynchronous operation. This is null if the request did not generate a new operation. The value can be used inGetTableRequest.setOperationId(java.lang.String)
to find potential errors resulting from the operation.- Returns:
- the operation id, or null if not set
-
waitForState
@Deprecated public static TableResult waitForState(NoSQLHandle handle, TableResult result, TableResult.State state, int waitMillis, int delayMillis)
Deprecated.usewaitForCompletion(oracle.nosql.driver.NoSQLHandle, int, int)
instead. Waits for the specified table to reach the desired state. This is a blocking, polling style wait that delays for the specified number of milliseconds between each polling operation. The state ofTableResult.State.DROPPED
is treated specially in that it will be returned as success, even if the table does not exist. Other states will throw an exception if the table is not found.- Parameters:
handle
- the NoSQLHandle to useresult
- a previously received TableResultstate
- the desired statewaitMillis
- the total amount of time to wait, in millseconds. This value must be non-zero and greater than delayMillisdelayMillis
- the amount of time to wait between polling attempts, in milliseconds. If 0 it will default to 500.- Returns:
- the TableResult representing the table at the desired state
- Throws:
IllegalArgumentException
- if the parameters are not valid.RequestTimeoutException
- if the operation times out.NoSQLException
- if the operation id used is not null that the operation has failed for some reason.
-
waitForState
@Deprecated public static TableResult waitForState(NoSQLHandle handle, String tableName, TableResult.State state, int waitMillis, int delayMillis)
Deprecated.usewaitForCompletion(oracle.nosql.driver.NoSQLHandle, int, int)
instead. Waits for the specified table to reach the desired state. This is a blocking, polling style wait that delays for the specified number of milliseconds between each polling operation. The state ofTableResult.State.DROPPED
is treated specially in that it will be returned as success, even if the table does not exist. Other states will throw an exception if the table is not found.- Parameters:
handle
- the NoSQLHandle to usetableName
- the table namestate
- the desired statewaitMillis
- the total amount of time to wait, in millseconds. This value must be non-zero and greater than delayMillisdelayMillis
- the amount of time to wait between polling attempts, in milliseconds. If 0 it will default to 500.- Returns:
- the TableResult representing the table at the desired state
- Throws:
IllegalArgumentException
- if the parameters are not valid.RequestTimeoutException
- if the operation times out.
-
waitForState
@Deprecated public static TableResult waitForState(NoSQLHandle handle, String tableName, String operationId, TableResult.State state, int waitMillis, int delayMillis)
Deprecated.usewaitForCompletion(oracle.nosql.driver.NoSQLHandle, int, int)
instead. Waits for the specified table to reach the desired state. This is a blocking, polling style wait that delays for the specified number of milliseconds between each polling operation. The state ofTableResult.State.DROPPED
is treated specially in that it will be returned as success, even if the table does not exist. Other states will throw an exception if the table is not found.- Parameters:
handle
- the NoSQLHandle to usetableName
- the table nameoperationId
- optional operation idstate
- the desired statewaitMillis
- the total amount of time to wait, in millseconds. This value must be non-zero and greater than delayMillisdelayMillis
- the amount of time to wait between polling attempts, in milliseconds. If 0 it will default to 500.- Returns:
- the TableResult representing the table at the desired state
- Throws:
IllegalArgumentException
- if the parameters are not valid.RequestTimeoutException
- if the operation times out.
-
waitForCompletion
public void waitForCompletion(NoSQLHandle handle, int waitMillis, int delayMillis)
Waits for a table operation to complete. Table operations are asynchronous. This is a blocking, polling style wait that delays for the specified number of milliseconds between each polling operation. This call returns when the table reaches a terminal state, which is eitherTableResult.State.ACTIVE
orTableResult.State.DROPPED
. This instance must be the return value of a previousNoSQLHandle.tableRequest(oracle.nosql.driver.ops.TableRequest)
and contain a non-null operation id representing the in-progress operation unless the operation has already completed. This instance is modified with any change in table state or metadata.- Parameters:
handle
- the NoSQLHandle to usewaitMillis
- the total amount of time to wait, in millseconds. This value must be non-zero and greater than delayMillisdelayMillis
- the amount of time to wait between polling attempts, in milliseconds. If 0 it will default to 500.- Throws:
IllegalArgumentException
- if the parameters are not valid.RequestTimeoutException
- if the operation times out.
-
-