Search in sources :

Example 16 with TList

use of org.apache.thrift.protocol.TList in project pinpoint by naver.

the class TReplaceListProtocol method writeListBegin.

@Override
public void writeListBegin(TList list) throws TException {
    if (!writeFieldBegin) {
        protocol.writeListBegin(list);
        return;
    }
    if (writeListDepth == 0 && currentField != null) {
        List<ByteArrayOutput> outputs = replaceFields.get(currentField.name);
        if (outputs == null) {
            throw new TException("not found replace field - " + currentField.name);
        }
        final TList replaceList = new TList(list.elemType, outputs.size());
        protocol.writeListBegin(replaceList);
        for (ByteArrayOutput output : outputs) {
            try {
                final OutputStream out = ((ByteArrayOutputStreamTransport) getTransport()).getByteArrayOutputStream();
                output.writeTo(out);
            } catch (IOException e) {
                throw new TException(e);
            }
        }
    }
    writeListDepth++;
}
Also used : TException(org.apache.thrift.TException) TList(org.apache.thrift.protocol.TList) OutputStream(java.io.OutputStream) IOException(java.io.IOException)

Example 17 with TList

use of org.apache.thrift.protocol.TList in project elephant-bird by twitter.

the class ThriftProtocolWrapper method readListBegin.

@Override
public TList readListBegin() throws TException {
    TList list = wrapped.readListBegin();
    checkContainerElemType(list.elemType);
    return list;
}
Also used : TList(org.apache.thrift.protocol.TList)

Example 18 with TList

use of org.apache.thrift.protocol.TList in project parquet-mr by apache.

the class DefaultEventsVisitor method visit.

@Override
public Void visit(final ThriftType.ListType listType, Void v) {
    dummyEvents.add(new ParquetProtocol("readListBegin()") {

        @Override
        public TList readListBegin() throws TException {
            return new TList();
        }
    });
    dummyEvents.add(new ParquetProtocol("readListEnd()") {

        @Override
        public void readListEnd() throws TException {
        }
    });
    return null;
}
Also used : TException(org.apache.thrift.TException) TList(org.apache.thrift.protocol.TList) ParquetProtocol(org.apache.parquet.thrift.ParquetProtocol)

Aggregations

TList (org.apache.thrift.protocol.TList)18 TMap (org.apache.thrift.protocol.TMap)5 ArrayList (java.util.ArrayList)4 List (java.util.List)4 TSet (org.apache.thrift.protocol.TSet)4 Map (java.util.Map)3 TException (org.apache.thrift.TException)3 TField (org.apache.thrift.protocol.TField)3 TProtocol (org.apache.thrift.protocol.TProtocol)3 EnumMap (java.util.EnumMap)2 HashMap (java.util.HashMap)2 Properties (java.util.Properties)2 PList (net.morimekta.providence.descriptor.PList)2 PMap (net.morimekta.providence.descriptor.PMap)2 PSet (net.morimekta.providence.descriptor.PSet)2 Configuration (org.apache.hadoop.conf.Configuration)2 TCTLSeparatedProtocol (org.apache.hadoop.hive.serde2.thrift.TCTLSeparatedProtocol)2 Consumer (org.apache.parquet.format.event.Consumers.Consumer)2 ListConsumer (org.apache.parquet.format.event.TypedConsumer.ListConsumer)2 StructConsumer (org.apache.parquet.format.event.TypedConsumer.StructConsumer)2