avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r790760 - /hadoop/avro/trunk/src/java/org/apache/avro/ipc/Responder.java
Date Thu, 02 Jul 2009 23:17:00 GMT
Author: cutting
Date: Thu Jul  2 23:17:00 2009
New Revision: 790760

URL: http://svn.apache.org/viewvc?rev=790760&view=rev
Log:
AVRO-66.  Add response metadata in error case too.

Modified:
    hadoop/avro/trunk/src/java/org/apache/avro/ipc/Responder.java

Modified: hadoop/avro/trunk/src/java/org/apache/avro/ipc/Responder.java
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/src/java/org/apache/avro/ipc/Responder.java?rev=790760&r1=790759&r2=790760&view=diff
==============================================================================
--- hadoop/avro/trunk/src/java/org/apache/avro/ipc/Responder.java (original)
+++ hadoop/avro/trunk/src/java/org/apache/avro/ipc/Responder.java Thu Jul  2 23:17:00 2009
@@ -72,6 +72,7 @@
       new ByteBufferOutputStream();
     Encoder out = new BinaryEncoder(bbo);
     AvroRemoteException error = null;
+    Map<Utf8,ByteBuffer> responseMeta = new HashMap<Utf8,ByteBuffer>();
     try {
       Protocol remote = handshake(transceiver, in, out);
       if (remote == null)                        // handshake failed
@@ -99,8 +100,6 @@
         LOG.warn("application error", e);
         error = new AvroRemoteException(new Utf8(e.toString()));
       }
-
-      Map<Utf8,ByteBuffer> responseMeta = new HashMap<Utf8,ByteBuffer>();
       META_WRITER.write(responseMeta, out);
       out.writeBoolean(error != null);
       if (error == null)
@@ -113,6 +112,7 @@
       error = new AvroRemoteException(e);
       bbo = new ByteBufferOutputStream();
       out = new BinaryEncoder(bbo);
+      META_WRITER.write(responseMeta, out);
       out.writeBoolean(true);
       writeError(Protocol.SYSTEM_ERRORS, error, out);
     }



Mime
View raw message