Package org.apache.thrift.protocol

Examples of org.apache.thrift.protocol.TBinaryProtocol


    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

  public Cassandra.Client getCassandra() {
    if ( !isOpen() ) {
      throw new IllegalStateException("getCassandra called on client that was not open. You should not have gotten here.");
    }
    if ( cassandraClient == null ) {
      cassandraClient = new Cassandra.Client(new TBinaryProtocol(transport));
    }
    return cassandraClient;
  }
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

      while (true) {
        try {
          TSocket socket = new TSocket(instance.getPublicAddress()
              .getHostAddress(), CassandraService.CLIENT_PORT);
          socket.open();
          TBinaryProtocol protocol = new TBinaryProtocol(socket);
          Cassandra.Client client = new Cassandra.Client(protocol);
          client.describe_cluster_name();
          socket.close();
          break;
        } catch (TException e) {
View Full Code Here

    Set<String> endPoints = new HashSet<String>();
    for (Instance instance : cluster.getInstances()) {
      TSocket socket = new TSocket(instance.getPublicAddress().getHostAddress(),
          CassandraService.CLIENT_PORT);
      socket.open();
      TBinaryProtocol protocol = new TBinaryProtocol(socket);
      Cassandra.Client client = new Cassandra.Client(protocol);
      List<TokenRange> tr = client.describe_ring(KEYSPACE);
      for (TokenRange tokenRange : tr) {
        endPoints.addAll(tokenRange.endpoints);
      }
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

    StorageDescriptor sd = new StorageDescriptor();
    try {
      //replace with THRIFT-138
      TMemoryBuffer buffer = new TMemoryBuffer(1024);
      TBinaryProtocol prot = new TBinaryProtocol(buffer);
      tbl.getTTable().getSd().write(prot);

      sd.read(prot);
    } catch (TException e) {
      LOG.error("Could not create a copy of StorageDescription");
View Full Code Here

TOP

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

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.