hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomwh...@apache.org
Subject svn commit: r1159699 - in /hadoop/common/trunk: hadoop-common/ hadoop-common/src/main/java/org/apache/hadoop/io/serializer/avro/ hadoop-common/src/main/java/org/apache/hadoop/ipc/ hadoop-common/src/test/avro/ hadoop-common/src/test/java/org/apache/hado...
Date Fri, 19 Aug 2011 17:26:43 GMT
Author: tomwhite
Date: Fri Aug 19 17:26:42 2011
New Revision: 1159699

URL: http://svn.apache.org/viewvc?rev=1159699&view=rev
Log:
HADOOP-7264. Bump avro version to at least 1.4.1. Contributed by Alejandro Abdelnur

Added:
    hadoop/common/trunk/hadoop-common/src/test/avro/
    hadoop/common/trunk/hadoop-common/src/test/avro/AvroSpecificTestProtocol.avpr
    hadoop/common/trunk/hadoop-common/src/test/avro/avroRecord.avsc
Removed:
    hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/avro/avroRecord.avsc
    hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/ipc/AvroSpecificTestProtocol.avpr
Modified:
    hadoop/common/trunk/hadoop-common/CHANGES.txt
    hadoop/common/trunk/hadoop-common/pom.xml
    hadoop/common/trunk/hadoop-common/src/main/java/org/apache/hadoop/io/serializer/avro/AvroSerialization.java
    hadoop/common/trunk/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroRpcEngine.java
    hadoop/common/trunk/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroSpecificRpcEngine.java
    hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/io/AvroTestUtil.java
    hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/ipc/AvroTestProtocol.java
    hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestAvroRpc.java
    hadoop/common/trunk/hadoop-project/pom.xml

Modified: hadoop/common/trunk/hadoop-common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/CHANGES.txt?rev=1159699&r1=1159698&r2=1159699&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-common/CHANGES.txt Fri Aug 19 17:26:42 2011
@@ -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

Modified: hadoop/common/trunk/hadoop-common/pom.xml
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/pom.xml?rev=1159699&r1=1159698&r2=1159699&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/pom.xml (original)
+++ hadoop/common/trunk/hadoop-common/pom.xml Fri Aug 19 17:26:42 2011
@@ -219,11 +219,16 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.apache.hadoop</groupId>
+      <groupId>org.apache.avro</groupId>
       <artifactId>avro</artifactId>
       <scope>compile</scope>
     </dependency>
     <dependency>
+      <groupId>org.apache.avro</groupId>
+      <artifactId>avro-ipc</artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
       <groupId>net.sf.kosmosfs</groupId>
       <artifactId>kfs</artifactId>
       <scope>compile</scope>
@@ -323,6 +328,23 @@
         </configuration>
       </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>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-antrun-plugin</artifactId>
         <executions>
@@ -359,24 +381,6 @@
                 <recordcc destdir="${project.build.directory}/generated-test-sources/java">
                   <fileset dir="${basedir}/src/test/ddl" includes="**/*.jr"/>
                 </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>
             </configuration>
           </execution>

Modified: hadoop/common/trunk/hadoop-common/src/main/java/org/apache/hadoop/io/serializer/avro/AvroSerialization.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/src/main/java/org/apache/hadoop/io/serializer/avro/AvroSerialization.java?rev=1159699&r1=1159698&r2=1159699&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/src/main/java/org/apache/hadoop/io/serializer/avro/AvroSerialization.java
(original)
+++ hadoop/common/trunk/hadoop-common/src/main/java/org/apache/hadoop/io/serializer/avro/AvroSerialization.java
Fri Aug 19 17:26:42 2011
@@ -28,6 +28,7 @@ import org.apache.avro.io.BinaryEncoder;
 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 abstract class AvroSerialization<
     @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 abstract class AvroSerialization<
     @Override
     public void open(InputStream in) throws IOException {
       inStream = in;
-      decoder = DecoderFactory.defaultFactory().createBinaryDecoder(in, null);
+      decoder = DecoderFactory.get().binaryDecoder(in, decoder);
     }
 
   }

Modified: hadoop/common/trunk/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroRpcEngine.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroRpcEngine.java?rev=1159699&r1=1159698&r2=1159699&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroRpcEngine.java
(original)
+++ hadoop/common/trunk/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroRpcEngine.java
Fri Aug 19 17:26:42 2011
@@ -34,9 +34,9 @@ import javax.net.SocketFactory;
 
 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;

