diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index e6930186078..c6e22d57a1b 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -638,6 +638,9 @@ Release 2.8.0 - UNRELEASED HADOOP-7165. listLocatedStatus(path, filter) is not redefined in FilterFs (Hairong Kuang via jlowe) + HADOOP-9729. The example code of org.apache.hadoop.util.Tool is incorrect + (hellojinjie via jlowe) + Release 2.7.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Tool.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Tool.java index 3ff8e522de9..b6e3d7db713 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Tool.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Tool.java @@ -54,8 +54,12 @@ import org.apache.hadoop.conf.Configurable; * job.setReducerClass(MyReducer.class); * * // Submit the job, then poll for progress until the job is complete - * JobClient.runJob(job); - * return 0; + * RunningJob runningJob = JobClient.runJob(job); + * if (runningJob.isSuccessful()) { + * return 0; + * } else { + * return 1; + * } * } * * public static void main(String[] args) throws Exception {