Method WaitForLocalReplicaInitAsync
WaitForLocalReplicaInitAsync(String, Nullable<TimeSpan>, Nullable<TimeSpan>, CancellationToken)
Declaration
public Task<TableResult> WaitForLocalReplicaInitAsync(string tableName, Nullable<TimeSpan> timeout = null, Nullable<TimeSpan> pollDelay = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | tableName | Name of the table. |
| Nullable<TimeSpan> | timeout |
|
| Nullable<TimeSpan> | pollDelay |
|
| CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<TableResult> | Task returning TableResult. |
Remarks
After table replica is created, it needs to be initialized by copying the data (if any) from the sender region. During this initialization process, even though the table state of the replica table is Active, data operations cannot be performed on the replica table.
This method is used to ensure that the replica table is ready for
data operations by asynchronously waiting for the initialization
process to complete. It works similar to
WaitForCompletionAsync(Nullable<TimeSpan>, Nullable<TimeSpan>, CancellationToken) and
WaitForTableStateAsync(String, TableState, TableCompletionOptions, CancellationToken) by polling the table state at
regular intervals until
IsLocalReplicaInitialized is true.
Note that this operation must be performed in the receiver region where the table replica resides (not in the sender region from where the replica was created), meaning that this NoSQLClient instance must be configured with the receiver region (see Region).
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
WaitForLocalReplicaInitAsync(String, TableCompletionOptions, CancellationToken)
Declaration
public Task<TableResult> WaitForLocalReplicaInitAsync(string tableName, TableCompletionOptions options, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | tableName | Name of the table. |
| TableCompletionOptions | options | Options for the operation. |
| CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<TableResult> | Task returning TableResult. |
Remarks
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. |