You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by cu...@apache.org on 2009/10/24 01:36:30 UTC

svn commit: r829279 - in /hadoop/common/trunk: ./ .eclipse.templates/ ivy/ src/java/org/apache/hadoop/io/serializer/avro/ src/java/org/apache/hadoop/ipc/

Author: cutting
Date: Fri Oct 23 23:36:29 2009
New Revision: 829279

URL: http://svn.apache.org/viewvc?rev=829279&view=rev
Log:
HADOOP-6318.  Upgrade to Avro 1.2.0.

Modified:
    hadoop/common/trunk/.eclipse.templates/.classpath
    hadoop/common/trunk/CHANGES.txt
    hadoop/common/trunk/ivy/libraries.properties
    hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroReflectSerialization.java
    hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroSpecificSerialization.java
    hadoop/common/trunk/src/java/org/apache/hadoop/ipc/AvroRpc.java

Modified: hadoop/common/trunk/.eclipse.templates/.classpath
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/.eclipse.templates/.classpath?rev=829279&r1=829278&r2=829279&view=diff
==============================================================================
--- hadoop/common/trunk/.eclipse.templates/.classpath (original)
+++ hadoop/common/trunk/.eclipse.templates/.classpath Fri Oct 23 23:36:29 2009
@@ -5,7 +5,7 @@
 	<classpathentry kind="src" path="src/test/core"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="var" path="ANT_HOME/lib/ant.jar"/>
-	<classpathentry kind="lib" path="build/ivy/lib/Hadoop-Core/common/avro-1.1.0.jar"/>
+	<classpathentry kind="lib" path="build/ivy/lib/Hadoop-Core/common/avro-1.2.0.jar"/>
 	<classpathentry kind="lib" path="build/ivy/lib/Hadoop-Core/common/commons-cli-1.2.jar"/>
 	<classpathentry kind="lib" path="build/ivy/lib/Hadoop-Core/common/commons-codec-1.3.jar"/>
 	<classpathentry kind="lib" path="build/ivy/lib/Hadoop-Core/common/commons-el-1.0.jar"/>

Modified: hadoop/common/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=829279&r1=829278&r2=829279&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Fri Oct 23 23:36:29 2009
@@ -30,6 +30,8 @@
     HADOOP-6326. Hundson runs should check for AspectJ warnings and report
     failure if any is present (cos)
 
+    HADOOP-6318. Upgrade to Avro 1.2.0.  (cutting)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hadoop/common/trunk/ivy/libraries.properties
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/ivy/libraries.properties?rev=829279&r1=829278&r2=829279&view=diff
==============================================================================
--- hadoop/common/trunk/ivy/libraries.properties (original)
+++ hadoop/common/trunk/ivy/libraries.properties Fri Oct 23 23:36:29 2009
@@ -16,7 +16,7 @@
 #These are the versions of our dependencies (in alphabetical order)
 apacheant.version=1.7.0
 
-avro.version=1.1.0
+avro.version=1.2.0
 
 checkstyle.version=4.2
 

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroReflectSerialization.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroReflectSerialization.java?rev=829279&r1=829278&r2=829279&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroReflectSerialization.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroReflectSerialization.java Fri Oct 23 23:36:29 2009
@@ -78,14 +78,7 @@
   @Override
   protected DatumReader getReader(Map<String, String> metadata) {
     try {
-      Class<SpecificRecord> clazz = (Class<SpecificRecord>)
-        getClassFromMetadata(metadata);
-      String prefix =  
-        ((clazz.getEnclosingClass() == null 
-            || "null".equals(clazz.getEnclosingClass().getName())) ? 
-              clazz.getPackage().getName() + "." 
-              : (clazz.getEnclosingClass().getName() + "$"));
-      return new ReflectDatumReader(ReflectData.get().getSchema(clazz), prefix);
+      return new ReflectDatumReader(getClassFromMetadata(metadata));
     } catch (Exception e) {
       throw new RuntimeException(e);
     }

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroSpecificSerialization.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroSpecificSerialization.java?rev=829279&r1=829278&r2=829279&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroSpecificSerialization.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroSpecificSerialization.java Fri Oct 23 23:36:29 2009
@@ -48,9 +48,7 @@
   @Override
   protected DatumReader getReader(Map<String, String> metadata) {
     try {
-      Class<SpecificRecord> clazz = (Class<SpecificRecord>)
-        getClassFromMetadata(metadata);
-      return new SpecificDatumReader(clazz.newInstance().getSchema());
+      return new SpecificDatumReader(getClassFromMetadata(metadata));
     } catch (Exception e) {
       throw new RuntimeException(e);
     }

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/ipc/AvroRpc.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/ipc/AvroRpc.java?rev=829279&r1=829278&r2=829279&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/ipc/AvroRpc.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/ipc/AvroRpc.java Fri Oct 23 23:36:29 2009
@@ -114,13 +114,6 @@
     public void close() throws IOException {}
   }
     
-  private static class Invoker extends ReflectRequestor {
-    public Invoker(Protocol protocol, Transceiver transceiver)
-      throws IOException {
-      super(protocol, transceiver);
-    }
-  }
-
   /** Construct a client-side proxy object that implements the named protocol,
    * talking to a server at the named address. */
   public static Object getProxy(Class<?> protocol,
@@ -150,36 +143,14 @@
        new InvocationHandler() {
          public Object invoke(Object proxy, Method method, Object[] args) 
            throws Throwable {
-           return new Invoker
-             (ReflectData.get().getProtocol(protocol),
+           return new ReflectRequestor
+             (protocol,
               new ClientTransceiver(addr, ticket, conf, factory))
              .invoke(proxy, method, args);
          }
        });
   }
 
-  /** An Avro RPC Transceiver that provides a request passed through Hadoop RPC
-   * to the Avro RPC Responder for processing. */
-  private static class ServerTransceiver extends Transceiver {
-    List<ByteBuffer> request;
-    
-    public ServerTransceiver(List<ByteBuffer> request) {
-      this.request = request;
-    }
-
-    public String getRemoteName() { return "remote"; }
-
-    public List<ByteBuffer> readBuffers() throws IOException {
-      return request;
-    }
-
-    public void writeBuffers(List<ByteBuffer> buffers) throws IOException {
-      throw new UnsupportedOperationException();
-    }
-
-    public void close() throws IOException {}
-  }
-
   /** An Avro RPC Responder that can process requests passed via Hadoop RPC. */
   private static class TunnelResponder extends ReflectResponder
     implements TunnelProtocol {
@@ -195,8 +166,7 @@
 
     public BufferListWritable call(final BufferListWritable request)
       throws IOException {
-      return new BufferListWritable
-        (respond(new ServerTransceiver(request.buffers)));
+      return new BufferListWritable(respond(request.buffers));
     }
   }