共用方式為


IReliableDictionary2<TKey,TValue>.CreateKeyEnumerableAsync Method

Definition

Overloads

CreateKeyEnumerableAsync(ITransaction)

Creates an async enumerator over the IReliableDictionary2<TKey,TValue> to enumerate the keys.

CreateKeyEnumerableAsync(ITransaction, EnumerationMode)

Creates an async enumerator over the IReliableDictionary2<TKey,TValue> to enumerate the keys.

CreateKeyEnumerableAsync(ITransaction, EnumerationMode, TimeSpan, CancellationToken)

Creates an async enumerator over the IReliableDictionary2<TKey,TValue> to enumerate the keys.

CreateKeyEnumerableAsync(ITransaction)

Creates an async enumerator over the IReliableDictionary2<TKey,TValue> to enumerate the keys.

public System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.IAsyncEnumerable<TKey>> CreateKeyEnumerableAsync (Microsoft.ServiceFabric.Data.ITransaction txn);
abstract member CreateKeyEnumerableAsync : Microsoft.ServiceFabric.Data.ITransaction -> System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.IAsyncEnumerable<'Key>>
Public Function CreateKeyEnumerableAsync (txn As ITransaction) As Task(Of IAsyncEnumerable(Of TKey))

Parameters

txn
ITransaction

Transaction to associate this operation with.

Returns

An enumerable for the reliable dictionary keys.

Exceptions

Exception indicates that the Reliable Dictionary cannot serve reads at the moment. FabricNotReadableException can be thrown in all ReplicaRoles. One example for it being thrown in the Primary is loss of ReadStatus. One example for it being thrown in the ActiveSecondary is that Reliable Collection's state is not yet consistent.

The transaction has been internally faulted by the system. Retry the operation on a new transaction

Thrown when a method call is invalid for the object's current state. Example, transaction used is already terminated: committed or aborted by the user. If this exception is thrown, it is highly likely that there is a bug in the service code of the use of transactions.

Indicates that the Reliable Dictionary is closed or deleted.

Remarks

The enumerarable returned from the reliable dictionary is safe to use concurrently with reads and writes to the dictionary. It represents a snapshot consistent view of the dictionary.

Applies to

CreateKeyEnumerableAsync(ITransaction, EnumerationMode)

Creates an async enumerator over the IReliableDictionary2<TKey,TValue> to enumerate the keys.

public System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.IAsyncEnumerable<TKey>> CreateKeyEnumerableAsync (Microsoft.ServiceFabric.Data.ITransaction txn, Microsoft.ServiceFabric.Data.Collections.EnumerationMode enumerationMode);
abstract member CreateKeyEnumerableAsync : Microsoft.ServiceFabric.Data.ITransaction * Microsoft.ServiceFabric.Data.Collections.EnumerationMode -> System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.IAsyncEnumerable<'Key>>
Public Function CreateKeyEnumerableAsync (txn As ITransaction, enumerationMode As EnumerationMode) As Task(Of IAsyncEnumerable(Of TKey))

Parameters

txn
ITransaction

Transaction to associate this operation with.

enumerationMode
EnumerationMode

The enumeration mode to use. The default is Unordered.

Returns

An enumerable for the IReliableDictionary2<TKey,TValue> keys.

Exceptions

Exception indicates that the Reliable Dictionary cannot serve reads at the moment. FabricNotReadableException can be thrown in all ReplicaRoles. One example for it being thrown in the Primary is loss of ReadStatus. One example for it being thrown in the ActiveSecondary is that Reliable Collection's state is not yet consistent.

The transaction has been internally faulted by the system. Retry the operation on a new transaction

Thrown when a method call is invalid for the object's current state. Example, transaction used is already terminated: committed or aborted by the user. If this exception is thrown, it is highly likely that there is a bug in the service code of the use of transactions.

Indicates that the Reliable Dictionary is closed or deleted.

Remarks

The enumerarable returned from the IReliableDictionary2<TKey,TValue> is safe to use concurrently with reads and writes to the dictionary. It represents a snapshot consistent view of the dictionary.

Applies to

CreateKeyEnumerableAsync(ITransaction, EnumerationMode, TimeSpan, CancellationToken)

Creates an async enumerator over the IReliableDictionary2<TKey,TValue> to enumerate the keys.

public System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.IAsyncEnumerable<TKey>> CreateKeyEnumerableAsync (Microsoft.ServiceFabric.Data.ITransaction txn, Microsoft.ServiceFabric.Data.Collections.EnumerationMode enumerationMode, TimeSpan timeout, System.Threading.CancellationToken cancellationToken);
abstract member CreateKeyEnumerableAsync : Microsoft.ServiceFabric.Data.ITransaction * Microsoft.ServiceFabric.Data.Collections.EnumerationMode * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.ServiceFabric.Data.IAsyncEnumerable<'Key>>
Public Function CreateKeyEnumerableAsync (txn As ITransaction, enumerationMode As EnumerationMode, timeout As TimeSpan, cancellationToken As CancellationToken) As Task(Of IAsyncEnumerable(Of TKey))

Parameters

txn
ITransaction

Transaction to associate this operation with.

enumerationMode
EnumerationMode

The enumeration mode to use. The default is Unordered.

timeout
TimeSpan

The amount of time to wait for the operation to complete before throwing a TimeoutException. Primarily used to prevent deadlocks. The default is 4 seconds.

cancellationToken
CancellationToken

The token to monitor for cancellation requests. The default is None.

Returns

An enumerable for the IReliableDictionary2<TKey,TValue> keys.

Exceptions

Exception indicates that the Reliable Dictionary cannot serve reads at the moment. FabricNotReadableException can be thrown in all ReplicaRoles. One example for it being thrown in the Primary is loss of ReadStatus. One example for it being thrown in the ActiveSecondary is that Reliable Collection's state is not yet consistent.

The transaction has been internally faulted by the system. Retry the operation on a new transaction

Thrown when a method call is invalid for the object's current state. Example, transaction used is already terminated: committed or aborted by the user. If this exception is thrown, it is highly likely that there is a bug in the service code of the use of transactions.

Indicates that the Reliable Dictionary is closed or deleted.

Remarks

The enumerarable returned from the IReliableDictionary2<TKey,TValue> is safe to use concurrently with reads and writes to the dictionary. It represents a snapshot consistent view of the dictionary.

Applies to