HADOOP-7264. Bump avro version to at least 1.4.1. Contributed by Alejandro Abdelnur

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159699 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas White 2011-08-19 17:26:42 +00:00
parent 9a6122141a
commit 6ee5a73e0e
11 changed files with 57 additions and 44 deletions

View File

@ -328,6 +328,9 @@ Trunk (unreleased changes)
HADOOP-7555. Add a eclipse-generated files to .gitignore. (atm) HADOOP-7555. Add a eclipse-generated files to .gitignore. (atm)
HADOOP-7264. Bump avro version to at least 1.4.1. (Alejandro Abdelnur via
tomwhite)
OPTIMIZATIONS OPTIMIZATIONS
HADOOP-7333. Performance improvement in PureJavaCrc32. (Eric Caspole HADOOP-7333. Performance improvement in PureJavaCrc32. (Eric Caspole

View File

@ -219,10 +219,15 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.hadoop</groupId> <groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId> <artifactId>avro</artifactId>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro-ipc</artifactId>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>net.sf.kosmosfs</groupId> <groupId>net.sf.kosmosfs</groupId>
<artifactId>kfs</artifactId> <artifactId>kfs</artifactId>
@ -322,6 +327,23 @@
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile> <excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-avro-test-sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>schema</goal>
<goal>protocol</goal>
</goals>
</execution>
</executions>
<configuration>
<testOutputDirectory>${project.build.directory}/generated-test-sources/java</testOutputDirectory>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId> <artifactId>maven-antrun-plugin</artifactId>
@ -359,24 +381,6 @@
<recordcc destdir="${project.build.directory}/generated-test-sources/java"> <recordcc destdir="${project.build.directory}/generated-test-sources/java">
<fileset dir="${basedir}/src/test/ddl" includes="**/*.jr"/> <fileset dir="${basedir}/src/test/ddl" includes="**/*.jr"/>
</recordcc> </recordcc>
<taskdef name="schema" classname="org.apache.avro.specific.SchemaTask">
<classpath refid="maven.test.classpath"/>
</taskdef>
<schema destdir="${project.build.directory}/generated-test-sources/java">
<fileset dir="${basedir}/src/test">
<include name="**/*.avsc"/>
</fileset>
</schema>
<taskdef name="schema" classname="org.apache.avro.specific.ProtocolTask">
<classpath refid="maven.test.classpath"/>
</taskdef>
<schema destdir="${project.build.directory}/generated-test-sources/java">
<fileset dir="${basedir}/src/test">
<include name="**/*.avpr"/>
</fileset>
</schema>
</target> </target>
</configuration> </configuration>
</execution> </execution>

View File

@ -28,6 +28,7 @@
import org.apache.avro.io.DatumReader; import org.apache.avro.io.DatumReader;
import org.apache.avro.io.DatumWriter; import org.apache.avro.io.DatumWriter;
import org.apache.avro.io.DecoderFactory; import org.apache.avro.io.DecoderFactory;
import org.apache.avro.io.EncoderFactory;
import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.conf.Configured; import org.apache.hadoop.conf.Configured;
@ -93,7 +94,7 @@ public void close() throws IOException {
@Override @Override
public void open(OutputStream out) throws IOException { public void open(OutputStream out) throws IOException {
outStream = out; outStream = out;
encoder = new BinaryEncoder(out); encoder = EncoderFactory.get().binaryEncoder(out, encoder);
} }
@Override @Override
@ -127,7 +128,7 @@ public T deserialize(T t) throws IOException {
@Override @Override
public void open(InputStream in) throws IOException { public void open(InputStream in) throws IOException {
inStream = in; inStream = in;
decoder = DecoderFactory.defaultFactory().createBinaryDecoder(in, null); decoder = DecoderFactory.get().binaryDecoder(in, decoder);
} }
} }

View File

@ -34,9 +34,9 @@
import org.apache.avro.ipc.Responder; import org.apache.avro.ipc.Responder;
import org.apache.avro.ipc.Transceiver; import org.apache.avro.ipc.Transceiver;
import org.apache.avro.reflect.ReflectRequestor; import org.apache.avro.ipc.reflect.ReflectRequestor;
import org.apache.avro.reflect.ReflectResponder; import org.apache.avro.ipc.reflect.ReflectResponder;
import org.apache.avro.specific.SpecificRequestor; import org.apache.avro.ipc.specific.SpecificRequestor;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.classification.InterfaceStability;

View File

@ -22,8 +22,8 @@
import org.apache.avro.ipc.Responder; import org.apache.avro.ipc.Responder;
import org.apache.avro.ipc.Transceiver; import org.apache.avro.ipc.Transceiver;
import org.apache.avro.specific.SpecificRequestor; import org.apache.avro.ipc.specific.SpecificRequestor;
import org.apache.avro.specific.SpecificResponder; import org.apache.avro.ipc.specific.SpecificResponder;
import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.classification.InterfaceStability;
/** /**

View File

@ -18,15 +18,16 @@
package org.apache.hadoop.io; package org.apache.hadoop.io;
import java.io.IOException; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import org.apache.avro.Schema; import org.apache.avro.Schema;
import org.apache.avro.io.BinaryEncoder;
import org.apache.avro.io.EncoderFactory;
import org.apache.avro.reflect.ReflectData; import org.apache.avro.reflect.ReflectData;
import org.apache.avro.reflect.ReflectDatumWriter; import org.apache.avro.reflect.ReflectDatumWriter;
import org.apache.avro.reflect.ReflectDatumReader; import org.apache.avro.reflect.ReflectDatumReader;
import org.apache.avro.io.BinaryEncoder;
import org.apache.avro.io.DecoderFactory; import org.apache.avro.io.DecoderFactory;
import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertEquals;
@ -47,11 +48,11 @@ public static void testReflect(Object value, Type type, String schema)
// check that value is serialized correctly // check that value is serialized correctly
ReflectDatumWriter<Object> writer = new ReflectDatumWriter<Object>(s); ReflectDatumWriter<Object> writer = new ReflectDatumWriter<Object>(s);
ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream();
writer.write(value, new BinaryEncoder(out)); writer.write(value, EncoderFactory.get().directBinaryEncoder(out, null));
ReflectDatumReader<Object> reader = new ReflectDatumReader<Object>(s); ReflectDatumReader<Object> reader = new ReflectDatumReader<Object>(s);
Object after = Object after =
reader.read(null, DecoderFactory.defaultFactory().createBinaryDecoder( reader.read(null,
out.toByteArray(), null)); DecoderFactory.get().binaryDecoder(out.toByteArray(), null));
assertEquals(value, after); assertEquals(value, after);
} }

View File

@ -18,7 +18,7 @@
package org.apache.hadoop.ipc; package org.apache.hadoop.ipc;
import org.apache.avro.ipc.AvroRemoteException; import org.apache.avro.AvroRemoteException;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public interface AvroTestProtocol { public interface AvroTestProtocol {

View File

@ -28,7 +28,7 @@
import junit.framework.Assert; import junit.framework.Assert;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.apache.avro.ipc.AvroRemoteException; import org.apache.avro.AvroRemoteException;
import org.apache.avro.util.Utf8; import org.apache.avro.util.Utf8;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@ -189,7 +189,7 @@ private void testSpecific(boolean secure) throws Exception {
(AvroSpecificTestProtocol)RPC.getProxy(AvroSpecificTestProtocol.class, (AvroSpecificTestProtocol)RPC.getProxy(AvroSpecificTestProtocol.class,
0, addr, conf); 0, addr, conf);
Utf8 echo = proxy.echo(new Utf8("hello world")); CharSequence echo = proxy.echo("hello world");
assertEquals("hello world", echo.toString()); assertEquals("hello world", echo.toString());
int intResult = proxy.add(1, 2); int intResult = proxy.add(1, 2);
@ -210,7 +210,7 @@ public int add(int arg1, int arg2) throws AvroRemoteException {
} }
@Override @Override
public Utf8 echo(Utf8 msg) throws AvroRemoteException { public CharSequence echo(CharSequence msg) throws AvroRemoteException {
return msg; return msg;
} }

View File

@ -312,7 +312,7 @@
<dependency> <dependency>
<groupId>org.codehaus.jackson</groupId> <groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId> <artifactId>jackson-mapper-asl</artifactId>
<version>1.5.2</version> <version>1.6.9</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.aspectj</groupId> <groupId>org.aspectj</groupId>
@ -325,15 +325,14 @@
<version>1.8.5</version> <version>1.8.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.hadoop</groupId> <groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId> <artifactId>avro</artifactId>
<version>1.3.2</version> <version>1.5.2</version>
<exclusions> </dependency>
<exclusion> <dependency>
<groupId>org.apache.ant</groupId> <groupId>org.apache.avro</groupId>
<artifactId>ant</artifactId> <artifactId>avro-ipc</artifactId>
</exclusion> <version>1.5.2</version>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.sf.kosmosfs</groupId> <groupId>net.sf.kosmosfs</groupId>
@ -446,6 +445,11 @@
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>
<version>2.5</version> <version>2.5</version>
</plugin> </plugin>
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>1.5.2</version>
</plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>