Package org.apache.thrift.transport

Examples of org.apache.thrift.transport.TFramedTransport.open()


  public static SchedulerService.Client createBlockingSchedulerClient(
      String host, int port, int timeout) throws IOException {
    TTransport tr = new TFramedTransport(new TSocket(host, port, timeout));
    try {
      tr.open();
    } catch (TTransportException e) {
      LOG.warn("Error creating scheduler client to " + host + ":" + port);
      throw new IOException(e);
    }
    TProtocol proto = new TBinaryProtocol(tr);
View Full Code Here


  public static GetTaskService.Client createBlockingGetTaskClient(
      String host, int port, int timeout) throws IOException {
    TTransport tr = new TFramedTransport(new TSocket(host, port, timeout));
    try {
      tr.open();
    } catch (TTransportException e) {
      LOG.warn("Error creating scheduler client to " + host + ":" + port);
      throw new IOException(e);
    }
    TProtocol proto = new TBinaryProtocol(tr);
View Full Code Here

  public static BackendService.Client createBlockingBackendClient(
      String host, int port) throws IOException {
    TTransport tr = new TFramedTransport(new TSocket(host, port));
    try {
      tr.open();
    } catch (TTransportException e) {
      LOG.warn("Error creating backend client to " + host + ":" + port);
      throw new IOException(e);
    }
    TProtocol proto = new TBinaryProtocol(tr);
View Full Code Here

  public static StateStoreService.Client createBlockingStateStoreClient(
      String host, int port) throws IOException {
    TTransport tr = new TFramedTransport(new TSocket(host, port));
    try {
      tr.open();
    } catch (TTransportException e) {
      LOG.warn("Error creating state store client to " + host + ":" + port);
      throw new IOException(e);
    }
    TProtocol proto = new TBinaryProtocol(tr);
View Full Code Here

  public static FrontendService.Client createBlockingFrontendClient(
      String host, int port) throws IOException {
    TTransport tr = new TFramedTransport(new TSocket(host, port));
    try {
      tr.open();
    } catch (TTransportException e) {
      LOG.warn("Error creating state store client to " + host + ":" + port);
      throw new IOException(e);
    }
    TProtocol proto = new TBinaryProtocol(tr);
View Full Code Here

  }

  private static void pongUsingSynchronousClient(String hostname)
      throws TException, InterruptedException {
    TTransport tr = new TFramedTransport(new TSocket(hostname, 12345));
    tr.open();
    TProtocol proto = new TBinaryProtocol(tr);
    PongService.Client client = new PongService.Client(proto);
    while (true) {
      Long t = System.nanoTime();
      client.ping("PING");
View Full Code Here

    private Cassandra.Client getClient() throws TTransportException {
        if (lastClient == null) {
            TTransport tr = new TFramedTransport(new TSocket(TEST_HOST, RPC_PORT));
            lastClient = new Cassandra.Client(new TBinaryProtocol(tr));
            tr.open();
        }
        return lastClient;
    }

    public void testConnection() throws TTransportException {
View Full Code Here

    private Cassandra.Client getClient() throws TTransportException
    {
        TTransport tr = new TFramedTransport(new TSocket("localhost", DatabaseDescriptor.getRpcPort()));
        TProtocol proto = new TBinaryProtocol(tr);
        Cassandra.Client client = new Cassandra.Client(proto);
        tr.open();
        return client;
    }
}
View Full Code Here

        private static Cassandra.Client createThriftClient(String host, int port) throws TTransportException
        {
            TSocket socket = new TSocket(host, port);
            TTransport trans = new TFramedTransport(socket);
            trans.open();
            TProtocol protocol = new org.apache.thrift.protocol.TBinaryProtocol(trans);
            return new Cassandra.Client(protocol);
        }
    }
View Full Code Here

        private static Cassandra.Client createThriftClient(String host, int port) throws TTransportException
        {
            TSocket socket = new TSocket(host, port);
            TTransport trans = new TFramedTransport(socket);
            trans.open();
            TProtocol protocol = new TBinaryProtocol(trans);
            return new Cassandra.Client(protocol);
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.