KeyValueStoreReplica.OnChangeRoleAsync(ReplicaRole, CancellationToken) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Indicates that this replica is changing roles.
protected virtual System.Threading.Tasks.Task<string> OnChangeRoleAsync (System.Fabric.ReplicaRole newRole, System.Threading.CancellationToken cancellationToken);
abstract member OnChangeRoleAsync : System.Fabric.ReplicaRole * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
override this.OnChangeRoleAsync : System.Fabric.ReplicaRole * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
Protected Overridable Function OnChangeRoleAsync (newRole As ReplicaRole, cancellationToken As CancellationToken) As Task(Of String)
Parameters
- newRole
- ReplicaRole
The target role.
- cancellationToken
- CancellationToken
Currently unused. Reserved for future use.
Returns
A task whose result is the resolvable address of this replica.
Remarks
The application replica should override this method if deriving from KeyValueStoreReplica, which is the recommended pattern. The application replica should return a Task whose result is the address of this replica. This replica address is stored by the system as is and can be retrieved (unmodified) using ResolveServicePartitionAsync(Uri). The application must take care to complete the role change in a timely manner since reconfiguration of the replica set will be blocked behind the completion of all outstanding change role calls.