Interface Consumer<T extends FieldVector>

Type Parameters:
T - The vector within consumer or its delegate, used for partially consume purpose.
All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
AvroArraysConsumer, AvroBooleanConsumer, AvroBytesConsumer, AvroDateConsumer, AvroDecimalConsumer, AvroDecimalConsumer.BytesDecimalConsumer, AvroDecimalConsumer.FixedDecimalConsumer, AvroDoubleConsumer, AvroEnumConsumer, AvroFixedConsumer, AvroFloatConsumer, AvroIntConsumer, AvroLongConsumer, AvroMapConsumer, AvroNullConsumer, AvroStringConsumer, AvroStructConsumer, AvroTimeMicroConsumer, AvroTimeMillisConsumer, AvroTimestampMicrosConsumer, AvroTimestampMillisConsumer, AvroUnionsConsumer, BaseAvroConsumer, SkipConsumer

public interface Consumer<T extends FieldVector> extends AutoCloseable
Interface that is used to consume values from avro decoder.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add null value to vector by making writer position + 1.
    void
    Close this consumer when occurs exception to avoid potential leak.
    void
    consume(org.apache.avro.io.Decoder decoder)
    Consume a specific type value from avro decoder and write it to vector.
    Get the vector within the consumer.
    boolean
    Reset the vector within consumer for partial read purpose.
    void
    setPosition(int index)
    Set the position to write value into vector.
    default boolean
    Indicates whether the consumer is type of SkipConsumer.
  • Method Details

    • consume

      void consume(org.apache.avro.io.Decoder decoder) throws IOException
      Consume a specific type value from avro decoder and write it to vector.
      Parameters:
      decoder - avro decoder to read data
      Throws:
      IOException - on error
    • addNull

      void addNull()
      Add null value to vector by making writer position + 1.
    • setPosition

      void setPosition(int index)
      Set the position to write value into vector.
    • getVector

      FieldVector getVector()
      Get the vector within the consumer.
    • close

      void close() throws Exception
      Close this consumer when occurs exception to avoid potential leak.
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception
    • resetValueVector

      boolean resetValueVector(T vector)
      Reset the vector within consumer for partial read purpose.
      Returns:
      true if reset is successful, false if reset is not needed.
    • skippable

      default boolean skippable()
      Indicates whether the consumer is type of SkipConsumer.