Modified: hadoop/common/trunk/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroSpecificRpcEngine.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroSpecificRpcEngine.java?rev=1159699&r1=1159698&r2=1159699&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroSpecificRpcEngine.java
(original)
+++ hadoop/common/trunk/hadoop-common/src/main/java/org/apache/hadoop/ipc/AvroSpecificRpcEngine.java
Fri Aug 19 17:26:42 2011
@@ -22,8 +22,8 @@ import java.io.IOException;
 
 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;
 
 /**

Added: hadoop/common/trunk/hadoop-common/src/test/avro/AvroSpecificTestProtocol.avpr
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/src/test/avro/AvroSpecificTestProtocol.avpr?rev=1159699&view=auto
==============================================================================
--- hadoop/common/trunk/hadoop-common/src/test/avro/AvroSpecificTestProtocol.avpr (added)
+++ hadoop/common/trunk/hadoop-common/src/test/avro/AvroSpecificTestProtocol.avpr Fri Aug
19 17:26:42 2011
@@ -0,0 +1,42 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+{
+  "protocol" : "AvroSpecificTestProtocol",
+  "namespace" : "org.apache.hadoop.ipc",
+
+  "messages" : {
+    "echo" : {
+      "request" : [ {
+        "name" : "message",
+        "type" : "string"
+      } ],
+      "response" : "string"
+    },
+    
+    "add" : {
+      "request" : [ {
+        "name" : "arg1",
+        "type" : "int"
+      }, {
+        "name" : "arg2",
+        "type" : "int",
+        "default" : 0
+      } ],
+      "response" : "int"
+    }
+  }
+}
\ No newline at end of file

Added: hadoop/common/trunk/hadoop-common/src/test/avro/avroRecord.avsc
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/src/test/avro/avroRecord.avsc?rev=1159699&view=auto
==============================================================================
--- hadoop/common/trunk/hadoop-common/src/test/avro/avroRecord.avsc (added)
+++ hadoop/common/trunk/hadoop-common/src/test/avro/avroRecord.avsc Fri Aug 19 17:26:42 2011
@@ -0,0 +1,23 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+ 
+
+{"type": "record", "name":"AvroRecord", 
+  "namespace": "org.apache.hadoop.io.serializer.avro",
+  "fields": [
+      {"name": "intField", "type": "int"}
+  ]
+}

Modified: hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/io/AvroTestUtil.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/io/AvroTestUtil.java?rev=1159699&r1=1159698&r2=1159699&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/io/AvroTestUtil.java
(original)
+++ hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/io/AvroTestUtil.java
Fri Aug 19 17:26:42 2011
@@ -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 class AvroTestUtil {
     // check that value is serialized correctly
     ReflectDatumWriter<Object> writer = new ReflectDatumWriter<Object>(s);
     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);
     Object after =
-      reader.read(null, DecoderFactory.defaultFactory().createBinaryDecoder(
-          out.toByteArray(), null));
+      reader.read(null,
+                  DecoderFactory.get().binaryDecoder(out.toByteArray(), null));
     assertEquals(value, after);
   }
 

Modified: hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/ipc/AvroTestProtocol.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/ipc/AvroTestProtocol.java?rev=1159699&r1=1159698&r2=1159699&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/ipc/AvroTestProtocol.java
(original)
+++ hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/ipc/AvroTestProtocol.java
Fri Aug 19 17:26:42 2011
@@ -18,7 +18,7 @@
 
 package org.apache.hadoop.ipc;
 
-import org.apache.avro.ipc.AvroRemoteException;
+import org.apache.avro.AvroRemoteException;
 
 @SuppressWarnings("serial")
 public interface AvroTestProtocol {

Modified: hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestAvroRpc.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestAvroRpc.java?rev=1159699&r1=1159698&r2=1159699&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestAvroRpc.java
(original)
+++ hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestAvroRpc.java
Fri Aug 19 17:26:42 2011
@@ -28,7 +28,7 @@ import javax.security.sasl.Sasl;
 import junit.framework.Assert;
 import junit.framework.TestCase;
 
-import org.apache.avro.ipc.AvroRemoteException;
+import org.apache.avro.AvroRemoteException;
 import org.apache.avro.util.Utf8;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -189,7 +189,7 @@ public class TestAvroRpc extends TestCas
         (AvroSpecificTestProtocol)RPC.getProxy(AvroSpecificTestProtocol.class, 
             0, addr, conf);
       
-      Utf8 echo = proxy.echo(new Utf8("hello world"));
+      CharSequence echo = proxy.echo("hello world");
       assertEquals("hello world", echo.toString());
 
       int intResult = proxy.add(1, 2);
@@ -210,7 +210,7 @@ public class TestAvroRpc extends TestCas
     }
 
     @Override
-    public Utf8 echo(Utf8 msg) throws AvroRemoteException {
+    public CharSequence echo(CharSequence msg) throws AvroRemoteException {
       return msg;
     }
     

Modified: hadoop/common/trunk/hadoop-project/pom.xml
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-project/pom.xml?rev=1159699&r1=1159698&r2=1159699&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-project/pom.xml (original)
+++ hadoop/common/trunk/hadoop-project/pom.xml Fri Aug 19 17:26:42 2011
@@ -312,7 +312,7 @@
       <dependency>
         <groupId>org.codehaus.jackson</groupId>
         <artifactId>jackson-mapper-asl</artifactId>
-        <version>1.5.2</version>
+        <version>1.6.9</version>
       </dependency>
       <dependency>
         <groupId>org.aspectj</groupId>
@@ -325,15 +325,14 @@
         <version>1.8.5</version>
       </dependency>
       <dependency>
-        <groupId>org.apache.hadoop</groupId>
+        <groupId>org.apache.avro</groupId>
         <artifactId>avro</artifactId>
-        <version>1.3.2</version>
-        <exclusions>
-          <exclusion>
-            <groupId>org.apache.ant</groupId>
-            <artifactId>ant</artifactId>
-          </exclusion>
-        </exclusions>
+        <version>1.5.2</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.avro</groupId>
+        <artifactId>avro-ipc</artifactId>
+        <version>1.5.2</version>
       </dependency>
       <dependency>
         <groupId>net.sf.kosmosfs</groupId>
@@ -446,6 +445,11 @@
           <artifactId>maven-deploy-plugin</artifactId>
           <version>2.5</version>
         </plugin>
+        <plugin>
+          <groupId>org.apache.avro</groupId>
+          <artifactId>avro-maven-plugin</artifactId>
+          <version>1.5.2</version>
+        </plugin>
       </plugins>
     </pluginManagement>
 



Mime
View raw message