hadoop namenode -format doesnt work anymore if target directory doesnt exist
----------------------------------------------------------------------------

                 Key: HADOOP-682
                 URL: http://issues.apache.org/jira/browse/HADOOP-682
             Project: Hadoop
          Issue Type: Bug
          Components: dfs
            Reporter: Sanjay Dahiya


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')) {
                System.err.println("Format aborted in "+ dirs[idx]);
                aborted = true;
              } else {
                format(dirs[idx]);
                System.err.println("Formatted "+dirs[idx]);
              }
              System.in.read(); // discard the enter-key
            }
          }
          System.exit(aborted ? 1 : 0);
        }




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to