共用方式為


StatefulServiceBase.OnDataLossAsync(RestoreContext, CancellationToken) Method

Definition

This method is called during suspected data loss. You can override this method to restore the service in case of data loss.

protected virtual System.Threading.Tasks.Task<bool> OnDataLossAsync (Microsoft.ServiceFabric.Data.RestoreContext restoreCtx, System.Threading.CancellationToken cancellationToken);
abstract member OnDataLossAsync : Microsoft.ServiceFabric.Data.RestoreContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
override this.OnDataLossAsync : Microsoft.ServiceFabric.Data.RestoreContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
Protected Overridable Function OnDataLossAsync (restoreCtx As RestoreContext, cancellationToken As CancellationToken) As Task(Of Boolean)

Parameters

restoreCtx
RestoreContext

A RestoreContext to be used to restore the service.

cancellationToken
CancellationToken

CancellationToken to monitor for cancellation requests.

Returns

A Task that represents the asynchronous restore operation. True indicates that the state has been restored. False indicates that the replica's state has not been modified.

Applies to