avro schema php,Apache Avro 介绍

Download

Avro implementations for C, C++, C#, Java, PHP, Python, and Ruby can be downloaded from the Apache Avro™ Releases page. This guide uses Avro 1.7.7, the latest version at the time of writing. For the examples in this guide, download avro-1.7.7.jar and avro-tools-1.7.7.jar. The Avro Java implementation also depends on the Jackson JSON library. From the Jackson download page, download the core-asl and mapper-asl jars. Add avro-1.7.7.jar and the Jackson jars to your project’s classpath (avro-tools will be used for code generation).

Alternatively, if you are using Maven, add the following dependency to your POM:

org.apache.avrogroupId>

avroartifactId>

1.7.7version>

dependency>

As well as the Avro Maven plugin (for performing code generation):

org.apache.avrogroupId>

avro-maven-pluginartifactId>

1.7.7version>

generate-sourcesphase>

schemagoal>

goals>

${project.basedir}/src/main/avro/sourceDirectory>

${project.basedir}/src/main/java/outputDirectory>

configuration>

execution>

executions>

plugin>

org.apache.maven.pluginsgroupId>

maven-compiler-pluginartifactId>

1.6source>

1.6target>

configuration>

plugin>

You may also build the required Avro jars from source. Building Avro is beyond the scope of this guide; see the Build Documentation page in the wiki for more information.