/[Apache-SVN]
ViewVC logotype

Revision 1074612


Jump to revision: Previous Next
Author: dcreager
Date: Fri Feb 25 16:17:56 2011 UTC (13 years, 1 month ago)
Changed paths: 14
Log Message:
AVRO-762. C: Better schema resolution

This patch adds a new class that implements Avro's schema resolution
rules.  Before, the writer and reader schemas were resolved each time a
datum was read from an Avro file.  Now, we can examine the two schemas
before reading and data values, and "remember" the resolution result in
a tree of avro_resolver_t objects.  The avro_resolver_new function
creates this tree of resolvers.  The result is an instance of a generic
"consumer" interface, which is an abstract API for consuming Avro data
that conforms to some writer schema.  In this case, the resolver
implementation of the consumer API fills in an avro_datum_t that
conforms to the reader schema, promoting data and dropping fields as
necessary.  The avro_consume_binary function takes care of parsing the
Avro binary encoding, passing off the data that it reads in to a
consumer.

We currently don't support the AVRO_LINK schema type; we'll need to add
some memoization to handle recursive schemas properly.


Changed paths

Path Details
Directoryavro/trunk/CHANGES.txt modified , text changed
Directoryavro/trunk/lang/c/src/CMakeLists.txt modified , text changed
Directoryavro/trunk/lang/c/src/Makefile.am modified , text changed
Directoryavro/trunk/lang/c/src/avro/ added
Directoryavro/trunk/lang/c/src/avro/consumer.h added
Directoryavro/trunk/lang/c/src/avro.h modified , text changed
Directoryavro/trunk/lang/c/src/consumer.c added
Directoryavro/trunk/lang/c/src/datum_read.c modified , text changed
Directoryavro/trunk/lang/c/src/encoding_binary.c modified , text changed
Directoryavro/trunk/lang/c/src/resolver.c added
Directoryavro/trunk/lang/c/src/schema.c modified , text changed
Directoryavro/trunk/lang/c/src/schema.h modified , text changed
Directoryavro/trunk/lang/c/tests/test_avro_data.c modified , text changed
Directoryavro/trunk/lang/c/tests/test_avro_schema.c modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26