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 ha...@apache.org on 2015/03/22 05:35:11 UTC

hadoop git commit: MAPREDUCE-5190. Unnecessary condition test in RandomSampler. Contributed by Jingguo Yao.

Repository: hadoop
Updated Branches:
  refs/heads/branch-2 a7f1c1b99 -> d43c0da7d


MAPREDUCE-5190. Unnecessary condition test in RandomSampler. Contributed by Jingguo Yao.

(cherry picked from commit 1d5c796d654c8959972d15cc6742731a99380bfc)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/d43c0da7
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/d43c0da7
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/d43c0da7

Branch: refs/heads/branch-2
Commit: d43c0da7d7117afeb132b770bb4e3b076292d2a0
Parents: a7f1c1b
Author: Harsh J <ha...@cloudera.com>
Authored: Sun Mar 22 10:03:25 2015 +0530
Committer: Harsh J <ha...@cloudera.com>
Committed: Sun Mar 22 10:04:19 2015 +0530

----------------------------------------------------------------------
 hadoop-mapreduce-project/CHANGES.txt                           | 3 +++
 .../apache/hadoop/mapreduce/lib/partition/InputSampler.java    | 6 ++----
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d43c0da7/hadoop-mapreduce-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt
index 440c571..9235798 100644
--- a/hadoop-mapreduce-project/CHANGES.txt
+++ b/hadoop-mapreduce-project/CHANGES.txt
@@ -8,6 +8,9 @@ Release 2.8.0 - UNRELEASED
 
   IMPROVEMENTS
 
+    MAPREDUCE-5190. Unnecessary condition test in RandomSampler.
+    (Jingguo Yao via harsh)
+
     MAPREDUCE-6239. Consolidate TestJobConf classes in
     hadoop-mapreduce-client-jobclient and hadoop-mapreduce-client-core
     (Varun Saxena via harsh)

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d43c0da7/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/partition/InputSampler.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/partition/InputSampler.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/partition/InputSampler.java
index 4668f49..cce9f37 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/partition/InputSampler.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/partition/InputSampler.java
@@ -230,10 +230,8 @@ public class InputSampler<K,V> extends Configured implements Tool  {
               // to reflect the possibility of existing elements being
               // pushed out
               int ind = r.nextInt(numSamples);
-              if (ind != numSamples) {
-                samples.set(ind, ReflectionUtils.copy(job.getConfiguration(),
-                                 reader.getCurrentKey(), null));
-              }
+              samples.set(ind, ReflectionUtils.copy(job.getConfiguration(),
+                               reader.getCurrentKey(), null));
               freq *= (numSamples - 1) / (double) numSamples;
             }
           }