hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r709042 - in /hadoop/core/branches/branch-0.18: ./ CHANGES.txt src/core/org/apache/hadoop/util/ProgramDriver.java src/examples/org/apache/hadoop/examples/ExampleDriver.java src/mapred/org/apache/hadoop/mapred/JobShell.java
Date Wed, 29 Oct 2008 23:09:59 GMT
Author: acmurthy
Date: Wed Oct 29 16:09:58 2008
New Revision: 709042

URL: http://svn.apache.org/viewvc?rev=709042&view=rev
Log:
Merge -r 709039:709040 from trunk to branch-0.18 to fix HADOOP-4340.

Modified:
    hadoop/core/branches/branch-0.18/   (props changed)
    hadoop/core/branches/branch-0.18/CHANGES.txt   (contents, props changed)
    hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/util/ProgramDriver.java
    hadoop/core/branches/branch-0.18/src/examples/org/apache/hadoop/examples/ExampleDriver.java
    hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobShell.java

Propchange: hadoop/core/branches/branch-0.18/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Oct 29 16:09:58 2008
@@ -1 +1 @@
-/hadoop/core/trunk:699517,700163,704701,705420,705430,707258
+/hadoop/core/trunk:699517,700163,704701,705420,705430,707258,709040

Modified: hadoop/core/branches/branch-0.18/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/CHANGES.txt?rev=709042&r1=709041&r2=709042&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.18/CHANGES.txt Wed Oct 29 16:09:58 2008
@@ -53,6 +53,9 @@
     HADOOP-4483 Honor the max parameter in DatanodeDescriptor.getBlockArray(..)
     (Ahad Rana and Hairong Kuang via szetszwo)
 
+    HADOOP-4340. Correctly set the exit code from JobShell.main so that the
+    'hadoop jar' command returns the right code to the user. (acmurthy)
+
   NEW FEATURES
 
     HADOOP-2421.  Add jdiff output to documentation, listing all API

Propchange: hadoop/core/branches/branch-0.18/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Oct 29 16:09:58 2008
@@ -1 +1 @@
-/hadoop/core/trunk/CHANGES.txt:699517,700163,700923,704701,705420,705430,707258
+/hadoop/core/trunk/CHANGES.txt:699517,700163,700923,704701,705420,705430,707258,709040

Modified: hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/util/ProgramDriver.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/util/ProgramDriver.java?rev=709042&r1=709041&r2=709042&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/util/ProgramDriver.java (original)
+++ hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/util/ProgramDriver.java Wed
Oct 29 16:09:58 2008
@@ -120,7 +120,8 @@
       System.out.println("An example program must be given as the" + 
                          " first argument.");
       printUsage(programs);
-      return;
+      throw new IllegalArgumentException("An example program must be given " +
+      		                               "as the first argument.");
     }
 	
     // And that it is good.
@@ -128,7 +129,8 @@
     if (pgm == null) {
       System.out.println("Unknown program '" + args[0] + "' chosen.");
       printUsage(programs);
-      return;
+      throw new IllegalArgumentException("Unknown program '" + args[0] + 
+                                         "' chosen.");
     }
 	
     // Remove the leading argument and call main

Modified: hadoop/core/branches/branch-0.18/src/examples/org/apache/hadoop/examples/ExampleDriver.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/examples/org/apache/hadoop/examples/ExampleDriver.java?rev=709042&r1=709041&r2=709042&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/examples/org/apache/hadoop/examples/ExampleDriver.java
(original)
+++ hadoop/core/branches/branch-0.18/src/examples/org/apache/hadoop/examples/ExampleDriver.java
Wed Oct 29 16:09:58 2008
@@ -28,6 +28,7 @@
 public class ExampleDriver {
   
   public static void main(String argv[]){
+    int exitCode = -1;
     ProgramDriver pgd = new ProgramDriver();
     try {
       pgd.addClass("wordcount", WordCount.class, 
@@ -51,10 +52,15 @@
       pgd.addClass("join", Join.class, "A job that effects a join over sorted, equally partitioned
datasets");
       pgd.addClass("multifilewc", MultiFileWordCount.class, "A job that counts words from
several files.");
       pgd.driver(argv);
+      
+      // Success
+      exitCode = 0;
     }
     catch(Throwable e){
       e.printStackTrace();
     }
+    
+    System.exit(exitCode);
   }
 }
 	

Modified: hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobShell.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobShell.java?rev=709042&r1=709041&r2=709042&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobShell.java (original)
+++ hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobShell.java Wed
Oct 29 16:09:58 2008
@@ -65,6 +65,7 @@
   
   public static void main(String[] argv) throws Exception {
     JobShell jshell = new JobShell();
-    ToolRunner.run(jshell, argv);
+    int status = ToolRunner.run(jshell, argv);
+    System.exit(status);
   }
 }



Mime
View raw message