Java Code Examples for org.apache.thrift.protocol.TProtocol#readSetEnd()

The following examples show how to use org.apache.thrift.protocol.TProtocol#readSetEnd() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BufferedProtocolReadToWrite.java    From parquet-mr with Apache License 2.0 6 votes vote down vote up
private boolean readOneSet(TProtocol in, List<Action> buffer, SetType expectedType) throws TException {
  final TSet set = in.readSetBegin();
  buffer.add(new Action() {
    @Override
    public void write(TProtocol out) throws TException {
      out.writeSetBegin(set);
    }

    @Override
    public String toDebugString() {
      return "<e=" + set.elemType + ", s=" + set.size + ">{*";
    }
  });

  boolean hasFieldsIgnored = readCollectionElements(in, set.size, set.elemType, buffer, expectedType.getValues().getType());
  in.readSetEnd();
  buffer.add(SET_END);
  return hasFieldsIgnored;
}
 
Example 2
Source File: SetTypeAdapterFactory.java    From Firefly with Apache License 2.0 5 votes vote down vote up
@Override
public Set read(TProtocol protocol) throws TException {
    TSet tset = protocol.readSetBegin();
    HashSet hashSet = new HashSet(tset.size);
    for (int i = 0, n = tset.size; i < n; i++) {
        hashSet.add(valueTypeAdapter.read(protocol));
    }
    protocol.readSetEnd();
    return hashSet;
}
 
Example 3
Source File: ProtocolReadToWrite.java    From parquet-mr with Apache License 2.0 5 votes vote down vote up
private void readOneSet(TProtocol in, TProtocol out) throws TException {
  final TSet set = in.readSetBegin();
  out.writeSetBegin(set);
  readCollectionElements(in, out, set.size, set.elemType);
  in.readSetEnd();
  out.writeSetEnd();
}
 
Example 4
Source File: TypedConsumer.java    From parquet-format with Apache License 2.0 4 votes vote down vote up
@Override
final void read(TProtocol protocol, EventBasedThriftReader reader) throws TException {
  this.consumeSet(protocol, reader, protocol.readSetBegin());
  protocol.readSetEnd();
}
 
Example 5
Source File: TypedConsumer.java    From parquet-mr with Apache License 2.0 4 votes vote down vote up
@Override
final void read(TProtocol protocol, EventBasedThriftReader reader) throws TException {
  this.consumeSet(protocol, reader, protocol.readSetBegin());
  protocol.readSetEnd();
}