hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r439069 - in /lucene/hadoop/trunk/src/java/org/apache/hadoop: dfs/DFSShell.java dfs/DFSck.java mapred/JobClient.java util/CopyFiles.java util/ToolBase.java
Date Thu, 31 Aug 2006 22:14:08 GMT
Author: ab
Date: Thu Aug 31 15:14:08 2006
New Revision: 439069

URL: http://svn.apache.org/viewvc?rev=439069&view=rev
Log:
HADOOP-488: return exit code in ToolBase.doMain, and use
System.exit(code) in classes that use this in their main() method.

Modified:
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSShell.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSck.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobClient.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/util/CopyFiles.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/util/ToolBase.java

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSShell.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSShell.java?rev=439069&r1=439068&r2=439069&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSShell.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSShell.java Thu Aug 31 15:14:08 2006
@@ -391,6 +391,7 @@
      * main() has some simple utility methods
      */
     public static void main(String argv[]) throws Exception {
-        new DFSShell().doMain(new Configuration(), argv);
+        int res = new DFSShell().doMain(new Configuration(), argv);
+        System.exit(res);
     }
 }

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSck.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSck.java?rev=439069&r1=439068&r2=439069&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSck.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSck.java Thu Aug 31 15:14:08 2006
@@ -450,7 +450,8 @@
   }
 
   public static void main(String[] args) throws Exception {
-      new DFSck().doMain(new Configuration(), args);
+      int res = new DFSck().doMain(new Configuration(), args);
+      System.exit(res);
   }
 
   /**

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?rev=439069&r1=439068&r2=439069&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobClient.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobClient.java Thu Aug 31 15:14:08
2006
@@ -457,7 +457,8 @@
     /**
      */
     public static void main(String argv[]) throws Exception {
-        new JobClient().doMain(new Configuration(), argv);
+        int res = new JobClient().doMain(new Configuration(), argv);
+        System.exit(res);
     }
 }
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/util/CopyFiles.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/util/CopyFiles.java?rev=439069&r1=439068&r2=439069&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/util/CopyFiles.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/util/CopyFiles.java Thu Aug 31 15:14:08
2006
@@ -810,9 +810,10 @@
   }
   
   public static void main(String[] args) throws Exception {
-    new CopyFiles().doMain(
+    int res = new CopyFiles().doMain(
         new JobConf(new Configuration(), CopyFiles.class), 
         args);
+    System.exit(res);
   }
   
 }

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/util/ToolBase.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/util/ToolBase.java?rev=439069&r1=439068&r2=439069&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/util/ToolBase.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/util/ToolBase.java Thu Aug 31 15:14:08
2006
@@ -177,11 +177,14 @@
      * @param conf Application default configuration
      * @param args User-specified arguments
      * @throws Exception
+     * @return exit code to be passed to a caller. General contract is that code
+     * equal zero signifies a normal return, negative values signify errors, and
+     * positive non-zero values can be used to return application-specific codes.
      */
-    public final void doMain(Configuration conf, String[] args) throws Exception {
+    public final int doMain(Configuration conf, String[] args) throws Exception {
         String [] commandOptions = parseGeneralOptions(conf, args);
         setConf(conf);
-        this.run(commandOptions);
+        return this.run(commandOptions);
     }
 
 }



Mime
View raw message