Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Not sure if this was intended, but hadoop namenode -format doesnt work anymore if the target directory doesnt exist due to the check in the NameNode.main(). It used to work earlier
if (argv.length == 1 && argv[0].equals("-format")) {
boolean aborted = false;
File[] dirs = getDirs(conf);
for (int idx = 0; idx < dirs.length; idx++) {
if (dirs[idx].exists()) { <<<====== if dir doesnt exist it won't format
System.err.print("Re-format filesystem in " + dirs[idx] +" ? (Y or N) ");
if (!(System.in.read() == 'Y'))
else
{ format(dirs[idx]); System.err.println("Formatted "+dirs[idx]); } System.in.read(); // discard the enter-key
}
}
System.exit(aborted ? 1 : 0);
}