Method AddReplicaAsync
AddReplicaAsync(String, Region, AddReplicaOptions, CancellationToken)
Declaration
public Task<TableResult> AddReplicaAsync(string tableName, Region region, AddReplicaOptions options = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Name of the table. |
Region | region | Region where to add the replica. |
AddReplicaOptions | options | (Optional) Options for the operation. If not
specified or null , appropriate defaults will be used.
|
CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
Type | Description |
---|---|
Task<TableResult> | Task returning TableResult. |
Remarks
This operation adds replica to a Global Active table. If performed on a regular table (singleton), it will be converted to Global Active table, provided that the singleton table schema conforms to certain restrictions. For more information, see Global Active Tables in NDCS .
Note that TableLimits for the replica table will default to the table limits for the existing table, however you can override the values of ReadUnits and WriteUnits for the replica by using options ReadUnits and WriteUnits. The storage capacity of the replica will always be the same as that of the existing table.
As with ExecuteTableDDLAsync, the result returned from this API does not imply operation completion. Same considerations as described in ExecuteTableDDLAsync about long-running operations apply here, including the need to use WaitForCompletionAsync(Nullable<TimeSpan>, Nullable<TimeSpan>, CancellationToken) to asynchronously wait for operation completion.
Note that even after this operation is completed (as described above), the replica table in the receiver region may still be in the process of being initialized with the data from the sender region, during which time the data operations on the replica table will fail with TableNotReadyException.
Exceptions
Type | Condition |
---|---|
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. |
See Also
AddReplicaAsync(String, String, AddReplicaOptions, CancellationToken)
Declaration
public Task<TableResult> AddReplicaAsync(string tableName, string regionId, AddReplicaOptions options = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Name of the table. |
String | regionId | Region id of the region where to add the replica. |
AddReplicaOptions | options | (Optional) Options for the operation. If not
specified or null , appropriate defaults will be used.
|
CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
Type | Description |
---|---|
Task<TableResult> | Task returning TableResult. |
Remarks
regionId
parameter instead of Region instance. E.g.
"ap-mumbai-1", "us-ashburn-1", etc.
Exceptions
Type | Condition |
---|---|
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. |