Package org.apache.avro
Class Resolver.RecordAdjust
java.lang.Object
org.apache.avro.Resolver.Action
org.apache.avro.Resolver.RecordAdjust
- Enclosing class:
Resolver
Instructions for resolving two record schemas. Includes instructions on how
to recursively resolve each field, an indication of when to skip (writer
fields), plus information about which reader fields should be populated by
defaults (because the writer doesn't have corresponding fields).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.avro.Resolver.Action
Resolver.Action.Type
-
Field Summary
Modifier and TypeFieldDescriptionfinal Object[]
Contains the default values to be used for the last readerOrder.length-firstDefault fields in rearderOrder.final Resolver.Action[]
An action for each field of the writer.final int
Pointer intoreaderOrder
of the first reader field whose value comes from a default value.Supplier that offers an optimized alternative to data.newRecord()final Schema.Field[]
Contains (all of) the reader's fields.Fields inherited from class org.apache.avro.Resolver.Action
conversion, logicalType, reader, type, writer
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true iffi == readerOrder[i].pos()
for all indicesi
.
-
Field Details
-
fieldActions
An action for each field of the writer. If the corresponding field is to be skipped during reading, then this will contain aResolver.Skip
. For fields to be read into the reading datum, will contain a regular action for resolving the writer/reader schemas of the matching fields. -
readerOrder
Contains (all of) the reader's fields. The first n of these are the fields that will be read from the writer: these n are in the order dictated by writer's schema. The remaining m fields will be read from default values (actions for these default values are found indefaults
. -
firstDefault
public final int firstDefaultPointer intoreaderOrder
of the first reader field whose value comes from a default value. Set to length ofreaderOrder
if there are none. -
defaults
Contains the default values to be used for the last readerOrder.length-firstDefault fields in rearderOrder. The ith element of defaults is the default value for the i+firstDefault member of readerOrder. -
instanceSupplier
Supplier that offers an optimized alternative to data.newRecord()
-
-
Method Details
-
noReorder
public boolean noReorder()Returns true iffi == readerOrder[i].pos()
for all indicesi
. Which is to say: the order of the reader's fields is the same in both the reader's and writer's schema.
-