NativeRuntime.IFabricReplicator NativeRuntime.IFabricStatefulServiceReplica.EndOpen(NativeCommon.IFabricAsyncOperationContext context)
        {
            IReplicator replicator = AsyncTaskCallInAdapter.End <IReplicator>(context);

            // If it is the fabric replicator then return the actual native interface implementation
            // This will prevent going through a broker to translate native and managed code
            FabricReplicator fabricReplicator = replicator as FabricReplicator;

            if (fabricReplicator != null)
            {
                return(fabricReplicator.NativeReplicator);
            }

            // Return the broker that implements the correct native interfaces
            // If IReplicatorCatchupSpecificQuorum is supported return ReplicatorBroker2 (which derives from ReplicatorBroker and also implements IFabricReplicatorCatchupSpecificQuorum)
            // Else return ReplicatorBroker (which implements only IFabricReplicator and IFabricPrimaryReplicator)
            if (replicator is IReplicatorCatchupSpecificQuorum)
            {
                return(new ReplicatorBroker2(replicator));
            }
            else
            {
                return(new ReplicatorBroker(replicator));
            }
        }
Example #2
0
 internal FabricReplicator(
     NativeRuntime.IFabricReplicator nativeReplicator,
     NativeRuntime.IFabricStateReplicator nativeStateReplicator,
     NativeRuntime.IOperationDataFactory operationDataFactory)
     : this(nativeReplicator)
 {
     this.stateReplicator = FabricReplicator.CreateStateReplicator(nativeStateReplicator, operationDataFactory);
 }