Udostępnij za pośrednictwem


IStateProviderReplica.BackupAsync Method

Definition

Overloads

BackupAsync(Func<BackupInfo,CancellationToken,Task<Boolean>>)

Performs a full backup of all reliable state managed by this IReliableStateManager.

BackupAsync(BackupOption, TimeSpan, CancellationToken, Func<BackupInfo,CancellationToken,Task<Boolean>>)

Performs a backup of all reliable state managed by this IReliableStateManager.

BackupAsync(Func<BackupInfo,CancellationToken,Task<Boolean>>)

Performs a full backup of all reliable state managed by this IReliableStateManager.

public System.Threading.Tasks.Task BackupAsync (Func<Microsoft.ServiceFabric.Data.BackupInfo,System.Threading.CancellationToken,System.Threading.Tasks.Task<bool>> backupCallback);
abstract member BackupAsync : Func<Microsoft.ServiceFabric.Data.BackupInfo, System.Threading.CancellationToken, System.Threading.Tasks.Task<bool>> -> System.Threading.Tasks.Task
Public Function BackupAsync (backupCallback As Func(Of BackupInfo, CancellationToken, Task(Of Boolean))) As Task

Parameters

backupCallback
Func<BackupInfo,CancellationToken,Task<Boolean>>

Callback to be called when the backup folder has been created locally and is ready to be moved out of the node.

Returns

Task that represents the asynchronous backup operation.

Remarks

A FULL backup will be performed with a one-hour timeout. Boolean returned by the backupCallback indicate whether the service was able to successfully move the backup folder to an external location. If false is returned, BackupAsync throws InvalidOperationException with the relevant message indicating backupCallback returned false. Also, backup will be marked as unsuccessful.

Applies to

BackupAsync(BackupOption, TimeSpan, CancellationToken, Func<BackupInfo,CancellationToken,Task<Boolean>>)

Performs a backup of all reliable state managed by this IReliableStateManager.

public System.Threading.Tasks.Task BackupAsync (Microsoft.ServiceFabric.Data.BackupOption option, TimeSpan timeout, System.Threading.CancellationToken cancellationToken, Func<Microsoft.ServiceFabric.Data.BackupInfo,System.Threading.CancellationToken,System.Threading.Tasks.Task<bool>> backupCallback);
abstract member BackupAsync : Microsoft.ServiceFabric.Data.BackupOption * TimeSpan * System.Threading.CancellationToken * Func<Microsoft.ServiceFabric.Data.BackupInfo, System.Threading.CancellationToken, System.Threading.Tasks.Task<bool>> -> System.Threading.Tasks.Task
Public Function BackupAsync (option As BackupOption, timeout As TimeSpan, cancellationToken As CancellationToken, backupCallback As Func(Of BackupInfo, CancellationToken, Task(Of Boolean))) As Task

Parameters

option
BackupOption

The type of backup to perform.

timeout
TimeSpan

The timeout for this operation.

cancellationToken
CancellationToken

The token to monitor for cancellation requests.

backupCallback
Func<BackupInfo,CancellationToken,Task<Boolean>>

Callback to be called when the backup folder has been created locally and is ready to be moved out of the node.

Returns

Task that represents the asynchronous backup operation.

Remarks

Boolean returned by the backupCallback indicate whether the service was able to successfully move the backup folder to an external location. If false is returned, BackupAsync throws InvalidOperationException with the relevant message indicating backupCallback returned false. Also, backup will be marked as unsuccessful.

Applies to