浏览代码

MAPREDUCE-2971. ant build mapreduce fails protected access jc.displayJobList (jobs) (Thomas Graves via mahadev)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1167383 13f79535-47bb-0310-9956-ffa450edef68
Mahadev Konar 13 年之前
父节点
当前提交
b982e6205f

+ 3 - 0
hadoop-mapreduce-project/CHANGES.txt

@@ -1265,6 +1265,9 @@ Release 0.23.0 - Unreleased
 
 
    MAPREDUCE-2975. Fixed YARNRunner to use YarnConfiguration rather than
    MAPREDUCE-2975. Fixed YARNRunner to use YarnConfiguration rather than
    Configuration. (mahadev via acmurthy) 
    Configuration. (mahadev via acmurthy) 
+ 
+   MAPREDUCE-2971. ant build mapreduce fails protected access jc.displayJobList
+   (jobs) (Thomas Graves via mahadev)
 
 
 Release 0.22.0 - Unreleased
 Release 0.22.0 - Unreleased
 
 

+ 1 - 1
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 {
       throws IOException, InterruptedException {
     System.out.println("Total jobs:" + jobs.length);
     System.out.println("Total jobs:" + jobs.length);
     System.out.println("JobId\tState\tStartTime\t" +
     System.out.println("JobId\tState\tStartTime\t" +

+ 2 - 1
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
     ApplicationReport appMaster = resMgrDelegate
         .getApplicationReport(applicationId);
         .getApplicationReport(applicationId);
+    String diagnostics = (appMaster == null ? "application report is null" : appMaster.getDiagnostics());
     if (appMaster == null || appMaster.getState() == ApplicationState.FAILED 
     if (appMaster == null || appMaster.getState() == ApplicationState.FAILED 
         || appMaster.getState() == ApplicationState.KILLED) {
         || appMaster.getState() == ApplicationState.KILLED) {
       throw new IOException("Failed to run job : " + 
       throw new IOException("Failed to run job : " + 
-        appMaster.getDiagnostics());
+        diagnostics);
     }
     }
     return clientCache.getClient(jobId).getJobStatus(jobId);
     return clientCache.getClient(jobId).getJobStatus(jobId);
   }
   }

+ 2 - 2
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
    * registered with the {@link QueueManager}. Display of the Jobs is determine
    * by the boolean
    * by the boolean
    * 
    * 
-   * @throws IOException
+   * @throws IOException, InterruptedException
    */
    */
   private void displayQueueInfo(String queue, boolean showJobs)
   private void displayQueueInfo(String queue, boolean showJobs)
-      throws IOException {
+      throws IOException, InterruptedException {
     JobQueueInfo jobQueueInfo = jc.getQueueInfo(queue);
     JobQueueInfo jobQueueInfo = jc.getQueueInfo(queue);
     
     
     if (jobQueueInfo == null) {
     if (jobQueueInfo == null) {