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 dd...@apache.org on 2008/03/28 10:41:39 UTC

svn commit: r642164 - in /hadoop/core/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/ReduceTask.java

Author: ddas
Date: Fri Mar 28 02:41:32 2008
New Revision: 642164

URL: http://svn.apache.org/viewvc?rev=642164&view=rev
Log:
HADOOP-2997. Adds test for non-writable serialier. Also fixes a problem introduced by HADOOP-2399. Contirbuted by Tom White.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/java/org/apache/hadoop/mapred/ReduceTask.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=642164&r1=642163&r2=642164&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Fri Mar 28 02:41:32 2008
@@ -398,6 +398,9 @@
     HADOOP-3064. Commas in a file path should not be treated as delimiters.
     (Hairong Kuang via shv)
 
+    HADOOP-2997. Adds test for non-writable serialier. Also fixes a problem 
+    introduced by HADOOP-2399. (Tom White via ddas)
+
 Release 0.16.2 - Unreleased
 
   BUG FIXES

Modified: hadoop/core/trunk/src/java/org/apache/hadoop/mapred/ReduceTask.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/mapred/ReduceTask.java?rev=642164&r1=642163&r2=642164&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/mapred/ReduceTask.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/mapred/ReduceTask.java Fri Mar 28 02:41:32 2008
@@ -209,8 +209,6 @@
       this.in = in;
       this.comparator = comparator;
       this.reporter = reporter;
-      nextKey = (KEY) ReflectionUtils.newInstance(keyClass, conf);
-      value = (VALUE) ReflectionUtils.newInstance(valClass, conf);
       SerializationFactory serializationFactory = new SerializationFactory(conf);
       this.keyDeserializer = serializationFactory.getDeserializer(keyClass);
       this.keyDeserializer.open(keyIn);
@@ -218,7 +216,7 @@
       this.valDeserializer.open(valIn);
       readNextKey();
       key = nextKey;
-      nextKey = (KEY) ReflectionUtils.newInstance(keyClass, conf);
+      nextKey = null; // force new instance creation
       hasNext = more;
     }
 
@@ -275,7 +273,7 @@
       if (more) {
         DataOutputBuffer nextKeyBytes = in.getKey();
         keyIn.reset(nextKeyBytes.getData(), nextKeyBytes.getLength());
-        keyDeserializer.deserialize(nextKey);
+        nextKey = keyDeserializer.deserialize(nextKey);
         hasNext = key != null && (comparator.compare(key, nextKey) == 0);
       } else {
         hasNext = false;
@@ -290,7 +288,7 @@
       nextValue.reset();
       in.getValue().writeUncompressedBytes(nextValue);
       valIn.reset(nextValue.getData(), nextValue.getLength());
-      valDeserializer.deserialize(value);
+      value = valDeserializer.deserialize(value);
     }
   }