Examples of TIOStreamTransport


Examples of org.apache.thrift.transport.TIOStreamTransport

          "org.apache.thrift.protocol");
      TProtocolFactory protFactory = TReflectionUtils
          .getProtocolFactoryByName(protoName);
      bos_ = new ByteStream.Output();
      bis_ = new ByteStream.Input();
      tios = new TIOStreamTransport(bis_, bos_);

      oprot_ = protFactory.getProtocol(tios);
      iprot_ = protFactory.getProtocol(tios);

      /**
 
View Full Code Here

Examples of org.apache.thrift.transport.TIOStreamTransport

    /**
     * Get the transport that should be used by the invoker for responding.
     */
    private TTransport getOutputTransport() {
      response_ = new TByteArrayOutputStream();
      return outputTransportFactory_.getTransport(new TIOStreamTransport(response_));
    }
View Full Code Here

Examples of org.apache.thrift.transport.TIOStreamTransport

        }
      }
      InputStream in = request.getInputStream();
      OutputStream out = response.getOutputStream();

      TTransport transport = new TIOStreamTransport(in, out);
      inTransport = transport;
      outTransport = transport;

      TProtocol inProtocol = inProtocolFactory.getProtocol(inTransport);
      TProtocol outProtocol = outProtocolFactory.getProtocol(outTransport);
View Full Code Here

Examples of org.apache.thrift.transport.TIOStreamTransport

      }

      InputStream in = request.getInputStream();
      OutputStream out = response.getOutputStream();

      TTransport transport = new TIOStreamTransport(in, out);
      inTransport = transport;
      outTransport = transport;

      TProtocol inProtocol = inFactory.getProtocol(inTransport);
      TProtocol outProtocol = inFactory.getProtocol(outTransport);
View Full Code Here

Examples of org.apache.thrift.transport.TIOStreamTransport

          "org.apache.thrift.protocol");
      TProtocolFactory protFactory = TReflectionUtils
          .getProtocolFactoryByName(protoName);
      bos_ = new ByteStream.Output();
      bis_ = new ByteStream.Input();
      tios = new TIOStreamTransport(bis_, bos_);

      oprot_ = protFactory.getProtocol(tios);
      iprot_ = protFactory.getProtocol(tios);

      /**
 
View Full Code Here

Examples of org.apache.thrift.transport.TIOStreamTransport

    socket.setSoLinger(false, 0);
    socket.setTcpNoDelay(true);
    socket.connect(addr);
    InputStream input = new BufferedInputStream(getInputStream(socket, timeoutMillis), 1024 * 10);
    OutputStream output = new BufferedOutputStream(NetUtils.getOutputStream(socket, timeoutMillis), 1024 * 10);
    return new TIOStreamTransport(input, output);
  }
View Full Code Here

Examples of org.apache.thrift.transport.TIOStreamTransport

    socket.setSoLinger(false, 0);
    socket.setTcpNoDelay(true);
    socket.connect(addr);
    InputStream input = new BufferedInputStream(new SocketInputStream(socket, timeoutMillis), 1024 * 10);
    OutputStream output = new BufferedOutputStream(new SocketOutputStream(socket, timeoutMillis), 1024 * 10);
    return new TIOStreamTransport(input, output);
  }
View Full Code Here

Examples of org.apache.thrift.transport.TIOStreamTransport

          "org.apache.thrift.protocol");
      TProtocolFactory protFactory = TReflectionUtils
          .getProtocolFactoryByName(protoName);
      bos_ = new ByteStream.Output();
      bis_ = new ByteStream.Input();
      tios = new TIOStreamTransport(bis_, bos_);

      oprot_ = protFactory.getProtocol(tios);
      iprot_ = protFactory.getProtocol(tios);

      /**
 
View Full Code Here

Examples of org.apache.thrift.transport.TIOStreamTransport

        if (setUpComplete) {
            return;
        }

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        TIOStreamTransport transport = new TIOStreamTransport(out);
        TBinaryProtocol protocol = new TBinaryProtocol(transport);

        IntString intString = new IntString(1, "one", 1);
        intString.write(protocol);
        BytesWritable bytesWritable = new BytesWritable(out.toByteArray());
View Full Code Here

Examples of org.apache.thrift.transport.TIOStreamTransport

        SequenceFile.Writer seqFileWriter = SequenceFile.createWriter(
            intStringSeq.getFileSystem(hiveConf), hiveConf, intStringSeq,
            NullWritable.class, BytesWritable.class);

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        TIOStreamTransport transport = new TIOStreamTransport(out);
        TBinaryProtocol protocol = new TBinaryProtocol(transport);

        for (int i = 1; i <= 100; i++) {
            if (i % 10 == 0) {
                seqFileWriter.append(NullWritable.get(), new BytesWritable("bad record".getBytes()));
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.