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 cd...@apache.org on 2008/06/19 00:43:32 UTC

svn commit: r669323 - in /hadoop/core/branches/branch-0.18: CHANGES.txt src/mapred/org/apache/hadoop/mapred/MapTask.java

Author: cdouglas
Date: Wed Jun 18 15:43:31 2008
New Revision: 669323

URL: http://svn.apache.org/viewvc?rev=669323&view=rev
Log:
HADOOP-3550. Fix the serialization data structures in MapTask where the value
lengths are incorrectly calculated.


Modified:
    hadoop/core/branches/branch-0.18/CHANGES.txt
    hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/MapTask.java

Modified: hadoop/core/branches/branch-0.18/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/CHANGES.txt?rev=669323&r1=669322&r2=669323&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.18/CHANGES.txt Wed Jun 18 15:43:31 2008
@@ -614,6 +614,9 @@
     HADOOP-3520.  TestDFSUpgradeFromImage triggers a race condition in the
     Upgrade Manager. Fixed. (dhruba)
 
+    HADOOP-3550. Fix the serialization data structures in MapTask where the
+    value lengths are incorrectly calculated. (cdouglas)
+
 Release 0.17.1 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/MapTask.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/MapTask.java?rev=669323&r1=669322&r2=669323&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/MapTask.java (original)
+++ hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/MapTask.java Wed Jun 18 15:43:31 2008
@@ -426,7 +426,7 @@
           // serialize key bytes into buffer
         int keystart = bufindex;
         keySerializer.serialize(key);
-        if (bufindex < keystart) {
+        if (bufindex < keystart || bufindex == bufvoid) {
           // wrapped the key; reset required
           bb.reset();
           keystart = 0;
@@ -853,10 +853,11 @@
      * deserialized value bytes. Should only be called during a spill.
      */
     private void getVBytesForOffset(int kvoff, InMemValBytes vbytes) {
-      final int nextindex = kvoff / ACCTSIZE == kvend - 1
+      final int nextindex = ((kvoff/ACCTSIZE) == 
+                             ((kvend - 1 + kvoffsets.length) % kvoffsets.length))
         ? bufend
         : kvindices[(kvoff + ACCTSIZE + KEYSTART) % kvindices.length];
-      int vallen = (nextindex > kvindices[kvoff + VALSTART])
+      int vallen = (nextindex >= kvindices[kvoff + VALSTART])
         ? nextindex - kvindices[kvoff + VALSTART]
         : (bufvoid - kvindices[kvoff + VALSTART]) + nextindex;
       vbytes.reset(kvbuffer, kvindices[kvoff + VALSTART], vallen);