Package org.apache.thrift.transport

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


        /* Establish a thrift connection to the cassandra instance */
        TSocket socket = new TSocket(server, port);
        System.out.println(" connected to " + server + ":" + port + ".");
        TBinaryProtocol binaryProtocol = new TBinaryProtocol(new TFramedTransport(socket));
        Cassandra.Client cassandraClient = new Cassandra.Client(binaryProtocol);
        socket.open();
        thriftClient = cassandraClient;
    }

    /**
     * usage: java -cp <configpath> org.apache.cassandra.client.TestRingCache [keyspace row-id-prefix row-id-int]
View Full Code Here


    public void start() throws Exception {
        log.info(String.format("Starting Hive Thrift/Client on [%s][%d]...", host, port));

        TSocket transport = new TSocket(host, port, (int) TimeUnit.MINUTES.toMillis(2));
        client = new HiveClient(new TBinaryProtocol(transport));
        transport.open();
    }

    @Override
    public List<String> execute(String statement) throws Exception {
        client.execute(statement);
View Full Code Here

  protected HiveClient createHiveClient() {
    TSocket transport = new TSocket(host, port, timeout);
    HiveClient hive = new HiveClient(new TBinaryProtocol(transport));

    try {
      transport.open();

      if (!CollectionUtils.isEmpty(scripts)) {
        HiveUtils.runWithConversion(hive, scripts, false);
      }
    } catch (TTransportException ex) {
View Full Code Here

      // wrap transport if framed transport is enabled
      if (isFramed) {
        transport = new TFramedTransport(transport);
      }
      TProtocol protocol = new TBinaryProtocol(transport);
      transport.open();
      client = new Client(protocol);
      th.set(client);
    }
    return client;
  }
View Full Code Here

            try
            {
                TSocket socket = new TSocket(seed, port_);
                TBinaryProtocol binaryProtocol = new TBinaryProtocol(new TFramedTransport(socket));
                Cassandra.Client client = new Cassandra.Client(binaryProtocol);
                socket.open();

                List<TokenRange> ring = client.describe_ring(keyspace);
                rangeMap = ArrayListMultimap.create();
               
                for (TokenRange range : ring)
View Full Code Here

        /* Establish a thrift connection to the cassandra instance */
        TSocket socket = new TSocket(server, port);
        System.out.println(" connected to " + server + ":" + port + ".");
        TBinaryProtocol binaryProtocol = new TBinaryProtocol(new TFramedTransport(socket));
        Cassandra.Client cassandraClient = new Cassandra.Client(binaryProtocol);
        socket.open();
        thriftClient = cassandraClient;
        String seed = DatabaseDescriptor.getSeeds().iterator().next().getHostAddress();
        conf = new Configuration();
        ConfigHelper.setOutputPartitioner(conf, DatabaseDescriptor.getPartitioner().getClass().getName());
        ConfigHelper.setOutputInitialAddress(conf, seed);
View Full Code Here

    TTransport transport = sock;
    if (specifyFramed || implType.isAlwaysFramed) {
      transport = new TFramedTransport(transport);
    }

    sock.open();
    try {
      TProtocol prot;
      if (specifyCompact) {
        prot = new TCompactProtocol(transport);
      } else {
View Full Code Here

                                         DatabaseDescriptor.getThriftPort());
            TBinaryProtocol binaryProtocol = new TBinaryProtocol(socket, false, false);
            Cassandra.Client client = new Cassandra.Client(binaryProtocol);
            try
            {
                socket.open();
            }
            catch (TTransportException e)
            {
                throw new RuntimeException(e);
            }
View Full Code Here

                                     DatabaseDescriptor.getThriftPort());
        TBinaryProtocol binaryProtocol = new TBinaryProtocol(socket, false, false);
        Cassandra.Client client = new Cassandra.Client(binaryProtocol);
        try
        {
            socket.open();
        }
        catch (TTransportException e)
        {
            throw new IOException(e);
        }
View Full Code Here

                                     DatabaseDescriptor.getThriftPort());
        TBinaryProtocol binaryProtocol = new TBinaryProtocol(socket, false, false);
        Cassandra.Client client = new Cassandra.Client(binaryProtocol);
        try
        {
            socket.open();
        }
        catch (TTransportException e)
        {
            throw new IOException(e);
        }
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.