From 5bb361cee4abcfce08c580d60edff5515ffc655e Mon Sep 17 00:00:00 2001 From: Mahadev Konar Date: Fri, 9 Sep 2011 22:45:41 +0000 Subject: [PATCH] MAPREDUCE-2971. ant build mapreduce fails protected access jc.displayJobList (jobs) (Thomas Graves via mahadev) - merging 1167383 from trunk git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1167384 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/mapreduce/tools/CLI.java | 2 +- .../src/main/java/org/apache/hadoop/mapred/YARNRunner.java | 3 ++- .../src/java/org/apache/hadoop/mapred/JobQueueClient.java | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 1f6c6684340..d602ceb0afb 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -1248,6 +1248,9 @@ Release 0.23.0 - Unreleased MAPREDUCE-2975. Fixed YARNRunner to use YarnConfiguration rather than Configuration. (mahadev via acmurthy) + + MAPREDUCE-2971. ant build mapreduce fails protected access jc.displayJobList + (jobs) (Thomas Graves via mahadev) Release 0.22.0 - Unreleased diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/tools/CLI.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/tools/CLI.java index 0ac7053cbac..518bc4025d8 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/tools/CLI.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/tools/CLI.java @@ -523,7 +523,7 @@ public class CLI extends Configured implements Tool { } } - protected void displayJobList(JobStatus[] jobs) + public void displayJobList(JobStatus[] jobs) throws IOException, InterruptedException { System.out.println("Total jobs:" + jobs.length); System.out.println("JobId\tState\tStartTime\t" + diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java index dc65659966d..d3cab19822e 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java @@ -248,10 +248,11 @@ public class YARNRunner implements ClientProtocol { ApplicationReport appMaster = resMgrDelegate .getApplicationReport(applicationId); + String diagnostics = (appMaster == null ? "application report is null" : appMaster.getDiagnostics()); if (appMaster == null || appMaster.getState() == ApplicationState.FAILED || appMaster.getState() == ApplicationState.KILLED) { throw new IOException("Failed to run job : " + - appMaster.getDiagnostics()); + diagnostics); } return clientCache.getClient(jobId).getJobStatus(jobId); } diff --git a/hadoop-mapreduce-project/src/java/org/apache/hadoop/mapred/JobQueueClient.java b/hadoop-mapreduce-project/src/java/org/apache/hadoop/mapred/JobQueueClient.java index 68f5fc4366b..e4dc3100778 100644 --- a/hadoop-mapreduce-project/src/java/org/apache/hadoop/mapred/JobQueueClient.java +++ b/hadoop-mapreduce-project/src/java/org/apache/hadoop/mapred/JobQueueClient.java @@ -170,10 +170,10 @@ class JobQueueClient extends Configured implements Tool { * registered with the {@link QueueManager}. Display of the Jobs is determine * by the boolean * - * @throws IOException + * @throws IOException, InterruptedException */ private void displayQueueInfo(String queue, boolean showJobs) - throws IOException { + throws IOException, InterruptedException { JobQueueInfo jobQueueInfo = jc.getQueueInfo(queue); if (jobQueueInfo == null) {