Package org.apache.thrift.protocol

Examples of org.apache.thrift.protocol.TBinaryProtocol$Factory


    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


  }

  public String toBinaryString() throws IOException {
    org.apache.hadoop.hive.ql.plan.api.Query q = getQueryPlan();
    TMemoryBuffer tmb = new TMemoryBuffer(q.toString().length() * 5);
    TBinaryProtocol oprot = new TBinaryProtocol(tmb);
    try {
      q.write(oprot);
    } catch (TException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

  private void openTransport() throws SQLException {
    transport = isHttpTransportMode() ?
        createHttpTransport() :
          createBinaryTransport();
    TProtocol protocol = new TBinaryProtocol(transport);
    client = new TCLIService.Client(protocol);
    try {
      transport.open();
    } catch (TTransportException e) {
      throw new SQLException("Could not open connection to "
View Full Code Here

            }
          } else if (useFramedTransport) {
            transport = new TFramedTransport(transport);
          }

          client = new ThriftHiveMetastore.Client(new TBinaryProtocol(transport));
          try {
            transport.open();
            isConnected = true;
          } catch (TTransportException e) {
            tte = e;
View Full Code Here

        // random node selection for fake load balancing
        String currentNode = nodes[Stress.randomizer.nextInt(nodes.length)];

        TSocket socket = new TSocket(currentNode, port);
        TTransport transport = (isUnframed()) ? socket : new TFramedTransport(socket);
        Cassandra.Client client = new Cassandra.Client(new TBinaryProtocol(transport));

        try
        {
            transport.open();
View Full Code Here

         * invocation of the factory method, no need to specifically call open()
         */
        transport = TSSLTransportFactory.getClientSocket("localhost", 9091, 0, params);
      }

      TProtocol protocol = new  TBinaryProtocol(transport);
      Calculator.Client client = new Calculator.Client(protocol);

      perform(client);

      transport.close();
View Full Code Here

           
            if (rows != null)
                return;
            TSocket socket = new TSocket(getLocation(),
                                         DatabaseDescriptor.getThriftPort());
            TBinaryProtocol binaryProtocol = new TBinaryProtocol(socket, false, false);
            Cassandra.Client client = new Cassandra.Client(binaryProtocol);
            try
            {
                socket.open();
            }
View Full Code Here

    private List<String> getSubSplits(TokenRange range, int splitsize) throws IOException
    {
        // TODO handle failure of range replicas & retry
        TSocket socket = new TSocket(range.endpoints.get(0),
                                     DatabaseDescriptor.getThriftPort());
        TBinaryProtocol binaryProtocol = new TBinaryProtocol(socket, false, false);
        Cassandra.Client client = new Cassandra.Client(binaryProtocol);
        try
        {
            socket.open();
        }
View Full Code Here

    private List<TokenRange> getRangeMap(String keyspace) throws IOException
    {
        TSocket socket = new TSocket(DatabaseDescriptor.getSeeds().iterator().next().getHostAddress(),
                                     DatabaseDescriptor.getThriftPort());
        TBinaryProtocol binaryProtocol = new TBinaryProtocol(socket, false, false);
        Cassandra.Client client = new Cassandra.Client(binaryProtocol);
        try
        {
            socket.open();
        }
View Full Code Here

    public void init() {
        try {
            final TSocket socket = new TSocket(host, port);
            socket.setTimeout(1000);
            transport = new TFramedTransport(socket);
            final TProtocol protocol = new TBinaryProtocol(transport);
            scribe = new scribe.Client(protocol);
            transport.open();
        } catch (TException e) {
            e.printStackTrace();
        }
View Full Code Here

TOP

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

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.