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
Base class for non-skippable avro consumers.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addNull()
Add null value to vector by making writer position + 1.void
close()
Close this consumer when occurs exception to avoid potential leak.Get the vector within the consumer.boolean
resetValueVector
(T vector) Reset the vector within consumer for partial read purpose.void
setPosition
(int index) Set the position to write value into vector.
-
Field Details
-
vector
-
currentIndex
protected int currentIndex
-
-
Constructor Details
-
BaseAvroConsumer
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 interfaceConsumer<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 interfaceConsumer<T extends FieldVector>
-
getVector
Description copied from interface:Consumer
Get the vector within the consumer.- Specified by:
getVector
in interfaceConsumer<T extends FieldVector>
-
close
Description copied from interface:Consumer
Close this consumer when occurs exception to avoid potential leak.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceConsumer<T extends FieldVector>
- Throws:
Exception
-
resetValueVector
Description copied from interface:Consumer
Reset the vector within consumer for partial read purpose.- Specified by:
resetValueVector
in interfaceConsumer<T extends FieldVector>
- Returns:
- true if reset is successful, false if reset is not needed.
-