Author: cdouglas
Date: Fri Dec 12 12:12:04 2008
New Revision: 726108
URL: http://svn.apache.org/viewvc?rev=726108&view=rev
Log:
Revert HADOOP-4631
Added:
hadoop/core/trunk/conf/hadoop-default.xml
- copied unchanged from r726074, hadoop/core/trunk/conf/hadoop-default.xml
hadoop/core/trunk/conf/hadoop-site.xml.template
- copied unchanged from r726074,
hadoop/core/trunk/conf/hadoop-site.xml.template
hadoop/core/trunk/src/c++/libhdfs/tests/conf/hadoop-site.xml
- copied unchanged from r726074,
hadoop/core/trunk/src/c++/libhdfs/tests/conf/hadoop-site.xml
hadoop/core/trunk/src/contrib/test/hadoop-site.xml
- copied unchanged from r726074,
hadoop/core/trunk/src/contrib/test/hadoop-site.xml
hadoop/core/trunk/src/test/hadoop-site.xml
- copied unchanged from r726074,
hadoop/core/trunk/src/test/hadoop-site.xml
Removed:
hadoop/core/trunk/conf/core-site.xml.template
hadoop/core/trunk/conf/hdfs-site.xml.template
hadoop/core/trunk/conf/mapred-site.xml.template
hadoop/core/trunk/src/c++/libhdfs/tests/conf/core-site.xml
hadoop/core/trunk/src/c++/libhdfs/tests/conf/hdfs-site.xml
hadoop/core/trunk/src/contrib/test/core-site.xml
hadoop/core/trunk/src/contrib/test/hdfs-site.xml
hadoop/core/trunk/src/contrib/test/mapred-site.xml
hadoop/core/trunk/src/core/core-default.xml
hadoop/core/trunk/src/hdfs/hdfs-default.xml
hadoop/core/trunk/src/mapred/mapred-default.xml
hadoop/core/trunk/src/test/core-site.xml
hadoop/core/trunk/src/test/hdfs-site.xml
hadoop/core/trunk/src/test/mapred-site.xml
Modified:
hadoop/core/trunk/CHANGES.txt
hadoop/core/trunk/build.xml
hadoop/core/trunk/src/core/org/apache/hadoop/conf/Configuration.java
hadoop/core/trunk/src/core/org/apache/hadoop/fs/FsShell.java
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java
hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobClient.java
hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobConf.java
hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobTracker.java
hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskTracker.java
hadoop/core/trunk/src/test/org/apache/hadoop/conf/TestConfiguration.java
hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestDFSShellGenericOptions.java
hadoop/core/trunk/src/test/org/apache/hadoop/mapred/MiniMRCluster.java
Modified: hadoop/core/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=726108&r1=726107&r2=726108&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Fri Dec 12 12:12:04 2008
@@ -54,9 +54,6 @@
percentage in capacity scheduler UI. (Sreekanth Ramakrishnan via
yhemanth)
- HADOOP-4631. Splits the configuration into three parts - one for core,
- one for mapred and the last one for HDFS. (Sharad Agarwal via ddas)
-
NEW FEATURES
HADOOP-4575. Add a proxy service for relaying HsftpFileSystem requests.
Modified: hadoop/core/trunk/build.xml
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/build.xml?rev=726108&r1=726107&r2=726108&view=diff
==============================================================================
--- hadoop/core/trunk/build.xml (original)
+++ hadoop/core/trunk/build.xml Fri Dec 12 12:12:04 2008
@@ -315,7 +315,6 @@
<copy todir="${build.classes}">
<fileset dir="${core.src.dir}" includes="**/*.properties"/>
- <fileset dir="${core.src.dir}" includes="core-default.xml"/>
</copy>
</target>
@@ -352,7 +351,6 @@
<copy todir="${build.classes}">
<fileset dir="${mapred.src.dir}" includes="**/*.properties"/>
- <fileset dir="${mapred.src.dir}" includes="mapred-default.xml"/>
</copy>
</target>
@@ -388,7 +386,6 @@
<copy todir="${build.classes}">
<fileset dir="${hdfs.src.dir}" includes="**/*.properties"/>
- <fileset dir="${hdfs.src.dir}" includes="hdfs-default.xml"/>
</copy>
</target>
@@ -523,6 +520,7 @@
<attribute name="Implementation-Vendor" value="Apache"/>
</section>
</manifest>
+ <fileset file="${conf.dir}/hadoop-default.xml"/>
<fileset file="${conf.dir}/commons-logging.properties"/>
<fileset file="${conf.dir}/log4j.properties"/>
<fileset file="${conf.dir}/hadoop-metrics.properties"/>
@@ -839,12 +837,8 @@
<copy todir="${docs.dir}">
<fileset dir="${docs.src}/build/site/" />
</copy>
- <style basedir="${core.src.dir}" destdir="${docs.dir}"
- includes="core-default.xml" style="conf/configuration.xsl"/>
- <style basedir="${hdfs.src.dir}" destdir="${docs.dir}"
- includes="hdfs-default.xml" style="conf/configuration.xsl"/>
- <style basedir="${mapred.src.dir}" destdir="${docs.dir}"
- includes="mapred-default.xml" style="conf/configuration.xsl"/>
+ <style basedir="${conf.dir}" destdir="${docs.dir}"
+ includes="hadoop-default.xml" style="conf/configuration.xsl"/>
<antcall target="changes-to-html"/>
<antcall target="cn-docs"/>
</target>
@@ -859,12 +853,8 @@
<copy todir="${cndocs.dir}">
<fileset dir="${cndocs.src}/build/site/" />
</copy>
- <style basedir="${core.src.dir}" destdir="${cndocs.dir}"
- includes="core-default.xml" style="conf/configuration.xsl"/>
- <style basedir="${hdfs.src.dir}" destdir="${cndocs.dir}"
- includes="hdfs-default.xml" style="conf/configuration.xsl"/>
- <style basedir="${mapred.src.dir}" destdir="${cndocs.dir}"
- includes="mapred-default.xml" style="conf/configuration.xsl"/>
+ <style basedir="${conf.dir}" destdir="${cndocs.dir}"
+ includes="hadoop-default.xml" style="conf/configuration.xsl"/>
<antcall target="changes-to-html"/>
</target>
Modified: hadoop/core/trunk/src/core/org/apache/hadoop/conf/Configuration.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/conf/Configuration.java?rev=726108&r1=726107&r2=726108&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/conf/Configuration.java
(original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/conf/Configuration.java Fri
Dec 12 12:12:04 2008
@@ -41,7 +41,6 @@
import java.util.Properties;
import java.util.Set;
import java.util.StringTokenizer;
-import java.util.WeakHashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -82,9 +81,9 @@
*
* <p>Unless explicitly turned off, Hadoop by default specifies two
* resources, loaded in-order from the classpath: <ol>
- * <li><tt><a href="{...@docroot}/../core-default.html">core-default.xml</a>
+ * <li><tt><a
href="{...@docroot}/../hadoop-default.html">hadoop-default.xml</a>
* </tt>: Read-only defaults for hadoop.</li>
- * <li><tt>core-site.xml</tt>: Site-specific configuration for a given hadoop
+ * <li><tt>hadoop-site.xml</tt>: Site-specific configuration for a given hadoop
* installation.</li>
* </ol>
* Applications may add additional resources, which are loaded
@@ -104,7 +103,7 @@
* </property></pre></tt>
*
* Administrators typically define parameters as final in
- * <tt>core-site.xml</tt> for values that user applications may not alter.
+ * <tt>hadoop-site.xml</tt> for values that user applications may not alter.
*
* <h4 id="VariableExpansion">Variable Expansion</h4>
*
@@ -150,38 +149,6 @@
*/
private Set<String> finalParameters = new HashSet<String>();
- private boolean loadDefaults = true;
-
- /**
- * Configurtion objects
- */
- private static final WeakHashMap<Configuration,Object> REGISTRY =
- new WeakHashMap<Configuration,Object>();
-
- /**
- * List of default Resources. Resources are loaded in the order of the list
- * entries
- */
- private static final ArrayList<String> defaultResources =
- new ArrayList<String>();
-
- static{
- //print deprecation warning if hadoop-site.xml is found in classpath
- ClassLoader cL = Thread.currentThread().getContextClassLoader();
- if (cL == null) {
- cL = Configuration.class.getClassLoader();
- }
- if(cL.getResource("hadoop-site.xml")!=null) {
- LOG.warn("DEPRECATED: hadoop-site.xml found in the classpath. " +
- "Usage of hadoop-site.xml is deprecated. Instead use core-site.xml, "
- + "mapred-site.xml and hdfs-site.xml to override properties of " +
- "core-default.xml, mapred-default.xml and hdfs-default.xml " +
- "respectively");
- }
- addDefaultResource("core-default.xml");
- addDefaultResource("core-site.xml");
- }
-
private Properties properties;
private Properties overlay;
private ClassLoader classLoader;
@@ -205,12 +172,12 @@
* @param loadDefaults specifies whether to load from the default files
*/
public Configuration(boolean loadDefaults) {
- this.loadDefaults = loadDefaults;
if (LOG.isDebugEnabled()) {
LOG.debug(StringUtils.stringifyException(new IOException("config()")));
}
- synchronized(Configuration.class) {
- REGISTRY.put(this, null);
+ if (loadDefaults) {
+ resources.add("hadoop-default.xml");
+ resources.add("hadoop-site.xml");
}
}
@@ -238,25 +205,6 @@
}
this.finalParameters = new HashSet<String>(other.finalParameters);
- synchronized(Configuration.class) {
- REGISTRY.put(this, null);
- }
- }
-
- /**
- * Add a default resource. Resources are loaded in the order of the
resources
- * added.
- * @param name file name. File should be present in the classpath.
- */
- public static synchronized void addDefaultResource(String name) {
- if(!defaultResources.contains(name)) {
- defaultResources.add(name);
- for(Configuration conf : REGISTRY.keySet()) {
- if(conf.loadDefaults) {
- conf.reloadConfiguration();
- }
- }
- }
}
/**
@@ -1004,17 +952,6 @@
private void loadResources(Properties properties,
ArrayList resources,
boolean quiet) {
- if(loadDefaults) {
- for (String resource : defaultResources) {
- loadResource(properties, resource, quiet);
- }
-
- //support the hadoop-site.xml as a deprecated case
- if(getResource("hadoop-site.xml")!=null) {
- loadResource(properties, "hadoop-site.xml", quiet);
- }
- }
-
for (Object resource : resources) {
loadResource(properties, resource, quiet);
}
@@ -1201,12 +1138,6 @@
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("Configuration: ");
- if(loadDefaults) {
- toString(defaultResources, sb);
- if(resources.size()>0) {
- sb.append(", ");
- }
- }
toString(resources, sb);
return sb.toString();
}
Modified: hadoop/core/trunk/src/core/org/apache/hadoop/fs/FsShell.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/fs/FsShell.java?rev=726108&r1=726107&r2=726108&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/fs/FsShell.java (original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/fs/FsShell.java Fri Dec 12
12:12:04 2008
@@ -1256,8 +1256,9 @@
String fs = "-fs [local | <file system URI>]: \tSpecify the file system to
use.\n" +
"\t\tIf not specified, the current configuration is used, \n" +
"\t\ttaken from the following, in increasing precedence: \n" +
- "\t\t\tcore-default.xml inside the hadoop jar file \n" +
- "\t\t\tcore-site.xml in $HADOOP_CONF_DIR \n" +
+ "\t\t\thadoop-default.xml inside the hadoop jar file \n" +
+ "\t\t\thadoop-default.xml in $HADOOP_CONF_DIR \n" +
+ "\t\t\thadoop-site.xml in $HADOOP_CONF_DIR \n" +
"\t\t'local' means use the local file system as your DFS. \n" +
"\t\t<file system URI> specifies a particular file system to \n" +
"\t\tcontact. This argument is optional but if used must appear\n" +
Modified:
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java?rev=726108&r1=726107&r2=726108&view=diff
==============================================================================
---
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
(original)
+++
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java
Fri Dec 12 12:12:04 2008
@@ -48,11 +48,6 @@
DFSClient dfs;
private boolean verifyChecksum = true;
-
- static{
- Configuration.addDefaultResource("hdfs-default.xml");
- Configuration.addDefaultResource("hdfs-site.xml");
- }
public DistributedFileSystem() {
}
@@ -444,6 +439,4 @@
) throws IOException {
dfs.setTimes(getPathName(p), mtime, atime);
}
-
-
}
Modified:
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java?rev=726108&r1=726107&r2=726108&view=diff
==============================================================================
---
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java
(original)
+++
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java
Fri Dec 12 12:12:04 2008
@@ -126,11 +126,6 @@
public class DataNode extends Configured
implements InterDatanodeProtocol, ClientDatanodeProtocol, FSConstants,
Runnable {
public static final Log LOG = LogFactory.getLog(DataNode.class);
-
- static{
- Configuration.addDefaultResource("hdfs-default.xml");
- Configuration.addDefaultResource("hdfs-site.xml");
- }
public static final String DN_CLIENTTRACE_FORMAT =
"src: %s" + // src IP
Modified:
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java?rev=726108&r1=726107&r2=726108&view=diff
==============================================================================
---
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java
(original)
+++
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NameNode.java
Fri Dec 12 12:12:04 2008
@@ -96,11 +96,6 @@
public class NameNode implements ClientProtocol, DatanodeProtocol,
NamenodeProtocol, FSConstants,
RefreshAuthorizationPolicyProtocol {
- static{
- Configuration.addDefaultResource("hdfs-default.xml");
- Configuration.addDefaultResource("hdfs-site.xml");
- }
-
public long getProtocolVersion(String protocol,
long clientVersion) throws IOException {
if (protocol.equals(ClientProtocol.class.getName())) {
Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobClient.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobClient.java?rev=726108&r1=726107&r2=726108&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobClient.java
(original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobClient.java Fri
Dec 12 12:12:04 2008
@@ -157,11 +157,6 @@
private TaskStatusFilter taskOutputFilter = TaskStatusFilter.FAILED;
static long MAX_JOBPROFILE_AGE = 1000 * 2;
- static{
- Configuration.addDefaultResource("mapred-default.xml");
- Configuration.addDefaultResource("mapred-site.xml");
- }
-
/**
* A NetworkedJob is an implementation of RunningJob. It holds
* a JobProfile object to provide some info, and interacts with the
Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobConf.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobConf.java?rev=726108&r1=726107&r2=726108&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobConf.java
(original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobConf.java Fri Dec
12 12:12:04 2008
@@ -104,11 +104,6 @@
private static final Log LOG = LogFactory.getLog(JobConf.class);
- static{
- Configuration.addDefaultResource("mapred-default.xml");
- Configuration.addDefaultResource("mapred-site.xml");
- }
-
/**
* A value which if set for memory related configuration options,
* indicates that the options are turned off.
Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobTracker.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobTracker.java?rev=726108&r1=726107&r2=726108&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobTracker.java
(original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobTracker.java Fri
Dec 12 12:12:04 2008
@@ -86,11 +86,6 @@
public class JobTracker implements MRConstants, InterTrackerProtocol,
JobSubmissionProtocol, TaskTrackerManager,
RefreshAuthorizationPolicyProtocol {
- static{
- Configuration.addDefaultResource("mapred-default.xml");
- Configuration.addDefaultResource("mapred-site.xml");
- }
-
static long TASKTRACKER_EXPIRY_INTERVAL = 10 * 60 * 1000;
static long RETIRE_JOB_INTERVAL;
static long RETIRE_JOB_CHECK_INTERVAL;
Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskTracker.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskTracker.java?rev=726108&r1=726107&r2=726108&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskTracker.java
(original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskTracker.java Fri
Dec 12 12:12:04 2008
@@ -101,11 +101,6 @@
static enum State {NORMAL, STALE, INTERRUPTED, DENIED}
- static{
- Configuration.addDefaultResource("mapred-default.xml");
- Configuration.addDefaultResource("mapred-site.xml");
- }
-
public static final Log LOG =
LogFactory.getLog(TaskTracker.class);
Modified:
hadoop/core/trunk/src/test/org/apache/hadoop/conf/TestConfiguration.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/conf/TestConfiguration.java?rev=726108&r1=726107&r2=726108&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/conf/TestConfiguration.java
(original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/conf/TestConfiguration.java
Fri Dec 12 12:12:04 2008
@@ -224,7 +224,7 @@
conf.addResource(fileResource);
String expectedOutput =
- "Configuration: core-default.xml, core-site.xml, " +
+ "Configuration: hadoop-default.xml, hadoop-site.xml, " +
fileResource.toString();
assertEquals(expectedOutput, conf.toString());
}
Modified:
hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestDFSShellGenericOptions.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestDFSShellGenericOptions.java?rev=726108&r1=726107&r2=726108&view=diff
==============================================================================
---
hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestDFSShellGenericOptions.java
(original)
+++
hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestDFSShellGenericOptions.java
Fri Dec 12 12:12:04 2008
@@ -60,10 +60,10 @@
}
private void testConfOption(String[] args, String namenode) {
- // prepare configuration hdfs-site.xml
+ // prepare configuration hadoop-site.xml
File configDir = new File(new File("build", "test"), "minidfs");
assertTrue(configDir.mkdirs());
- File siteFile = new File(configDir, "hdfs-site.xml");
+ File siteFile = new File(configDir, "hadoop-site.xml");
PrintWriter pw;
try {
pw = new PrintWriter(siteFile);
Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/MiniMRCluster.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/MiniMRCluster.java?rev=726108&r1=726107&r2=726108&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/MiniMRCluster.java
(original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/MiniMRCluster.java Fri
Dec 12 12:12:04 2008
@@ -606,7 +606,7 @@
stopJobTracker();
} finally {
File configDir = new File("build", "minimr");
- File siteFile = new File(configDir, "mapred-site.xml");
+ File siteFile = new File(configDir, "hadoop-site.xml");
siteFile.delete();
}
}