hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r829288 - in /hadoop/common/branches/branch-0.21: ./ .eclipse.templates/ ivy/ src/java/org/apache/hadoop/io/serializer/avro/ src/java/org/apache/hadoop/ipc/
Date Sat, 24 Oct 2009 00:16:34 GMT
Author: cutting
Date: Sat Oct 24 00:16:33 2009
New Revision: 829288

URL: http://svn.apache.org/viewvc?rev=829288&view=rev
Log:
Merge revision 829279 from trunk.  Fixes: HADOOP-6318.

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

Modified: hadoop/common/branches/branch-0.21/.eclipse.templates/.classpath
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.21/.eclipse.templates/.classpath?rev=829288&r1=829287&r2=829288&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.21/.eclipse.templates/.classpath (original)
+++ hadoop/common/branches/branch-0.21/.eclipse.templates/.classpath Sat Oct 24 00:16:33 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.0.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/branches/branch-0.21/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.21/CHANGES.txt?rev=829288&r1=829287&r2=829288&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.21/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.21/CHANGES.txt Sat Oct 24 00:16:33 2009
@@ -1087,6 +1087,8 @@
     HADOOP-6327. FileContext tests should not use /tmp and should clean up
     files.  (Sanjay Radia via szetszwo)
 
+    HADOOP-6318. Upgrade to Avro 1.2.0.  (cutting)
+
 Release 0.20.2 - Unreleased
 
   NEW FEATURES

Modified: hadoop/common/branches/branch-0.21/ivy/libraries.properties
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.21/ivy/libraries.properties?rev=829288&r1=829287&r2=829288&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.21/ivy/libraries.properties (original)
+++ hadoop/common/branches/branch-0.21/ivy/libraries.properties Sat Oct 24 00:16:33 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/branches/branch-0.21/src/java/org/apache/hadoop/io/serializer/avro/AvroReflectSerialization.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.21/src/java/org/apache/hadoop/io/serializer/avro/AvroReflectSerialization.java?rev=829288&r1=829287&r2=829288&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.21/src/java/org/apache/hadoop/io/serializer/avro/AvroReflectSerialization.java
(original)
+++ hadoop/common/branches/branch-0.21/src/java/org/apache/hadoop/io/serializer/avro/AvroReflectSerialization.java
Sat Oct 24 00:16:33 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/branches/branch-0.21/src/java/org/apache/hadoop/io/serializer/avro/AvroSpecificSerialization.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.21/src/java/org/apache/hadoop/io/serializer/avro/AvroSpecificSerialization.java?rev=829288&r1=829287&r2=829288&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.21/src/java/org/apache/hadoop/io/serializer/avro/AvroSpecificSerialization.java
(original)
+++ hadoop/common/branches/branch-0.21/src/java/org/apache/hadoop/io/serializer/avro/AvroSpecificSerialization.java
Sat Oct 24 00:16:33 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/branches/branch-0.21/src/java/org/apache/hadoop/ipc/AvroRpc.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.21/src/java/org/apache/hadoop/ipc/AvroRpc.java?rev=829288&r1=829287&r2=829288&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.21/src/java/org/apache/hadoop/ipc/AvroRpc.java (original)
+++ hadoop/common/branches/branch-0.21/src/java/org/apache/hadoop/ipc/AvroRpc.java Sat Oct
24 00:16:33 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));
     }
   }
 



Mime
View raw message