conf package is about the configuration set about the whole system, which is frequently used in other packages. So we first examine it. Below is the annotation in configuration.java that is the most important part of this package.
/** Provides access to configuration parameters. Configurations are specified
* by resources. A resource contains a set of name/value pairs.
*
* <p>Each resources is named by either a String or by a File. If named by a
* String, then the classpath is examined for a file with that name. If a
* File, then the filesystem is examined directly, without referring to the
* CLASSPATH.
*
* <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 resources.
Let us see the members in the Configuration class below.
The member properties above is a kind of HashTable, which stores the content in the defaultResources and finalReources corresponding to file hadoop-default.xml and file hadoop-default.xml respectively.
Hadoop配置解析
本文介绍Hadoop中配置包的核心概念及使用方式。配置通过资源指定,资源包含一系列名称/值对。文章详细解释了默认资源与最终资源的区别,并介绍了Configuration类成员属性。

被折叠的 条评论
为什么被折叠?



