DatumReader for generic Java objects.
| Modifier and Type | Class and Description |
|---|---|
| private static class | GenericDatumReader.IdentitySchemaKey
This class is used to reproduce part of IdentityHashMap in ConcurrentHashMap code. |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private Schema | |
| private final Thread | |
| private ResolvingDecoder | |
| private final GenericData | |
| private Schema | |
| private DatumReader | |
| private final GenericDatumReader. | |
| private static final ThreadLocal |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addToArray(Object array, long pos, Object e)
Called by the default implementation of |
| protected void | |
| protected Object | convert(Object datum, Schema schema, LogicalType type, Conversion<?> conversion)
Convert an underlying representation of a logical type (such as a ByteBuffer) to a higher level object (such as a BigDecimal). |
| protected Object | |
| protected Object | |
| protected Object | createFixed(Object old, Schema schema)
Deprecated
As of Avro 1.6.0 this method has been moved to
Called to create an fixed value.
GenericData#createFixed(Object, Schema)
|
| protected Object | createFixed(Object old, byte[] bytes, Schema schema)
Deprecated
As of Avro 1.6.0 this method has been moved to
Called to create an fixed value.
GenericData#createFixed(Object, byte[], Schema)
|
| protected Object | |
| protected Class | |
| public GenericData | |
| public Schema | |
| pack-priv GenericDatumReader. | |
| protected final ResolvingDecoder | getResolver(Schema actual, Schema expected)
Gets a resolving decoder for use by this GenericDatumReader. |
| public Schema | |
| protected Object | |
| protected Object | |
| protected Object | |
| protected Object | newRecord(Object old, Schema schema)
Deprecated
As of Avro 1.6.0 this method has been moved to
Called to create new record instances.
GenericData#newRecord(Object, Schema)
|
| protected Object | |
| private Object | |
| public D | |
| protected Object | |
| protected Object | |
| protected Object | |
| protected Object | |
| protected Object | |
| protected void | |
| protected Object | |
| protected Object | |
| protected Object | |
| protected Object | readMapKey(Object old, Schema expected, Decoder in)
Called by the default implementation of |
| protected Object | |
| protected Object | |
| protected Object | |
| protected Object | readWithConversion(Object old, Schema expected, LogicalType logicalType, Conversion<?> conversion, ResolvingDecoder in)
|
| protected Object | |
| public void | |
| public void | setSchema(Schema writer)
Implements org. |
| public static void |
| actual | back to summary |
|---|---|
| private Schema actual | |
| creator | back to summary |
|---|---|
| private final Thread creator | |
| creatorResolver | back to summary |
|---|---|
| private ResolvingDecoder creatorResolver | |
| data | back to summary |
|---|---|
| private final GenericData data | |
| expected | back to summary |
|---|---|
| private Schema expected | |
| fastDatumReader | back to summary |
|---|---|
| private DatumReader<D> fastDatumReader | |
| readerCache | back to summary |
|---|---|
| private final GenericDatumReader. | |
| RESOLVER_CACHE | back to summary |
|---|---|
| private static final ThreadLocal<Map<Schema, Map<Schema, ResolvingDecoder>>> RESOLVER_CACHE | |
| GenericDatumReader | back to summary |
|---|---|
| public GenericDatumReader() | |
| GenericDatumReader | back to summary |
|---|---|
| public GenericDatumReader(Schema schema) Construct where the writer's and reader's schemas are the same. | |
| GenericDatumReader | back to summary |
|---|---|
| public GenericDatumReader(Schema writer, Schema reader) Construct given writer's and reader's schema. | |
| GenericDatumReader | back to summary |
|---|---|
| public GenericDatumReader(Schema writer, Schema reader, GenericData data) | |
| GenericDatumReader | back to summary |
|---|---|
| protected GenericDatumReader(GenericData data) | |
| addToArray | back to summary |
|---|---|
| protected void addToArray(Object array, long pos, Object e) Called by the default implementation of
| |
| addToMap | back to summary |
|---|---|
| protected void addToMap(Object map, Object key, Object value) Called by the default implementation of
| |
| convert | back to summary |
|---|---|
| protected Object convert(Object datum, Schema schema, LogicalType type, Conversion<?> conversion) Convert an underlying representation of a logical type (such as a ByteBuffer) to a higher level object (such as a BigDecimal).
| |
| createBytes | back to summary |
|---|---|
| protected Object createBytes(byte[] value) Called to create byte arrays from default values. Subclasses may override to
use a different byte array representation. By default, this calls
| |
| createEnum | back to summary |
|---|---|
| protected Object createEnum(String symbol, Schema schema) Called to create an enum value. May be overridden for alternate enum representations. By default, returns a GenericEnumSymbol. | |
| createFixed | back to summary |
|---|---|
| protected Object createFixed(Object old, Schema schema)
Deprecated As of Avro 1.6.0 this method has been moved to
Called to create an fixed value. May be overridden for alternate fixed
representations. By default, returns
| |
| createFixed | back to summary |
|---|---|
| protected Object createFixed(Object old, byte[] bytes, Schema schema)
Deprecated As of Avro 1.6.0 this method has been moved to
Called to create an fixed value. May be overridden for alternate fixed
representations. By default, returns
| |
| createString | back to summary |
|---|---|
| protected Object createString(String value) Called to create a string from a default value. Subclasses may override to
use a different string representation. By default, this calls
| |
| findStringClass | back to summary |
|---|---|
| protected Class Determines the class to used to represent a string Schema. By default uses
| |
| getData | back to summary |
|---|---|
| public GenericData getData() Return the | |
| getExpected | back to summary |
|---|---|
| public Schema getExpected() Get the reader's schema. | |
| getReaderCache | back to summary |
|---|---|
| pack-priv GenericDatumReader. | |
| getResolver | back to summary |
|---|---|
| protected final ResolvingDecoder getResolver(Schema actual, Schema expected) throws IOException Gets a resolving decoder for use by this GenericDatumReader. Unstable API. Currently uses a thread local cache to prevent constructing the resolvers too often, because that is very expensive. | |
| getSchema | back to summary |
|---|---|
| public Schema getSchema() Return the writer's schema. | |
| newArray | back to summary |
|---|---|
| protected Object newArray(Object old, int size, Schema schema) Called to create new array instances. Subclasses may override to use a
different array implementation. By default, this returns a
| |
| newInstanceFromString | back to summary |
|---|---|
protected Object newInstanceFromString(Class<T> c, String s)
| |
| newMap | back to summary |
|---|---|
| protected Object newMap(Object old, int size) Called to create new array instances. Subclasses may override to use a
different map implementation. By default, this returns a
| |
| newRecord | back to summary |
|---|---|
| protected Object newRecord(Object old, Schema schema)
Deprecated As of Avro 1.6.0 this method has been moved to
Called to create new record instances. Subclasses may override to use a
different record implementation. The returned instance must conform to the
schema provided. If the old object contains fields not present in the schema,
they should either be removed from the old object, or it should create a new
instance that conforms to the schema. By default, this returns a
| |
| peekArray | back to summary |
|---|---|
| protected Object peekArray(Object array) Called by the default implementation of
| |
| pruneArray | back to summary |
|---|---|
| private Object pruneArray(Object object) | |
| read | back to summary |
|---|---|
| public D read(D reuse, Decoder in) throws IOException Implements org. Doc from org. Read a datum. Traverse the schema, depth-first, reading all leaf values in the schema into a datum that is returned. If the provided datum is non-null it may be reused and returned.
| |
| read | back to summary |
|---|---|
| protected Object read(Object old, Schema expected, ResolvingDecoder in) throws IOException Called to read data. | |
| readArray | back to summary |
|---|---|
| protected Object readArray(Object old, Schema expected, ResolvingDecoder in) throws IOException Called to read an array instance. May be overridden for alternate array representations. | |
| readBytes | back to summary |
|---|---|
| protected Object readBytes(Object old, Schema s, Decoder in) throws IOException Called to read byte arrays. Subclasses may override to use a different byte
array representation. By default, this calls
| |
| readBytes | back to summary |
|---|---|
| protected Object readBytes(Object old, Decoder in) throws IOException Called to read byte arrays. Subclasses may override to use a different byte
array representation. By default, this calls
| |
| readEnum | back to summary |
|---|---|
| protected Object readEnum(Schema expected, Decoder in) throws IOException Called to read an enum value. May be overridden for alternate enum representations. By default, returns a GenericEnumSymbol. | |
| readField | back to summary |
|---|---|
| protected void readField(Object record, Schema. Called to read a single field of a record. May be overridden for more efficient or alternate implementations. | |
| readFixed | back to summary |
|---|---|
| protected Object readFixed(Object old, Schema expected, Decoder in) throws IOException Called to read a fixed value. May be overridden for alternate fixed
representations. By default, returns | |
| readInt | back to summary |
|---|---|
| protected Object readInt(Object old, Schema expected, Decoder in) throws IOException Called to read integers. Subclasses may override to use a different integer
representation. By default, this calls | |
| readMap | back to summary |
|---|---|
| protected Object readMap(Object old, Schema expected, ResolvingDecoder in) throws IOException Called to read a map instance. May be overridden for alternate map representations. | |
| readMapKey | back to summary |
|---|---|
| protected Object readMapKey(Object old, Schema expected, Decoder in) throws IOException Called by the default implementation of | |
| readRecord | back to summary |
|---|---|
| protected Object readRecord(Object old, Schema expected, ResolvingDecoder in) throws IOException Called to read a record instance. May be overridden for alternate record representations. | |
| readString | back to summary |
|---|---|
| protected Object readString(Object old, Schema expected, Decoder in) throws IOException Called to read strings. Subclasses may override to use a different string
representation. By default, this calls | |
| readString | back to summary |
|---|---|
| protected Object readString(Object old, Decoder in) throws IOException Called to read strings. Subclasses may override to use a different string
representation. By default, this calls | |
| readWithConversion | back to summary |
|---|---|
| protected Object readWithConversion(Object old, Schema expected, LogicalType logicalType, Conversion<?> conversion, ResolvingDecoder in) throws IOException | |
| readWithoutConversion | back to summary |
|---|---|
| protected Object readWithoutConversion(Object old, Schema expected, ResolvingDecoder in) throws IOException | |
| setExpected | back to summary |
|---|---|
| public void setExpected(Schema reader) Set the reader's schema. | |
| setSchema | back to summary |
|---|---|
| public void setSchema(Schema writer) Implements org. Doc from org. Set the writer's schema.
| |
| skip | back to summary |
|---|---|
| public static void skip(Schema schema, Decoder in) throws IOException Skip an instance of a schema. | |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final Schema |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. |
| public int |
| hashcode | back to summary |
|---|---|
| private final int hashcode | |
| schema | back to summary |
|---|---|
| private final Schema schema | |
| IdentitySchemaKey | back to summary |
|---|---|
| public IdentitySchemaKey(Schema schema) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Function | |
| private final Map | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private Function | |
| public Class | |
| public Object |
| findStringClass | back to summary |
|---|---|
| private final Function<Schema, Class<T>> findStringClass | |
| stringClassCache | back to summary |
|---|---|
| private final Map<GenericDatumReader. | |
| stringCtorCache | back to summary |
|---|---|
| private final Map<Class<T>, Function<String, Object>> stringCtorCache | |
| ReaderCache | back to summary |
|---|---|
| public ReaderCache(Function<Schema, Class<T>> findStringClass) | |
| buildFunction | back to summary |
|---|---|
| private Function | |
| getStringClass | back to summary |
|---|---|
| public Class | |
| newInstanceFromString | back to summary |
|---|---|
| public Object newInstanceFromString(Class<T> c, String s) | |