hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravigumm...@apache.org
Subject svn commit: r1307739 - in /hadoop/common/branches/branch-1: CHANGES.txt src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/GenerateDistCacheData.java
Date Sat, 31 Mar 2012 08:19:08 GMT
Author: ravigummadi
Date: Sat Mar 31 08:19:07 2012
New Revision: 1307739

URL: http://svn.apache.org/viewvc?rev=1307739&view=rev
Log:
MAPREDUCE-4087. [Gridmix] GenerateDistCacheData job of Gridmix can become slow in some cases
(ravigummadi)

Modified:
    hadoop/common/branches/branch-1/CHANGES.txt
    hadoop/common/branches/branch-1/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/GenerateDistCacheData.java

Modified: hadoop/common/branches/branch-1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/CHANGES.txt?rev=1307739&r1=1307738&r2=1307739&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1/CHANGES.txt Sat Mar 31 08:19:07 2012
@@ -81,6 +81,9 @@ Release 1.1.0 - unreleased
 
   BUG FIXES
 
+    MAPREDUCE-4087. [Gridmix] GenerateDistCacheData job of Gridmix can
+                    become slow in some cases (ravigummadi)
+
     HDFS-2305. Running multiple 2NNs can result in corrupt file system. (atm)
 
     HADOOP-7634. Docs specify wrong owner for task-controller.cfg (eli)

Modified: hadoop/common/branches/branch-1/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/GenerateDistCacheData.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/GenerateDistCacheData.java?rev=1307739&r1=1307738&r2=1307739&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/GenerateDistCacheData.java
(original)
+++ hadoop/common/branches/branch-1/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/GenerateDistCacheData.java
Sat Mar 31 08:19:07 2012
@@ -155,10 +155,11 @@ class GenerateDistCacheData extends Grid
       FSDataOutputStream dos =
           FileSystem.create(fs, path, new FsPermission((short)0755));
 
-      for (long bytes = key.get(); bytes > 0; bytes -= val.getLength()) {
+      int size = 0;
+      for (long bytes = key.get(); bytes > 0; bytes -= size) {
         r.nextBytes(val.getBytes());
-        val.setSize((int)Math.min(val.getLength(), bytes));
-        dos.write(val.getBytes(), 0, val.getLength());// Write to distCache file
+        size = (int)Math.min(val.getLength(), bytes);
+        dos.write(val.getBytes(), 0, size);// Write to distCache file
       }
       dos.close();
     }



Mime
View raw message