hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amareshw...@apache.org
Subject svn commit: r961578 - in /hadoop/mapreduce/trunk: CHANGES.txt src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamKeyValUtil.java
Date Thu, 08 Jul 2010 06:02:46 GMT
Author: amareshwari
Date: Thu Jul  8 06:02:45 2010
New Revision: 961578

URL: http://svn.apache.org/viewvc?rev=961578&view=rev
Log:
MAPREDUCE-1248. Fixes redudant memory copying in StreamKeyValUtil. Contributed by Ruibang
He.

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamKeyValUtil.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=961578&r1=961577&r2=961578&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Thu Jul  8 06:02:45 2010
@@ -72,6 +72,9 @@ Trunk (unreleased changes)
 
     MAPREDUCE-1893. Slive with multiple reducers. (shv)
 
+    MAPREDUCE-1248. Fixes redudant memory copying in StreamKeyValUtil.
+    (Ruibang He via amareshwari)
+
   OPTIMIZATIONS
 
     MAPREDUCE-1354. Enhancements to JobTracker for better performance and

Modified: hadoop/mapreduce/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamKeyValUtil.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamKeyValUtil.java?rev=961578&r1=961577&r2=961578&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamKeyValUtil.java
(original)
+++ hadoop/mapreduce/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamKeyValUtil.java
Thu Jul  8 06:02:45 2010
@@ -69,13 +69,9 @@ public class StreamKeyValUtil {
       throw new IllegalArgumentException("splitPos must be in the range " +
                                          "[" + start + ", " + (start+length) + "]: " + splitPos);
     int keyLen = (splitPos-start);
-    byte [] keyBytes = new byte[keyLen];
-    System.arraycopy(utf, start, keyBytes, 0, keyLen);
     int valLen = (start+length)-splitPos-separatorLength;
-    byte [] valBytes = new byte[valLen];
-    System.arraycopy(utf, splitPos+separatorLength, valBytes, 0, valLen);
-    key.set(keyBytes);
-    val.set(valBytes);
+    key.set(utf, start, keyLen);
+    val.set(utf, splitPos+separatorLength, valLen);
   }
 
   /**



Mime
View raw message