Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-682

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.0
    • Component/s: None
    • Labels:
      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'))

      { 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);
      }

        Attachments

        1. Hadoop-682.patch
          0.6 kB
          Sanjay Dahiya

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sanjay.dahiya Sanjay Dahiya
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: