Class BaseAvroConsumer<T extends FieldVector>

java.lang.Object
org.apache.arrow.adapter.avro.consumers.BaseAvroConsumer<T>
Type Parameters:
T - vector type.
All Implemented Interfaces:
AutoCloseable, Consumer<T>
Direct Known Subclasses:
AvroArraysConsumer, AvroBooleanConsumer, AvroBytesConsumer, AvroDateConsumer, AvroDecimalConsumer, AvroDoubleConsumer, AvroEnumConsumer, AvroFixedConsumer, AvroFloatConsumer, AvroIntConsumer, AvroLongConsumer, AvroMapConsumer, AvroNullConsumer, AvroStringConsumer, AvroStructConsumer, AvroTimeMicroConsumer, AvroTimeMillisConsumer, AvroTimestampMicrosConsumer, AvroTimestampMillisConsumer, AvroUnionsConsumer

public abstract class BaseAvroConsumer<T extends FieldVector> extends Object implements Consumer<T>
Base class for non-skippable avro consumers.
  • Field Details

    • vector

      protected T extends FieldVector vector
    • currentIndex

      protected int currentIndex
  • Constructor Details

    • BaseAvroConsumer

      public BaseAvroConsumer(T vector)
      Constructs a base avro consumer.
      Parameters:
      vector - the vector to consume.
  • Method Details

    • addNull

      public void addNull()
      Description copied from interface: Consumer
      Add null value to vector by making writer position + 1.
      Specified by:
      addNull in interface Consumer<T extends FieldVector>
    • setPosition

      public void setPosition(int index)
      Description copied from interface: Consumer
      Set the position to write value into vector.
      Specified by:
      setPosition in interface Consumer<T extends FieldVector>
    • getVector

      public FieldVector getVector()
      Description copied from interface: Consumer
      Get the vector within the consumer.
      Specified by:
      getVector in interface Consumer<T extends FieldVector>
    • close

      public void close() throws Exception
      Description copied from interface: Consumer
      Close this consumer when occurs exception to avoid potential leak.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Consumer<T extends FieldVector>
      Throws:
      Exception
    • resetValueVector

      public boolean resetValueVector(T vector)
      Description copied from interface: Consumer
      Reset the vector within consumer for partial read purpose.
      Specified by:
      resetValueVector in interface Consumer<T extends FieldVector>
      Returns:
      true if reset is successful, false if reset is not needed.