다음을 통해 공유


ReliableStateManager Class

Definition

The ReliableStateManager class is responsible for managing IReliableState for a service replica. Each replica in a service has its own IReliableState and ReliableStateManager. IReliableState can include IReliableDictionary<TKey,TValue>, IReliableQueue<T>, or any IReliableCollection<T> types.

public class ReliableStateManager : Microsoft.ServiceFabric.Data.IAsyncEnumerable<Microsoft.ServiceFabric.Data.IReliableState>, Microsoft.ServiceFabric.Data.IReliableStateManagerReplica2
type ReliableStateManager = class
    interface IReliableStateManagerReplica2
    interface IReliableStateManagerReplica
    interface IStateProviderReplica
    interface IReliableStateManager
    interface IAsyncEnumerable<IReliableState>
    interface IStateProviderReplica2
Public Class ReliableStateManager
Implements IAsyncEnumerable(Of IReliableState), IReliableStateManagerReplica2
Inheritance
ReliableStateManager
Implements

Constructors

ReliableStateManager(StatefulServiceContext, ReliableStateManagerConfiguration)

Create a new ReliableStateManager.

Properties

OnDataLossAsync

Set this property to receive notification when this IStateProviderReplica suspects data loss.

OnRestoreCompletedAsync

Function called post restore has been performed on the replica.

Methods

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.

GetAsyncEnumerator()

Returns an enumerator that iterates through the collection.

RestoreAsync(String, RestorePolicy, CancellationToken)

Restore a backup taken by BackupAsync(Func<BackupInfo,CancellationToken,Task<Boolean>>) or BackupAsync(BackupOption, TimeSpan, CancellationToken, Func<BackupInfo,CancellationToken,Task<Boolean>>).

RestoreAsync(String)

Restore a backup taken by BackupAsync(Func<BackupInfo,CancellationToken,Task<Boolean>>) or BackupAsync(BackupOption, TimeSpan, CancellationToken, Func<BackupInfo,CancellationToken,Task<Boolean>>).

Events

StateManagerChanged

Occurs when the state manager changes.

TransactionChanged

Occurs when a transaction changes.

Explicit Interface Implementations

IReliableStateManager.CreateTransaction()

Create and start a new transaction that can be used to group operations to be performed atomically.

IReliableStateManager.GetOrAddAsync<T>(ITransaction, String, TimeSpan)

Gets an IReliableState of the given type T and with the given name if it exists, or creates one and returns it if it doesn't already exist.

IReliableStateManager.GetOrAddAsync<T>(ITransaction, String)

Gets an IReliableState of the given type T and with the given name if it exists, or creates one and returns it if it doesn't already exist.

IReliableStateManager.GetOrAddAsync<T>(ITransaction, Uri, TimeSpan)

Gets an IReliableState of the given type T and with the given name if it exists, or creates one and returns it if it doesn't already exist.

IReliableStateManager.GetOrAddAsync<T>(ITransaction, Uri)

Gets an IReliableState of the given type T and with the given name if it exists, or creates one and returns it if it doesn't already exist.

IReliableStateManager.GetOrAddAsync<T>(String, TimeSpan)

Gets an IReliableState of the given type T and with the given name if it exists, or creates one and returns it if it doesn't already exist.

IReliableStateManager.GetOrAddAsync<T>(String)

Gets an IReliableState of the given type T and with the given name if it exists, or creates one and returns it if it doesn't already exist.

IReliableStateManager.GetOrAddAsync<T>(Uri, TimeSpan)

Gets an IReliableState of the given type T and with the given name if it exists, or creates one and returns it if it doesn't already exist.

IReliableStateManager.GetOrAddAsync<T>(Uri)

Gets an IReliableState of the given type T and with the given name if it exists, or creates one and returns it if it doesn't already exist.

IReliableStateManager.RemoveAsync(ITransaction, String, TimeSpan)

Removes the IReliableState with the given name from this state manager. The state is permanently removed from persistent storage and all replicas when the transaction is committed.

IReliableStateManager.RemoveAsync(ITransaction, String)

Removes the IReliableState with the given name from this state manager. The state is permanently removed from persistent storage and all replicas when the transaction is committed.

IReliableStateManager.RemoveAsync(ITransaction, Uri, TimeSpan)

Removes the IReliableState with the given name from this state manager. The state is permanently removed from persistent storage and all replicas when the transaction is committed.

IReliableStateManager.RemoveAsync(ITransaction, Uri)

Removes the IReliableState with the given name from this state manager. The state is permanently removed from persistent storage and all replicas when the transaction is committed.

IReliableStateManager.RemoveAsync(String, TimeSpan)

Removes the IReliableState with the given name from this state manager. The state is permanently removed from persistent storage and all replicas.

IReliableStateManager.RemoveAsync(String)

Removes the IReliableState with the given name from this state manager. The state is permanently removed from persistent storage and all replicas.

IReliableStateManager.RemoveAsync(Uri, TimeSpan)

Removes the IReliableState with the given name from this state manager. The state is permanently removed from persistent storage and all replicas.

IReliableStateManager.RemoveAsync(Uri)

Removes the IReliableState with the given name from this state manager. The state is permanently removed from persistent storage and all replicas.

IReliableStateManager.TryAddStateSerializer<T>(IStateSerializer<T>)

Adds a state serializer. Adds it for all reliable collection instances.

IReliableStateManager.TryGetAsync<T>(String)

Attempts to get an IReliableState of the given type T and with the given name.

IReliableStateManager.TryGetAsync<T>(Uri)

Attempts to get an IReliableState of the given type T and with the given name.

IStateProviderReplica.Abort()

Forcefully abort the state provider replica.

IStateProviderReplica.ChangeRoleAsync(ReplicaRole, CancellationToken)

Notify the state provider replica that its role is changing, for example to Primary or Secondary.

IStateProviderReplica.CloseAsync(CancellationToken)

Gracefully close the state provider replica.

IStateProviderReplica.Initialize(StatefulServiceInitializationParameters)

Initialize the state provider replica using the service initialization information.

IStateProviderReplica.OpenAsync(ReplicaOpenMode, IStatefulServicePartition, CancellationToken)

Open the state provider replica for use.

Applies to