Browse Source

HADOOP-2102. Fix the deprecated ToolBase to pass its Configuration object to the superceding ToolRunner to ensure it picks up the appropriate configuration resources. Contributed by Dennis Kubes and Enis Soztutar.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@589539 13f79535-47bb-0310-9956-ffa450edef68
Arun Murthy 18 years ago
parent
commit
6d1ef97998

+ 4 - 0
CHANGES.txt

@@ -392,6 +392,10 @@ Branch 0.15 (unreleased changes)
     HADOOP-2073.  Change size of VERSION file after writing contents to it.
     (Konstantin Shvachko via dhruba)
  
+    HADOOP-2102.  Fix the deprecated ToolBase to pass its Configuration object
+    to the superceding ToolRunner to ensure it picks up the appropriate
+    configuration resources. (Dennis Kubes and Enis Soztutar via acmurthy) 
+ 
   IMPROVEMENTS
 
     HADOOP-1908. Restructure data node code so that block sending and 

+ 2 - 2
src/examples/org/apache/hadoop/examples/RandomWriter.java

@@ -42,8 +42,8 @@ import org.apache.hadoop.mapred.RecordReader;
 import org.apache.hadoop.mapred.Reporter;
 import org.apache.hadoop.mapred.SequenceFileOutputFormat;
 import org.apache.hadoop.mapred.lib.IdentityReducer;
+import org.apache.hadoop.util.GenericOptionsParser;
 import org.apache.hadoop.util.Tool;
-import org.apache.hadoop.util.ToolBase;
 import org.apache.hadoop.util.ToolRunner;
 
 /**
@@ -79,7 +79,7 @@ import org.apache.hadoop.util.ToolRunner;
  * </configuration></xmp>
  * 
  * Equivalently, {@link RandomWriter} also supports all the above options
- * and ones supported by {@link ToolBase} via the command-line.
+ * and ones supported by {@link GenericOptionsParser} via the command-line.
  */
 public class RandomWriter extends Configured implements Tool {
   

+ 2 - 2
src/java/org/apache/hadoop/util/ToolBase.java

@@ -24,7 +24,7 @@ import org.apache.hadoop.conf.Configuration;
  * @deprecated This class is depracated. Classes 
  * extending ToolBase should rather implement {@link Tool} 
  * interface, and use {@link ToolRunner} for execution 
- * functionality. Alternativelly, {@link GenericOptionsParser} 
+ * functionality. Alternatively, {@link GenericOptionsParser} 
  * can be used to parse generic arguments related to hadoop 
  * framework. 
  */
@@ -51,7 +51,7 @@ public abstract class ToolBase implements Tool {
    * positive non-zero values can be used to return application-specific codes.
    */
   public final int doMain(Configuration conf, String[] args) throws Exception {
-    return ToolRunner.run(this, args);
+    return ToolRunner.run(conf, this, args);
   }
 
 }