NativeTypes.FABRIC_REPLICA_INFORMATION CreateNativeReplicaInformation( PinCollection pin, NativeTypes.FABRIC_REPLICA_ROLE role = NativeTypes.FABRIC_REPLICA_ROLE.FABRIC_REPLICA_ROLE_NONE, NativeTypes.FABRIC_REPLICA_STATUS status = NativeTypes.FABRIC_REPLICA_STATUS.FABRIC_REPLICA_STATUS_UP, long catchupCapability = 1, long currentProgress = 2, long id = 3, string replicatorAddress = "", bool mustCatchup = false ) { var ex = new NativeTypes.FABRIC_REPLICA_INFORMATION_EX1[1]; ex[0].MustCatchup = NativeTypes.ToBOOLEAN(mustCatchup); ex[0].Reserved = IntPtr.Zero; return(new NativeTypes.FABRIC_REPLICA_INFORMATION { CatchUpCapability = catchupCapability, CurrentProgress = currentProgress, Id = id, ReplicatorAddress = pin.AddBlittable(replicatorAddress), Role = (NativeTypes.FABRIC_REPLICA_ROLE)role, Status = (NativeTypes.FABRIC_REPLICA_STATUS)status, Reserved = pin.AddBlittable(ex) }); }
private Task ChangeRoleAsync(IntPtr nativeEpoch, NativeTypes.FABRIC_REPLICA_ROLE nativeRole, CancellationToken cancellationToken) { Epoch epoch = Epoch.FromNative(nativeEpoch); ReplicaRole replicaRole = (ReplicaRole)nativeRole; return(this.replicator.ChangeRoleAsync(epoch, replicaRole, cancellationToken)); }
NativeCommon.IFabricAsyncOperationContext NativeRuntime.IFabricStatefulServiceReplica.BeginChangeRole(NativeTypes.FABRIC_REPLICA_ROLE newRole, NativeCommon.IFabricAsyncOperationCallback callback) { return(Utility.WrapNativeAsyncMethodImplementation((cancellationToken) => this.ReplicaRoleChangeAsync((ReplicaRole)newRole, cancellationToken), callback, "StatefulServiceBroker.ReplicaChangeRole", ChangeRoleAsyncApi)); }
public NativeCommon.IFabricAsyncOperationContext BeginChangeRole(IntPtr nativeEpoch, NativeTypes.FABRIC_REPLICA_ROLE nativeRole, NativeCommon.IFabricAsyncOperationCallback callback) { return(Utility.WrapNativeAsyncMethodImplementation((cancellationToken) => this.ChangeRoleAsync(nativeEpoch, nativeRole, cancellationToken), callback, "ReplicaBroker.ChangeRole")); }
public virtual NativeCommon.IFabricAsyncOperationContext BeginChangeRole(IntPtr epoch, NativeTypes.FABRIC_REPLICA_ROLE role, NativeCommon.IFabricAsyncOperationCallback callback) { throw new NotImplementedException("BeginChangeRole"); }