Author: cdouglas
Date: Wed Jun 18 15:43:23 2008
New Revision: 669322
URL: http://svn.apache.org/viewvc?rev=669322&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.17/CHANGES.txt
hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/mapred/MapTask.java
Modified: hadoop/core/branches/branch-0.17/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.17/CHANGES.txt?rev=669322&r1=669321&r2=669322&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.17/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.17/CHANGES.txt Wed Jun 18 15:43:23 2008
@@ -20,6 +20,9 @@
HADOOP-3475. Fix MapTask to correctly size the accounting allocation of
io.sort.mb. (cdouglas)
+ 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.17/src/java/org/apache/hadoop/mapred/MapTask.java
URL:
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/mapred/MapTask.java?rev=669322&r1=669321&r2=669322&view=diff
==============================================================================
---
hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/mapred/MapTask.java
(original)
+++
hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/mapred/MapTask.java
Wed Jun 18 15:43:23 2008
@@ -435,7 +435,7 @@
try {
int keystart = bufindex;
keySerializer.serialize(key);
- if (bufindex < keystart) {
+ if (bufindex < keystart || bufindex == bufvoid) {
// wrapped the key; reset required
bb.reset();
keystart = 0;
@@ -855,10 +855,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(kvindices[kvoff + VALSTART], vallen);