You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Sanjay Dahiya (JIRA)" <ji...@apache.org> on 2006/11/06 15:50:39 UTC

[jira] Updated: (HADOOP-682) hadoop namenode -format doesnt work anymore if target directory doesnt exist

     [ http://issues.apache.org/jira/browse/HADOOP-682?page=all ]

Sanjay Dahiya updated HADOOP-682:
---------------------------------

    Attachment: Hadoop-682.patch

This patch fixes the issue but formatting the namenode if the dir doesn't exist. 

> 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
>         Attachments: Hadoop-682.patch
>
>
> 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