Package org.apache.thrift.protocol

Examples of org.apache.thrift.protocol.TProtocol


      log.debug("Connecting to " + hostAddr[0] + ":" + hostAddr[1]);
      InetSocketAddress addr = new InetSocketAddress(hostAddr[0], Integer.parseInt(hostAddr[1]));
      Socket sock = new Socket();
      sock.connect(addr);
      TTransport transport = new TSocket(sock);
      TProtocol prot = new TBinaryProtocol(transport);
      return new Client(prot);
    } catch (Exception ex) {
      log.error(ex, ex);
      return null;
    }
View Full Code Here


      log.debug("Connecting to " + hostAddr[0] + ":" + hostAddr[1]);
      InetSocketAddress addr = new InetSocketAddress(hostAddr[0], Integer.parseInt(hostAddr[1]));
      Socket sock = new Socket();
      sock.connect(addr);
      TTransport transport = new TSocket(sock);
      TProtocol prot = new TBinaryProtocol(transport);
      return new Client(prot);
    } catch (Exception ex) {
      log.error(ex, ex);
      return null;
    }
View Full Code Here

    TTransport transport = new TSocket(thriftAddress.getHostName(),
        HBaseThriftServerClusterActionHandler.PORT);
    transport.open();
    LOG.info("Connected to thrift server.");
    LOG.info("Waiting for .META. table...");
    TProtocol protocol = new TBinaryProtocol(transport, true, true);
    Hbase.Client client = new Hbase.Client(protocol);
    int scannerId = client.scannerOpen(HConstants.META_TABLE_NAME,
        Bytes.toBytes(""), null);
    client.scannerClose(scannerId);
    thriftClient = client;
View Full Code Here

public class GFacClientFactory {
    public static GfacService.Client createGFacClient(String serverHost, int serverPort){
          try {
              TTransport transport = new TSocket(serverHost, serverPort);
              transport.open();
              TProtocol protocol = new TBinaryProtocol(transport);
              return new GfacService.Client(protocol);
          } catch (TTransportException e) {
              e.printStackTrace();
          }
          return null;
View Full Code Here

    public static Airavata.Client createAiravataClient(String serverHost, int serverPort) throws AiravataClientConnectException{
        try {
            TTransport transport = new TSocket(serverHost, serverPort);
            transport.open();
            TProtocol protocol = new TBinaryProtocol(transport);
//            TMultiplexedProtocol mp = new TMultiplexedProtocol(protocol, "APIServer");
            return new Airavata.Client(protocol);
        } catch (TTransportException e) {
            throw new AiravataClientConnectException("Unable to connect to the server at "+serverHost+":"+serverPort);
        }
View Full Code Here

    private static Cassandra.Client createConnection(String host, Integer port, boolean framed) throws TTransportException
    {
        TSocket socket = new TSocket(host, port);
        TTransport trans = framed ? new TFramedTransport(socket) : socket;
        trans.open();
        TProtocol protocol = new TBinaryProtocol(trans);

        return new Cassandra.Client(protocol);
    }
View Full Code Here

     * @throws TTransportException
     */
    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

  /**
   * Connect to Hive Server
   */
  public void connect() throws TTransportException {
    transport = new TSocket(host, port);
    TProtocol protocol = new TBinaryProtocol(transport);
    client = new HiveClient(protocol);
    transport.open();
    remoteMode = true;
  }
View Full Code Here

        public void run()
        {
            TProcessor processor = null;
            TTransport inputTransport = null;
            TTransport outputTransport = null;
            TProtocol inputProtocol = null;
            TProtocol outputProtocol = null;
            try
            {
                processor = processorFactory_.getProcessor(client_);
                inputTransport = inputTransportFactory_.getTransport(client_);
                outputTransport = outputTransportFactory_.getTransport(client_);
View Full Code Here

      UtilWaitThread.sleep(10);
    }
   
    TTransport transport = new TSocket("localhost", port);
    transport.open();
    TProtocol protocol = new TBinaryProtocol(transport);
    ThriftTest.Client client = new ThriftTest.Client(protocol);
    assertTrue(client.success());
    assertFalse(client.fails());
    try {
      client.throwsError();
View Full Code Here

TOP

Related Classes of org.apache.thrift.protocol.TProtocol

Copyright © 2018 www.massapicom. 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.