hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r375325 - in /lucene/hadoop/trunk: ./ conf/ src/java/org/apache/hadoop/conf/ src/java/org/apache/hadoop/mapred/
Date Mon, 06 Feb 2006 18:14:54 GMT
Author: cutting
Date: Mon Feb  6 10:14:51 2006
New Revision: 375325

URL: http://svn.apache.org/viewcvs?rev=375325&view=rev
Log:
Fix some config problems, remove notion of app resources: it's overkill.

Modified:
    lucene/hadoop/trunk/build.xml
    lucene/hadoop/trunk/conf/hadoop-site.xml.template
    lucene/hadoop/trunk/conf/mapred-default.xml.template
    lucene/hadoop/trunk/src/java/org/apache/hadoop/conf/Configuration.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobConf.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java

Modified: lucene/hadoop/trunk/build.xml
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/build.xml?rev=375325&r1=375324&r2=375325&view=diff
==============================================================================
--- lucene/hadoop/trunk/build.xml (original)
+++ lucene/hadoop/trunk/build.xml Mon Feb  6 10:14:51 2006
@@ -114,6 +114,8 @@
   <target name="jar" depends="compile">
     <copy file="${conf.dir}/hadoop-default.xml"
           todir="${build.classes}"/>
+    <copy file="${conf.dir}/mapred-default.xml"
+          todir="${build.classes}"/>
     <jar jarfile="${build.dir}/${final.name}.jar"
          basedir="${build.classes}">
       <manifest>

Modified: lucene/hadoop/trunk/conf/hadoop-site.xml.template
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/conf/hadoop-site.xml.template?rev=375325&r1=375324&r2=375325&view=diff
==============================================================================
--- lucene/hadoop/trunk/conf/hadoop-site.xml.template (original)
+++ lucene/hadoop/trunk/conf/hadoop-site.xml.template Mon Feb  6 10:14:51 2006
@@ -1,8 +1,8 @@
 <?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="nutch-conf.xsl"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
 
 <!-- Put site-specific property overrides in this file. -->
 
-<nutch-conf>
+<configuration>
 
-</nutch-conf>
+</configuration>

Modified: lucene/hadoop/trunk/conf/mapred-default.xml.template
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/conf/mapred-default.xml.template?rev=375325&r1=375324&r2=375325&view=diff
==============================================================================
--- lucene/hadoop/trunk/conf/mapred-default.xml.template (original)
+++ lucene/hadoop/trunk/conf/mapred-default.xml.template Mon Feb  6 10:14:51 2006
@@ -1,8 +1,8 @@
 <?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="nutch-conf.xsl"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
 
 <!-- Put mapred-specific property overrides in this file. -->
 
-<nutch-conf>
+<configuration>
 
-</nutch-conf>
+</configuration>

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/conf/Configuration.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/conf/Configuration.java?rev=375325&r1=375324&r2=375325&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/conf/Configuration.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/conf/Configuration.java Mon Feb  6 10:14:51
2006
@@ -39,22 +39,19 @@
  * File, then the filesystem is examined directly, without referring to the
  * CLASSPATH.
  *
- * <p>Configuration resources are of three types: default, application and
- * final.  Default values are loaded first.  Final values are loaded last, and
- * thus override all other types.  Application values are loaded after defaults
- * and before finals, and can thus override default values but not final
- * values.
+ * <p>Configuration resources are of two types: default and
+ * final.  Default values are loaded first and final values are loaded last, and
+ * thus override default values.
  *
  * <p>Hadoop's default resource is the String "hadoop-default.xml" and its
  * final resource is the String "hadoop-site.xml".  Other tools built on Hadoop
- * may specify additional default resources.
+ * may specify additional resources.
  */
 public class Configuration {
   private static final Logger LOG =
     LogFormatter.getLogger("org.apache.hadoop.conf.Configuration");
 
   private ArrayList defaultResources = new ArrayList();
-  private ArrayList appResources = new ArrayList();
   private ArrayList finalResources = new ArrayList();
 
   private Properties properties;
@@ -70,22 +67,11 @@
   /** A new configuration with the same settings cloned from another. */
   public Configuration(Configuration other) {
     this.defaultResources = (ArrayList)other.defaultResources.clone();
-    this.appResources = (ArrayList)other.appResources.clone();
     this.finalResources = (ArrayList)other.finalResources.clone();
     if (other.properties != null)
       this.properties = (Properties)other.properties.clone();
   }
 
-  /** Add an application resource. */
-  public void addAppResource(String name) {
-    addResource(appResources, name);
-  }
-
-  /** Add an application resource. */
-  public void addAppResource(File file) {
-    addResource(appResources, file);
-  }
-
   /** Add a default resource. */
   public void addDefaultResource(String name) {
     addResource(defaultResources, name);
@@ -323,10 +309,8 @@
 
   private synchronized Properties getProps() {
     if (properties == null) {
-      Properties defaults = new Properties();     // keep defaults separate
-      Properties newProps = new Properties(defaults);
-      loadResources(defaults, defaultResources, false, false);
-      loadResources(newProps, appResources, false, false);
+      Properties newProps = new Properties();
+      loadResources(newProps, defaultResources, false, false);
       loadResources(newProps, finalResources, true, true);
       properties = newProps;
     }
@@ -450,8 +434,6 @@
     sb.append("Configuration: ");
     sb.append("defaults: ");
     toString(defaultResources, sb);
-    sb.append("app: ");
-    toString(appResources, sb);
     sb.append("final: ");
     toString(finalResources, sb);
     return sb.toString();

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobConf.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobConf.java?rev=375325&r1=375324&r2=375325&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobConf.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobConf.java Mon Feb  6 10:14:51
2006
@@ -63,7 +63,7 @@
    */
   public JobConf(Configuration conf) {
     super(conf);
-    addAppResource("mapred-default.xml");
+    addDefaultResource("mapred-default.xml");
   }
 
 
@@ -81,8 +81,8 @@
    */
   public JobConf(File config) {
     super();
-    addAppResource("mapred-default.xml");
-    addAppResource(config);
+    addDefaultResource("mapred-default.xml");
+    addDefaultResource(config);
   }
 
   public String getJar() { return get("mapred.jar"); }

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java?rev=375325&r1=375324&r2=375325&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java Mon Feb  6 10:14:51
2006
@@ -629,7 +629,7 @@
           Task task = umbilical.getTask(taskid);
           JobConf job = new JobConf(task.getJobFile());
 
-          conf.addAppResource(new File(task.getJobFile()));
+          conf.addFinalResource(new File(task.getJobFile()));
 
           startPinging(umbilical, taskid);        // start pinging parent
 



Mime
View raw message