Method SetTableLimitsWithCompletionAsync
SetTableLimitsWithCompletionAsync(String, TableLimits, TableDDLOptions, CancellationToken)
Declaration
public Task<TableResult> SetTableLimitsWithCompletionAsync(string tableName, TableLimits tableLimits, TableDDLOptions options = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Name of the table. |
TableLimits | tableLimits | The new table limits. |
TableDDLOptions | options | (Optional) Options for the operation.
If not specified or null , appropriate defaults
will be used. This parameter should not be used to specify table
limits, use tableLimits parameter instead.
|
CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
Type | Description |
---|---|
Task<TableResult> | Task returning TableResult. |
Remarks
This method is equivalent to calling SetTableLimitsAsync(String, TableLimits, TableDDLOptions, CancellationToken) and then calling WaitForCompletionAsync(Nullable<TimeSpan>, Nullable<TimeSpan>, CancellationToken) on the returned TableResult object. If the operation is successful, the table state in the resulting TableResult object should be Active.
Note: this method is supported with the Cloud Service and Cloud Simulator but is not supported with on-premise NoSQL database (see KVStore), where it is a no-op.
For this operation, Timeout covers the total time interval including waiting for the DDL operation completion. If not specified, separate default timeouts are used for issuing the DDL operation and waiting for its completion, with values of TableDDLTimeout and TablePollTimeout correspondingly (the latter defaults to no timeout if TablePollTimeout is not set). Note that as with WaitForCompletionAsync(Nullable<TimeSpan>, Nullable<TimeSpan>, CancellationToken) you may specify poll delay as PollDelay which otherwise defaults to TablePollDelay.
Examples
Updating limits on a table. We can ignore the return value since the result would represent the final state of successful operation (or an exception will be thrown).try
{
await client.SetTableLimitsWithCompletionAsync(
"myTable",
new TableLimits(100, 100, 50));
Console.WriteLine("Table limits updated.");
}
catch(Exception e)
{
Console.WriteLine($"Got exception: {e.Message}");
}
Exceptions
Type | Condition |
---|---|
ArgumentException | If
tableName is null or invalid
or options contains invalid values. |
TimeoutException | Operation has timed out. |
InvalidOperationException | The table or the service is not in a valid state to perform this operation. |
NoSQLException | NoSQLException or one of its subclasses is thrown if operation cannot be performed for any other reason. See documentation for corresponding subclass of NoSQLException. |