Package org.apache.thrift.protocol

Examples of org.apache.thrift.protocol.TProtocol


      TSocket socket = new TSocket(HOST, PORT);
      socket.setTimeout(SOCKET_TIMEOUT);
      TTransport transport = getClientTransport(socket);

      TProtocol protocol = protoFactory.getProtocol(transport);
      ThriftTest.Client testClient = new ThriftTest.Client(protocol);

      open(transport);
      testVoid(testClient);
      testString(testClient);
View Full Code Here


  public void testSerialization() throws Exception {
    TestUnion union = new TestUnion(TestUnion._Fields.I32_FIELD, 25);

    TMemoryBuffer buf = new TMemoryBuffer(0);
    TProtocol proto = new TBinaryProtocol(buf);

    union.write(proto);

    TestUnion u2 = new TestUnion();
View Full Code Here

  public void testSerialization() throws Exception {
    TestUnion union = new TestUnion(TestUnion._Fields.I32_FIELD, 25);

    TMemoryBuffer buf = new TMemoryBuffer(0);
    TProtocol proto = new TBinaryProtocol(buf);

    union.write(proto);

    TestUnion u2 = new TestUnion();
View Full Code Here

      TSocket socket = new TSocket(HOST, PORT);
      socket.setTimeout(SOCKET_TIMEOUT);
      transport = socket;
      transport = new TFramedTransport(transport);

      TProtocol protocol = protoFactory.getProtocol(transport);
      ThriftTest.Client testClient = new ThriftTest.Client(protocol);

      transport.open();
      testVoid(testClient);
      testString(testClient);
View Full Code Here

  @Test
  public void testScribeMessage() throws Exception {
    TTransport transport = new TFramedTransport(new TSocket("localhost", port));

    TProtocol protocol = new TBinaryProtocol(transport);
    Scribe.Client client = new Scribe.Client(protocol);
    transport.open();
    LogEntry logEntry = new LogEntry("INFO", "Sending info msg to scribe source");
    List<LogEntry> logEntries = new ArrayList<LogEntry>(1);
    logEntries.add(logEntry);
View Full Code Here

  @Test
  public void testScribeMultipleMessages() throws Exception {
    TTransport transport = new TFramedTransport(new TSocket("localhost", port));

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

    List<LogEntry> logEntries = new ArrayList<LogEntry>(10);
    for (int i = 0; i < 10; i++) {
View Full Code Here

  private static final int SECONDS = 1000;

  public Connection(String host, int port) throws TTransportException {
    TSocket socket = new TSocket(host, port);
    socket.setTimeout(10 * SECONDS);
    TProtocol protocol = new TBinaryProtocol(socket);

    client = new Classifier.Client(protocol);
    this.transport = socket;
    this.transport.open();
  }
View Full Code Here

            input = httpRequest.getContent();
        } else {
            input = (ChannelBuffer)e.getMessage();
        }
        ChannelBuffer output = ChannelBuffers.dynamicBuffer(responseSize);
        TProtocol protocol = protocolFactory.getProtocol(new TNettyChannelBuffer(input, output));

        processor.process(protocol, protocol);

        if (httpRequest != null) {
            HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
View Full Code Here

    @Override
    public void setup() throws TException {
        final TSocket socket = new TSocket(host, port);
        socket.setTimeout(timeout);
        transport = new TFramedTransport(socket);
        final TProtocol protocol = new TBinaryProtocol(transport);
        client = new ZipkinCollector.Client(protocol);
        transport.open();
    }
View Full Code Here

        return new LogEntry("zipkin", spanAsString);
    }

    private byte[] spanToBytes(final Span thriftSpan) throws TException {
        final ByteArrayOutputStream buf = new ByteArrayOutputStream();
        final TProtocol proto = protocolFactory.getProtocol(new TIOStreamTransport(buf));
        thriftSpan.write(proto);
        return buf.toByteArray();
    }
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.