HDFS-208. Merge r1204119 from trunk to 0.23

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1298231 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Suresh Srinivas 2012-03-07 23:53:12 +00:00
parent 9aa829fe67
commit 985eb07407
2 changed files with 17 additions and 1 deletions

View File

@ -373,6 +373,9 @@ Release 0.23.1 - 2012-02-17
HDFS-2786. Fix host-based token incompatibilities in DFSUtil. (Kihwal
Lee via jitendra)
HDFS-208. name node should warn if only one dir is listed in dfs.name.dir.
(Uma Maheswara Rao G via eli)
OPTIMIZATIONS
HDFS-2130. Switch default checksum to CRC32C. (todd)

View File

@ -310,7 +310,20 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
* @throws IOException if loading fails
*/
public static FSNamesystem loadFromDisk(Configuration conf) throws IOException {
FSImage fsImage = new FSImage(conf);
Collection<URI> namespaceDirs = FSNamesystem.getNamespaceDirs(conf);
Collection<URI> namespaceEditsDirs =
FSNamesystem.getNamespaceEditsDirs(conf);
if (namespaceDirs.size() == 1) {
LOG.warn("Only one " + DFS_NAMENODE_NAME_DIR_KEY
+ " directory configured , beware data loss!");
}
if (namespaceEditsDirs.size() == 1) {
LOG.warn("Only one " + DFS_NAMENODE_EDITS_DIR_KEY
+ " directory configured , beware data loss!");
}
FSImage fsImage = new FSImage(conf, namespaceDirs, namespaceEditsDirs);
FSNamesystem namesystem = new FSNamesystem(conf, fsImage);
long loadStart = now();