hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r501941 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/JobClient.java
Date Wed, 31 Jan 2007 18:42:09 GMT
Author: cutting
Date: Wed Jan 31 10:42:08 2007
New Revision: 501941

URL: http://svn.apache.org/viewvc?view=rev&rev=501941
Log:
HADOOP-961.  Add a 'job -events' sub-command that prints job events.  Contributed by Owen.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobClient.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=501941&r1=501940&r2=501941
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Wed Jan 31 10:42:08 2007
@@ -102,6 +102,9 @@
     likely already in flight, skip ahead rather than re-opening the
     block.  (Dhruba Borthakur via cutting)
 
+32. HADOOP-961.  Add a 'job -events' sub-command that prints job
+    events, including task completions and failures.  (omalley via cutting)
+
 
 Release 0.10.1 - 2007-01-10
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobClient.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobClient.java?view=diff&rev=501941&r1=501940&r2=501941
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobClient.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobClient.java Wed Jan 31 10:42:08
2007
@@ -515,7 +515,9 @@
     
     public int run(String[] argv) throws Exception {
         if (argv.length < 2) {
-            System.out.println("JobClient -submit <job> | -status <id> | -kill
<id> [-jt <jobtracker:port>|<config>]");
+            System.out.println("JobClient -submit <job> | -status <id> |" + 
+                               " -events <id> |" +
+                               " -kill <id> [-jt <jobtracker:port>|<config>]");
             System.exit(-1);
         }
 
@@ -540,6 +542,8 @@
                 jobid = argv[i+1];
                 killJob = true;
                 i++;
+            } else if ("-events".equals(argv[i])) {
+              listEvents(argv[++i]);
             }
         }
 
@@ -572,6 +576,21 @@
             close();
         }
         return exitCode;
+    }
+    
+    /**
+     * List the events for the given job
+     * @param jobId the job id for the job's events to list
+     * @throws IOException
+     */
+    private void listEvents(String jobId) throws IOException {
+      TaskCompletionEvent[] events = 
+        jobSubmitClient.getTaskCompletionEvents(jobId, 0);
+      System.out.println("Task completion events for " + jobId);
+      for(TaskCompletionEvent event: events) {
+        System.out.println(event.getTaskStatus() + " " + event.getTaskId() + 
+                           " " + event.getTaskTrackerHttp());
+      }
     }
     
     /**



Mime
View raw message