Package org.apache.thrift.protocol

Examples of org.apache.thrift.protocol.TProtocol


 
  public TestProxyClient(String host, int port, TProtocolFactory protoFactory) throws TTransportException {
    final TSocket socket = new TSocket(host, port);
    socket.setTimeout(600000);
    transport = new TFramedTransport(socket);
    final TProtocol protocol = protoFactory.getProtocol(transport);
    proxy = new AccumuloProxy.Client(protocol);
    transport.open();
  }
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(ByteBuffer.wrap(HConstants.META_TABLE_NAME),
        ByteBuffer.wrap(Bytes.toBytes("")), null);
    client.scannerClose(scannerId);
    thriftClient = client;
View Full Code Here

    private static Cassandra.Client createConnection(String host, Integer 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

    }

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

    private static Cassandra.Client createConnection(String host, Integer 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

        private static Cassandra.Client createThriftClient(String host, int port, String user, String passwd) throws Exception
        {
            TSocket socket = new TSocket(host, port);
            TTransport trans = new TFramedTransport(socket);
            trans.open();
            TProtocol protocol = new TBinaryProtocol(trans);
            Cassandra.Client client = new Cassandra.Client(protocol);
            if (user != null && passwd != null)
            {
                Map<String, String> credentials = new HashMap<String, String>();
                credentials.put(IAuthenticator.USERNAME_KEY, user);
View Full Code Here

    @BeforeMethod public void setup() throws IOException, TTransportException {
        node = nodeBuilder().settings(settingsBuilder()
                .put("cluster.name", "test-cluster-" + NetworkUtils.getLocalAddress())
                .put("gateway.type", "none")).node();
        transport = new TSocket("localhost", 9500);
        TProtocol protocol = new TBinaryProtocol(transport);
        client = new Rest.Client(protocol);
        transport.open();
    }
View Full Code Here

        port = Integer.parseInt(hostport[1]);
      }
      catch (Exception e) {
      }
      transport = new TSocket(host, port);
      TProtocol protocol = new TBinaryProtocol(transport);
      client = new HiveClient(protocol);
      try {
        transport.open();
      }
      catch (TTransportException e) {
View Full Code Here

  private void openStore(URI store) throws MetaException {
    open = false;
    transport = new TSocket(store.getHost(), store.getPort());
    ((TSocket)transport).setTimeout(20000);
    TProtocol protocol = new TBinaryProtocol(transport);
    client = new ThriftHiveMetastore.Client(protocol);

    for(int i = 0; i < retries && !this.open; ++i) {
      try {
        transport.open();
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.