Exemplo n.º 1
0
    def make_clients(self, host, port):
        """

        Args:
            host:
            port:

        Returns: thrift client for the worker at the given host and port

        """
        try:
            trans = TSocket.TSocket(host, port)
            trans = TTransport.TBufferedTransport(trans)
            proto = TBinaryProtocol.TBinaryProtocolAccelerated(trans)
            client = KnnThriftService.Client(proto)
            return client, trans
        except Thrift.TException as e:
            raise e
Exemplo n.º 2
0
 def get_client(self, host, port):
     trans = TSocket.TSocket(host, port)
     trans = TTransport.TBufferedTransport(trans)
     proto = TBinaryProtocol.TBinaryProtocolAccelerated(trans)
     client = KnnThriftService.Client(proto)
     return client, trans