hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r535981 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/JobClient.java src/test/org/apache/hadoop/mapred/TestMapRed.java
Date Mon, 07 May 2007 20:31:17 GMT
Author: cutting
Date: Mon May  7 13:31:16 2007
New Revision: 535981

URL: http://svn.apache.org/viewvc?view=rev&rev=535981
Log:
HADOOP-1326.  Change JobClient#runJob() to return the job.  Contributed by Owen.

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

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=535981&r1=535980&r2=535981
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Mon May  7 13:31:16 2007
@@ -342,6 +342,9 @@
 101. HADOOP-1276.  Make tasktracker expiry interval configurable.
     (Arun C Murthy via cutting)
 
+102. HADOOP-1326.  Change JobClient#RunJob() to return the job.
+    (omalley via cutting)
+
 
 Release 0.12.3 - 2007-04-06
 

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=535981&r1=535980&r2=535981
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobClient.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobClient.java Mon May  7 13:31:16
2007
@@ -524,7 +524,7 @@
     
   /** Utility that submits a job, then polls for progress until the job is
    * complete. */
-  public static void runJob(JobConf job) throws IOException {
+  public static RunningJob runJob(JobConf job) throws IOException {
     JobClient jc = new JobClient(job);
     boolean error = true;
     RunningJob running = null;
@@ -612,7 +612,7 @@
       }
       jc.close();
     }
-      
+    return running;
   }
 
   private static void displayTaskLogs(String taskId, String baseUrl)

Modified: lucene/hadoop/trunk/src/test/org/apache/hadoop/mapred/TestMapRed.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/test/org/apache/hadoop/mapred/TestMapRed.java?view=diff&rev=535981&r1=535980&r2=535981
==============================================================================
--- lucene/hadoop/trunk/src/test/org/apache/hadoop/mapred/TestMapRed.java (original)
+++ lucene/hadoop/trunk/src/test/org/apache/hadoop/mapred/TestMapRed.java Mon May  7 13:31:16
2007
@@ -215,14 +215,8 @@
   }
 
   private static class MyMap implements Mapper {
-    private JobConf conf;
-    private boolean compress;
-    private String taskId;
       
     public void configure(JobConf conf) {
-      this.conf = conf;
-      compress = conf.getBoolean("mapred.compress.map.output", false);
-      taskId = conf.get("mapred.task.id");
     }
       
     public void map(WritableComparable key, Writable value,
@@ -307,7 +301,9 @@
       f.writeBytes("Hadoop is fun\n");
       f.writeBytes("Is this done, yet?\n");
       f.close();
-      JobClient.runJob(conf);
+      RunningJob rj = JobClient.runJob(conf);
+      assertTrue("job was complete", rj.isComplete());
+      assertTrue("job was successful", rj.isSuccessful());
       Path output = new Path(outDir,
                              ReduceTask.getOutputName(0));
       assertTrue("reduce output exists " + output, fs.exists(output));



Mime
View raw message