コード例 #1
0
        public CrashedReplicaPMACK RemoveCrashedReplica_aux(CrashedReplicaPM request)
        {
            //propagate to each server
            foreach (Server s in servList)
            {
                CrashedReplicaServer crashed_replica = new CrashedReplicaServer();
                crashed_replica.Partitionid = request.Partitionid;
                foreach (String serv_id in request.Serverid)
                {
                    crashed_replica.Serverid.Add(serv_id);
                }
                AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
                GrpcChannel channel = GrpcChannel.ForAddress(s.getURL());
                var         serv    = new GStoreServices.GStoreServicesClient(channel);
                serv.RemoveCrashedReplica(crashed_replica);
            }

            //propagate to each client
            foreach (Client c in cliList)
            {
                CrashedReplicaClient crashed_replica = new CrashedReplicaClient();
                crashed_replica.Partitionid = request.Partitionid;
                foreach (String serv_id in request.Serverid)
                {
                    crashed_replica.Serverid.Add(serv_id);
                }
                AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
                GrpcChannel channel = GrpcChannel.ForAddress(c.getURL());
                var         client  = new ClientServices.ClientServicesClient(channel);
                client.RemoveCrashedReplicaClient(crashed_replica);
            }
            return(new CrashedReplicaPMACK {
            });
        }
コード例 #2
0
 public override Task <CrashedReplicaPMACK> RemoveCrashedReplicaPM(CrashedReplicaPM request, ServerCallContext context)
 {
     Console.WriteLine("*********************************************************************************");
     Console.WriteLine("PM is propagating the crashed replica...");
     Console.WriteLine("*********************************************************************************");
     return(Task.FromResult(RemoveCrashedReplica_aux(request)));
 }