diff --git a/hadoop-common/CHANGES.txt b/hadoop-common/CHANGES.txt
index 33b81f1b60..147d4d6f8b 100644
--- a/hadoop-common/CHANGES.txt
+++ b/hadoop-common/CHANGES.txt
@@ -328,6 +328,9 @@ Trunk (unreleased changes)
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
HADOOP-7333. Performance improvement in PureJavaCrc32. (Eric Caspole
diff --git a/hadoop-common/pom.xml b/hadoop-common/pom.xml
index eb10c0d50c..f432e4a9a5 100644
--- a/hadoop-common/pom.xml
+++ b/hadoop-common/pom.xml
@@ -219,10 +219,15 @@
test
- org.apache.hadoop
+ org.apache.avro
avro
compile
+
+ org.apache.avro
+ avro-ipc
+ compile
+
net.sf.kosmosfs
kfs
@@ -322,6 +327,23 @@
${basedir}/dev-support/findbugsExcludeFile.xml
+
+ org.apache.avro
+ avro-maven-plugin
+
+
+ generate-avro-test-sources
+ generate-test-sources
+
+ schema
+ protocol
+
+
+
+
+ ${project.build.directory}/generated-test-sources/java
+
+
org.apache.maven.plugins
maven-antrun-plugin
@@ -359,24 +381,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/hadoop-common/src/main/java/org/apache/hadoop/io/serializer/avro/AvroSerialization.java b/hadoop-common/src/main/java/org/apache/hadoop/io/serializer/avro/AvroSerialization.java
index 27bb255696..1d5c068886 100644
--- a/hadoop-common/src/main/java/org/apache/hadoop/io/serializer/avro/AvroSerialization.java
+++ b/hadoop-common/src/main/java/org/apache/hadoop/io/serializer/avro/AvroSerialization.java
@@ -28,6 +28,7 @@
import org.apache.avro.io.DatumReader;
import org.apache.avro.io.DatumWriter;
import org.apache.avro.io.DecoderFactory;
+import org.apache.avro.io.EncoderFactory;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.conf.Configured;
@@ -93,7 +94,7 @@ public void close() throws IOException {
@Override
public void open(OutputStream out) throws IOException {
outStream = out;
- encoder = new BinaryEncoder(out);
+ encoder = EncoderFactory.get().binaryEncoder(out, encoder);
}
@Override
@@ -127,7 +128,7 @@ public T deserialize(T t) throws IOException {
@Override
public void open(InputStream in) throws IOException {
inStream = in;
- decoder = DecoderFactory.defaultFactory().createBinaryDecoder(in, null);
+ decoder = DecoderFactory.get().binaryDecoder(in, decoder);
}
}
diff --git a/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroRpcEngine.java b/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroRpcEngine.java
index 180e7811b1..5ab379c1da 100644
--- a/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroRpcEngine.java
+++ b/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroRpcEngine.java
@@ -34,9 +34,9 @@
import org.apache.avro.ipc.Responder;
import org.apache.avro.ipc.Transceiver;
-import org.apache.avro.reflect.ReflectRequestor;
-import org.apache.avro.reflect.ReflectResponder;
-import org.apache.avro.specific.SpecificRequestor;
+import org.apache.avro.ipc.reflect.ReflectRequestor;
+import org.apache.avro.ipc.reflect.ReflectResponder;
+import org.apache.avro.ipc.specific.SpecificRequestor;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceStability;
diff --git a/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroSpecificRpcEngine.java b/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroSpecificRpcEngine.java
index c5d1fe16e6..995a13a9c7 100644
--- a/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroSpecificRpcEngine.java
+++ b/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroSpecificRpcEngine.java
@@ -22,8 +22,8 @@
import org.apache.avro.ipc.Responder;
import org.apache.avro.ipc.Transceiver;
-import org.apache.avro.specific.SpecificRequestor;
-import org.apache.avro.specific.SpecificResponder;
+import org.apache.avro.ipc.specific.SpecificRequestor;
+import org.apache.avro.ipc.specific.SpecificResponder;
import org.apache.hadoop.classification.InterfaceStability;
/**
diff --git a/hadoop-common/src/test/java/org/apache/hadoop/ipc/AvroSpecificTestProtocol.avpr b/hadoop-common/src/test/avro/AvroSpecificTestProtocol.avpr
similarity index 100%
rename from hadoop-common/src/test/java/org/apache/hadoop/ipc/AvroSpecificTestProtocol.avpr
rename to hadoop-common/src/test/avro/AvroSpecificTestProtocol.avpr
diff --git a/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/avro/avroRecord.avsc b/hadoop-common/src/test/avro/avroRecord.avsc
similarity index 100%
rename from hadoop-common/src/test/java/org/apache/hadoop/io/serializer/avro/avroRecord.avsc
rename to hadoop-common/src/test/avro/avroRecord.avsc
diff --git a/hadoop-common/src/test/java/org/apache/hadoop/io/AvroTestUtil.java b/hadoop-common/src/test/java/org/apache/hadoop/io/AvroTestUtil.java
index 8fad425052..e3e885ad12 100644
--- a/hadoop-common/src/test/java/org/apache/hadoop/io/AvroTestUtil.java
+++ b/hadoop-common/src/test/java/org/apache/hadoop/io/AvroTestUtil.java
@@ -18,15 +18,16 @@
package org.apache.hadoop.io;
-import java.io.IOException;
+import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.lang.reflect.Type;
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.ReflectDatumWriter;
import org.apache.avro.reflect.ReflectDatumReader;
-import org.apache.avro.io.BinaryEncoder;
import org.apache.avro.io.DecoderFactory;
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
ReflectDatumWriter
+
+ org.apache.avro
+ avro-maven-plugin
+ 1.5.2
+