Example #1
0
 def getLeaderNode(self, node_id):
     return self.stub.getLeaderNode(
         server_pb2.ReplicationRequest(id=node_id))
Example #2
0
 def requestVote(self, node_id):
     return self.stub.requestVote(server_pb2.ReplicationRequest(id=node_id))
Example #3
0
 def getClientStatus(self, requested_by=0):
     req = (server_pb2.ReplicationRequest(id=requested_by))
     return self.stub.getClientStatus(req)
Example #4
0
 def setLeader(self, leader_id):
     return self.stub.setLeader(server_pb2.ReplicationRequest(id=leader_id))
 def getLeaderNode(self, request, context):
     leader_node = self.node.getLeaderNode()
     logger.info("leader node for node-id {} is {}".format(
         str(self.node.id), str(leader_node)))
     return server_pb2.ReplicationRequest(id=leader_node)