Package org.apache.thrift.protocol

Examples of org.apache.thrift.protocol.TProtocol


        try {
            final SettableFuture<Object> future = SettableFuture.create();

            TChannelBufferOutputTransport outTransport = new TChannelBufferOutputTransport();
            TProtocol outProtocol = out.getProtocol(outTransport);
            writeArguments(outProtocol, sequenceId, args);

            // send message and setup listener to handle the response
            channel.sendAsynchronousRequest(outTransport.getOutputBuffer(), false, new NiftyClientChannel.Listener() {
                @Override
                public void onRequestSent() {}

                @Override
                public void onResponseReceived(ChannelBuffer message) {
                    try {
                        TTransport inputTransport = new TChannelBufferInputTransport(message);
                        TProtocol inputProtocol = in.getProtocol(inputTransport);
                        waitForResponse(inputProtocol, sequenceId);
                        Object results = readResponse(inputProtocol);
                        stats.addSuccessTime(nanosSince(start));
                        future.set(results);
                    } catch (Exception e) {
View Full Code Here


    public void invoke()
    {
        assert state == State.READ_FRAME_COMPLETE : "Invoke called in invalid state: " + state;

        TTransport inTrans = getInputTransport();
        TProtocol inProt = thriftFactories.inputProtocolFactory.getProtocol(inTrans);
        TProtocol outProt = thriftFactories.outputProtocolFactory.getProtocol(getOutputTransport());

        try
        {
            thriftFactories.processorFactory.getProcessor(inTrans).process(inProt, outProt);
            responseReady();
View Full Code Here

    }
    public void append(ThriftFlumeEvent evt){
      TTransport transport;
      try {
        transport = new TSocket(host, port);
        TProtocol protocol = new TBinaryProtocol(transport);
        Client client = new Client(protocol);
        transport.open();
        client.append(evt);
        transport.close();
      } catch (TTransportException e) {
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);
      transport.open();
    }
    isClosed = false;
  }
View Full Code Here

  protected void setUp() throws Exception {
    super.setUp();
    if (standAloneServer) {
      try {
        transport = new TSocket(host, port);
        TProtocol protocol = new TBinaryProtocol(transport);
        client = new HiveClient(protocol);
        transport.open();
      }
      catch (Throwable e) {
        e.printStackTrace();
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

          LOG.error("Couldn't create client transport", ioe);
          throw new MetaException(ioe.toString());
        }
     }

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

     try {
        transport.open();
        isConnected = true;
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

        TTransport transport    = new TSocket(
                                    addr.getHostAddress(),
                                    CLIENT_PORT,
                                    200000);
        transport               = new TFramedTransport(transport);
        TProtocol  protocol     = new TBinaryProtocol(transport);

        Cassandra.Client client = new Cassandra.Client(protocol);
        transport.open();

        return client;
View Full Code Here

      try {
        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) {
        throw new SQLException("Could not establish connection to "
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.