Examples of readStructBegin()


Examples of org.apache.hadoop.hive.serde2.thrift.TCTLSeparatedProtocol.readStructBegin()

    trans.write(b, 0, len);

    prot = new TCTLSeparatedProtocol(trans, 3);
    prot.initialize(new Configuration(), new Properties());

    prot.readStructBegin();

    prot.readFieldBegin();
    String ret = prot.readString();
    prot.readFieldEnd();
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.thrift.TCTLSeparatedProtocol.readStructBegin()

      public void write(byte[] buf, int off, int len) throws TTransportException {
      }
    });
    separatedProtocol.initialize(null, new Properties());
    try {
      separatedProtocol.readStructBegin();
      fail("Runtime Exception is expected if the intialization of tokenizer failed.");
    } catch (Exception e) {
      assertTrue(e.getCause() instanceof TTransportException);
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.thrift.TCTLSeparatedProtocol.readStructBegin()

    trans = new TMemoryBuffer(4096);
    trans.write(b, 0, len);
    prot = new TCTLSeparatedProtocol(trans, 1024);
    prot.initialize(new Configuration(), schema);

    prot.readStructBegin();
    prot.readFieldBegin();
    final String firstRead = prot.readString();
    prot.readFieldEnd();

    testStr = testStr.replace("\"", "");
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.thrift.TCTLSeparatedProtocol.readStructBegin()

    schema.setProperty(Constants.FIELD_DELIM, " ");
    schema.setProperty(Constants.SERIALIZATION_NULL_FORMAT, "-");
    prot.initialize(new Configuration(), schema);

    prot.readStructBegin();

    // ip address
    prot.readFieldBegin();
    final String ip = prot.readString();
    prot.readFieldEnd();
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.thrift.TCTLSeparatedProtocol.readStructBegin()

    trans.write(b, 0, len);

    prot = new TCTLSeparatedProtocol(trans, 3);
    prot.initialize(new Configuration(), new Properties());

    prot.readStructBegin();

    prot.readFieldBegin();
    String ret = prot.readString();
    prot.readFieldEnd();
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.thrift.TCTLSeparatedProtocol.readStructBegin()

    // use 3 as the row buffer size to force lots of re-buffering.
    TCTLSeparatedProtocol prot = new TCTLSeparatedProtocol(trans, 1024);
    prot.initialize(new Configuration(), new Properties());

    prot.readStructBegin();

    prot.readFieldBegin();
    String hello = prot.readString();
    prot.readFieldEnd();
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.thrift.TCTLSeparatedProtocol.readStructBegin()

    prot = new TCTLSeparatedProtocol(trans, 10);
    prot.initialize(new Configuration(), new Properties());

    // 100 is the start
    prot.readStructBegin();
    prot.readFieldBegin();
    assertTrue(prot.readI32() == 100);
    prot.readFieldEnd();

    // let's see if doubles work ok
View Full Code Here

Examples of org.apache.thrift.protocol.TProtocol.readStructBegin()

          new ByteArrayInputStream(bytes)));

    // index into field ID path being currently searched for
    int curPathIndex = 0;

    iprot.readStructBegin();

    while (curPathIndex < fieldIdPath.length) {
      TField field = iprot.readFieldBegin();
      // we can stop searching if we either see a stop or we go past the field
      // id we're looking for (since fields should now be serialized in asc
View Full Code Here

Examples of org.apache.thrift.protocol.TProtocol.readStructBegin()

        iprot.readFieldEnd();
      } else {
        // This field is the next step in the path. Step into field.
        curPathIndex++;
        if (curPathIndex < fieldIdPath.length) {
          iprot.readStructBegin();
        }
      }
    }

    // when this line is reached, iprot will be positioned at the start of tb.
View Full Code Here

Examples of org.apache.thrift.protocol.TProtocol.readStructBegin()

    proto.writeFieldEnd();
    proto.writeStructEnd();
   
    // System.out.println(buf.inspect());

    proto.readStructBegin();
    TField readField = proto.readFieldBegin();
    // TODO: verify the field is as expected
    if (!field.equals(readField)) {
      throw new RuntimeException("Expected " + field + " but got " + readField);
    }
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.