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
Interface that is used to consume values from avro decoder.
-
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.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
resetValueVector
(T vector) 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 ofSkipConsumer
.
-
Method Details
-
consume
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
Close this consumer when occurs exception to avoid potential leak.- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
resetValueVector
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 ofSkipConsumer
.
-