From 2eebc21a55ebc9230f4fb41149eb7c2e26a53b52 Mon Sep 17 00:00:00 2001 From: Robert Joseph Evans Date: Mon, 21 May 2012 19:05:19 +0000 Subject: [PATCH] MAPREDUCE-4274 MapOutputBuffer should use native byte order for kvmeta. (todd via bobby) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1341151 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/mapred/MapTask.java | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 6d5013887d..71fcd95b8b 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -130,6 +130,9 @@ Release 2.0.1-alpha - UNRELEASED MAPREDUCE-4002. MultiFileWordCount job fails if the input path is not from default file system. (Bhallamudi Venkata Siva Kamesh via todd) + MAPREDUCE-4274 MapOutputBuffer should use native byte order for kvmeta. + (todd via bobby) + Release 2.0.0-alpha - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/MapTask.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/MapTask.java index f83c07e0e0..1232645ca6 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/MapTask.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/MapTask.java @@ -25,6 +25,7 @@ import java.io.IOException; import java.io.OutputStream; import java.nio.ByteBuffer; +import java.nio.ByteOrder; import java.nio.IntBuffer; import java.util.ArrayList; import java.util.List; @@ -911,7 +912,9 @@ public MapOutputBuffer(TaskUmbilicalProtocol umbilical, JobConf job, maxMemUsage -= maxMemUsage % METASIZE; kvbuffer = new byte[maxMemUsage]; bufvoid = kvbuffer.length; - kvmeta = ByteBuffer.wrap(kvbuffer).asIntBuffer(); + kvmeta = ByteBuffer.wrap(kvbuffer) + .order(ByteOrder.nativeOrder()) + .asIntBuffer(); setEquator(0); bufstart = bufend = bufindex = equator; kvstart = kvend = kvindex;