Delen via


KeyValueStoreReplica.RestoreAsync Method

Definition

Overloads

RestoreAsync(String)

Restores this replica's local store database from a backup that was previously created by calling BackupAsync(String, StoreBackupOption, Func<StoreBackupInfo,Task<Boolean>>).

RestoreAsync(String, CancellationToken)

Restores this replica's local store database from a backup that was previously created by calling BackupAsync(String, StoreBackupOption, Func<StoreBackupInfo,Task<Boolean>>).

RestoreAsync(String, RestoreSettings, CancellationToken)

Asynchronously restores the key/value store replica.

RestoreAsync(String)

Restores this replica's local store database from a backup that was previously created by calling BackupAsync(String, StoreBackupOption, Func<StoreBackupInfo,Task<Boolean>>).

public System.Threading.Tasks.Task RestoreAsync (string backupDirectory);
member this.RestoreAsync : string -> System.Threading.Tasks.Task
Public Function RestoreAsync (backupDirectory As String) As Task

Parameters

backupDirectory
String

The directory where the replica is to be restored from. This parameter cannot be null, empty or contain just whitespace. UNC paths may also be provided.

Returns

A task that represents the asynchronous restore operation.

Exceptions

backupDirectory is null.

backupDirectory is empty or contains just whitespaces.

backupDirectory does not exist.

Remarks

It is recommended to not perform any write operations to the key/value store while restore is underway since the updated data would be lost when the store is restored from the files in backupDirectory.

This is only a local replica restore and the replica set is not automatically restored. The entire replica set must be restored by taking additional steps to cause a natural build of other replicas via reconfiguration. The recommended approach is to restore to an empty service with only a single replica and increase the target replica set size afterwards with a call to UpdateServiceAsync(Uri, ServiceUpdateDescription) if needed.

If the restore is successful, then the replica will restart itself and start using the restored local data after coming back online given that the recommendation to restore to a replica set containing only a single replica was followed.

Applies to

RestoreAsync(String, CancellationToken)

Restores this replica's local store database from a backup that was previously created by calling BackupAsync(String, StoreBackupOption, Func<StoreBackupInfo,Task<Boolean>>).

public System.Threading.Tasks.Task RestoreAsync (string backupDirectory, System.Threading.CancellationToken cancellationToken);
member this.RestoreAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function RestoreAsync (backupDirectory As String, cancellationToken As CancellationToken) As Task

Parameters

backupDirectory
String

The directory where the replica is to be restored from. This parameter cannot be null, empty or contain just whitespace. UNC paths may also be provided.

cancellationToken
CancellationToken

The cancellation token

Returns

A task that represents the asynchronous restore operation.

Exceptions

backupDirectory is null.

backupDirectory is empty or contains just whitespaces.

backupDirectory does not exist.

Remarks

It is recommended to not perform any write operations to the key/value store while restore is underway since the updated data would be lost when the store is restored from the files in backupDirectory.

This is only a local replica restore and the replica set is not automatically restored. The entire replica set must be restored by taking additional steps to cause a natural build of other replicas via reconfiguration. The recommended approach is to restore to an empty service with only a single replica and increase the target replica set size afterwards with a call to UpdateServiceAsync(Uri, ServiceUpdateDescription) if needed.

If the restore is successful, then the replica will restart itself and start using the restored local data after coming back online given that the recommendation to restore to a replica set containing only a single replica was followed.

Applies to

RestoreAsync(String, RestoreSettings, CancellationToken)

Asynchronously restores the key/value store replica.

public System.Threading.Tasks.Task RestoreAsync (string backupDirectory, System.Fabric.RestoreSettings settings, System.Threading.CancellationToken cancellationToken);
member this.RestoreAsync : string * System.Fabric.RestoreSettings * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function RestoreAsync (backupDirectory As String, settings As RestoreSettings, cancellationToken As CancellationToken) As Task

Parameters

backupDirectory
String

The directory where the replica is to be restored from. This parameter cannot be null, empty or contain just whitespace. UNC paths may also be provided.

settings
RestoreSettings

Settings to modify restore behavior.

cancellationToken
CancellationToken

The token to monitor for cancellation requests.

Returns

A task that represents the asynchronous restore operation.

Exceptions

backupDirectory is null.

backupDirectory is empty or contains just whitespaces.

backupDirectory does not exist.

Remarks

It is recommended to not perform any write operations to the key/value store while restore is underway since the updated data would be lost when the store is restored from the files in backupDirectory.

This is only a local replica restore and the replica set is not automatically restored. The entire replica set must be restored by taking additional steps to cause a natural build of other replicas via reconfiguration. The recommended approach is to restore to an empty service with only a single replica and increase the target replica set size afterwards with a call to UpdateServiceAsync(Uri, ServiceUpdateDescription) if needed.

If the restore is successful, then the replica will restart itself and start using the restored local data after coming back online given that the recommendation to restore to a replica set containing only a single replica was followed.

Applies to