From c03040a4982a6088fc12c614502fb48da5020e1d Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Fri, 27 Sep 2013 20:04:31 +0000 Subject: [PATCH] Merge -c 1527048 from trunk to branch-2 to fix MAPREDUCE-5529. Fix compat with hadoop-1 in mapred.TotalOrderPartitioner by re-introducing (get,set)PartitionFile which takes in JobConf. Contributed by Robert Kanter. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1527054 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 4 +++ .../mapred/lib/TotalOrderPartitioner.java | 27 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 54dce17323c..114d1feb244 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -104,6 +104,10 @@ Release 2.1.2 - UNRELEASED MAPREDUCE-5545. org.apache.hadoop.mapred.TestTaskAttemptListenerImpl.testCommitWindow times out (Robert Kanter via jlowe) + MAPREDUCE-5529. Fix compat with hadoop-1 in mapred.TotalOrderPartitioner + by re-introducing (get,set)PartitionFile which takes in JobConf. (Robert + Kanter via acmurthy) + Release 2.1.1-beta - 2013-09-23 INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/lib/TotalOrderPartitioner.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/lib/TotalOrderPartitioner.java index 14e0962da2c..1b212fa8b52 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/lib/TotalOrderPartitioner.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/lib/TotalOrderPartitioner.java @@ -22,6 +22,7 @@ package org.apache.hadoop.mapred.lib; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.io.WritableComparable; +import org.apache.hadoop.fs.Path; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.Partitioner; @@ -41,4 +42,30 @@ public class TotalOrderPartitioner,V> super.setConf(job); } + /** + * Set the path to the SequenceFile storing the sorted partition keyset. + * It must be the case that for R reduces, there are R-1 + * keys in the SequenceFile. + * @deprecated Use + * {@link #setPartitionFile(Configuration, Path)} + * instead + */ + @Deprecated + public static void setPartitionFile(JobConf job, Path p) { + org.apache.hadoop.mapreduce.lib.partition.TotalOrderPartitioner. + setPartitionFile(job, p); + } + + /** + * Get the path to the SequenceFile storing the sorted partition keyset. + * @see #setPartitionFile(JobConf,Path) + * @deprecated Use + * {@link #getPartitionFile(Configuration)} + * instead + */ + @Deprecated + public static String getPartitionFile(JobConf job) { + return org.apache.hadoop.mapreduce.lib.partition.TotalOrderPartitioner. + getPartitionFile(job); + } }