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

This commit is contained in:
Harsh J 2015-03-22 10:03:25 +05:30
parent b46c2bb51a
commit 1d5c796d65
2 changed files with 5 additions and 4 deletions

View File

@ -256,6 +256,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)

View File

@ -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;
}
}