Class EventBasedThriftReader


  • public final class EventBasedThriftReader
    extends Object
    Event based reader for Thrift
    • Constructor Detail

      • EventBasedThriftReader

        public EventBasedThriftReader​(org.apache.thrift.protocol.TProtocol protocol)
        Parameters:
        protocol - the protocol to read from
    • Method Detail

      • readStruct

        public void readStruct​(FieldConsumer c)
                        throws org.apache.thrift.TException
        reads a Struct from the underlying protocol and passes the field events to the FieldConsumer
        Parameters:
        c - the field consumer
        Throws:
        org.apache.thrift.TException - if any thrift related error occurs during the reading
      • readStructContent

        public void readStructContent​(FieldConsumer c)
                               throws org.apache.thrift.TException
        reads the content of a struct (fields) from the underlying protocol and passes the events to c
        Parameters:
        c - the field consumer
        Throws:
        org.apache.thrift.TException - if any thrift related error occurs during the reading
      • readSetContent

        public void readSetContent​(TypedConsumer.SetConsumer eventConsumer,
                                   org.apache.thrift.protocol.TSet tSet)
                            throws org.apache.thrift.TException
        reads the set content (elements) from the underlying protocol and passes the events to the set event consumer
        Parameters:
        eventConsumer - the consumer
        tSet - the set descriptor
        Throws:
        org.apache.thrift.TException - if any thrift related error occurs during the reading
      • readMapContent

        public void readMapContent​(TypedConsumer.MapConsumer eventConsumer,
                                   org.apache.thrift.protocol.TMap tMap)
                            throws org.apache.thrift.TException
        reads the map content (key values) from the underlying protocol and passes the events to the map event consumer
        Parameters:
        eventConsumer - the consumer
        tMap - the map descriptor
        Throws:
        org.apache.thrift.TException - if any thrift related error occurs during the reading
      • readMapEntry

        public void readMapEntry​(byte keyType,
                                 TypedConsumer keyConsumer,
                                 byte valueType,
                                 TypedConsumer valueConsumer)
                          throws org.apache.thrift.TException
        reads a key-value pair
        Parameters:
        keyType - the type of the key
        keyConsumer - the consumer for the key
        valueType - the type of the value
        valueConsumer - the consumer for the value
        Throws:
        org.apache.thrift.TException - if any thrift related error occurs during the reading
      • readListContent

        public void readListContent​(TypedConsumer.ListConsumer eventConsumer,
                                    org.apache.thrift.protocol.TList tList)
                             throws org.apache.thrift.TException
        reads the list content (elements) from the underlying protocol and passes the events to the list event consumer
        Parameters:
        eventConsumer - the consumer
        tList - the list descriptor
        Throws:
        org.apache.thrift.TException - if any thrift related error occurs during the reading