def getLeaderNode(self, node_id): return self.stub.getLeaderNode( server_pb2.ReplicationRequest(id=node_id))
def requestVote(self, node_id): return self.stub.requestVote(server_pb2.ReplicationRequest(id=node_id))
def getClientStatus(self, requested_by=0): req = (server_pb2.ReplicationRequest(id=requested_by)) return self.stub.getClientStatus(req)
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)