Skip to content

RyanSkraba/avro-enchiridion

Repository files navigation

The Avro Enchiridion

Java CI

Enchiridion: A small manual or handbook. It's a bit like a tech cook book, but a bigger, fancier, SEO-optimizabler word.

This project describes how to do many common Java tasks using the Avro serialization library.

The main project uses the latest release of Avro 1.11.0, but includes modules that run the same tests on previous versions of Avro.

Modules

module description
avro-resources Reusable resources for testing Avro (Schema JSON strings, etc).
core Unit tests and examples for the Avro Java SDK.
core17x Helper project for running tests in Avro 1.7.x
core18x Helper project for running tests in Avro 1.8.x
core19x Helper project for running tests in Avro 1.9.x
core-master-snapshot Helper project for running tests in the latest SNAPSHOT releases from the Avro master branch.
ipc Unit tests and examples for client/server communication with Avro protocols.
plugin Using the maven plugin to generate Avro classes.

Java Topics

I want to... See...
Read/write one datum to a byte array SerializeToBytesTest
Read/write one datum to a ByteBuffer SerializeToBytesTest
Read/write one datum to an Avro JSON String SerializeToJsonTest
Read from/write to an Avro file AvroFileTest
Append a record to an Avro file AvroFileTest

Logical Types (spec)

I want to... See...
Use BigDecimal datum with a GenericData model DecimalPrecisionAndScaleTest (see the static block)
Create my own logical type TODO

Schema resolution (spec)

I want to... See...
Evolve my schema by adding a field EvolveAddAFieldTest
... by removing a field EvolveRemoveAFieldTest
... by renaming a field EvolveRenameAFieldTest
... by reordering fields EvolveReorderFieldsTest
... by widening a primitive EvolveWidenPrimitivesTest
... by adding a union EvolveUnionTest
... by adding an enum symbol
... by removing an enum symbol

Building an Apache Avro SNAPSHOT locally.

# Get the Avro source code.
git clone git@github.com:apache/avro.git

# Create an Avro docker image with all of the necessary tools. 
cd avro
./build.sh docker

# Run a container with your local .m2 mounted
docker run --rm -t -i \
  -v $PWD:$HOME/avro -w $HOME/avro \
  -v $HOME/.m2:$HOME/.m2 \
  -u $USER avro-build-$USER \
  ./build.sh test

Apache Avro™, Avro™, Apache®, and the Apache feather logo are either registered trademarks or trademarks of The Apache Software Foundation.

About

A small manual or handbook for Apache Avro

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published