hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r427683 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/conf/Configuration.java
Date Tue, 01 Aug 2006 19:19:14 GMT
Author: cutting
Date: Tue Aug  1 12:19:13 2006
New Revision: 427683

URL: http://svn.apache.org/viewvc?rev=427683&view=rev
Log:
HADOOP-377.  Permit one to add URL resources to a Configuration.  Contributed by Jean-Baptiste
Quenot.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/conf/Configuration.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?rev=427683&r1=427682&r2=427683&view=diff
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Tue Aug  1 12:19:13 2006
@@ -114,6 +114,9 @@
 32. HADOOP-396.  Make DatanodeID implement Writable.
     (Konstantin Shvachko via cutting)
 
+33. HADOOP-377.  Permit one to add URL resources to a Configuration.
+    (Jean-Baptiste Quenot via cutting)
+
 
 Release 0.4.0 - 2006-06-28
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/conf/Configuration.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/conf/Configuration.java?rev=427683&r1=427682&r2=427683&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 Tue Aug  1 12:19:13
2006
@@ -88,6 +88,11 @@
   }
 
   /** Add a default resource. */
+  public void addDefaultResource(URL url) {
+    addResource(defaultResources, url);
+  }
+
+  /** Add a default resource. */
   public void addDefaultResource(Path file) {
     addResource(defaultResources, file);
   }
@@ -98,6 +103,11 @@
   }
 
   /** Add a final resource. */
+  public void addFinalResource(URL url) {
+    addResource(finalResources, url);
+  }
+
+  /** Add a final resource. */
   public void addFinalResource(Path file) {
     addResource(finalResources, file);
   }
@@ -391,7 +401,14 @@
         DocumentBuilderFactory.newInstance().newDocumentBuilder();
       Document doc = null;
 
-      if (name instanceof String) {               // a CLASSPATH resource
+
+      if (name instanceof URL) {                  // an URL resource
+        URL url = (URL)name;
+        if (url != null) {
+          LOG.info("parsing " + url);
+          doc = builder.parse(url.toString());
+        }
+      } else if (name instanceof String) {        // a CLASSPATH resource
         URL url = getResource((String)name);
         if (url != null) {
           LOG.info("parsing " + url);



Mime
View raw message