HDFS-208. name node should warn if only one dir is listed in dfs.name.dir. Contributed by Uma Maheswara Rao G

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1204119 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Eli Collins 2011-11-20 03:38:51 +00:00
parent 84f0c0f180
commit 0e5c1a45bf
2 changed files with 17 additions and 1 deletions

View File

@ -121,6 +121,9 @@ Release 0.23.1 - UNRELEASED
HDFS-2563. Some cleanup in BPOfferService. (todd)
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

@ -306,7 +306,20 @@ private static final void logAuditEvent(UserGroupInformation ugi,
* @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();