Code analysis of Hadoop v0.1.0 (2) conf package

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.


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章