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

Namenode should return error when trying to delete non-empty directory

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.8.0
    • 0.17.0
    • None
    • None
    • all

    • Incompatible change
    • Hide
      This patch adds a new api to file system i.e delete(path, boolean), deprecating the previous delete(path).
      the new api recursively deletes files only if boolean is set to true.
      If path is a file, the boolean value does not matter, if path is a directory and the directory is non empty delete(path, false) will throw an exception and delete(path, true) will delete all files recursively.
      Show
      This patch adds a new api to file system i.e delete(path, boolean), deprecating the previous delete(path). the new api recursively deletes files only if boolean is set to true. If path is a file, the boolean value does not matter, if path is a directory and the directory is non empty delete(path, false) will throw an exception and delete(path, true) will delete all files recursively.

    Description

      Currently, the namenode.delete() method allows recursive deletion of a directory. That is, even a non-empty directory could be deleted using namenode.delete(). To avoid costly programmer errors, the namenode should not remove the non-empty directories in this method. Recursively deleting directory should either be performed with listPaths() followed by a delete() for every path, or with a specific namenode method such as deleteRecursive().

      Attachments

        1. Hadoop-771_8.patch
          95 kB
          Mahadev Konar
        2. Hadoop-771_7.patch
          95 kB
          Mahadev Konar
        3. Hadoop-771_6.patch
          95 kB
          Mahadev Konar
        4. Hadoop-771_5.patch
          93 kB
          Mahadev Konar
        5. Hadoop-771_4.patch
          15 kB
          Mahadev Konar
        6. Hadoop-771_3.patch
          14 kB
          Mahadev Konar
        7. Hadoop-771_2.patch
          14 kB
          Mahadev Konar
        8. patch_771_1.patch
          12 kB
          Mahadev Konar

        Issue Links

          Activity

            People

              mahadev Mahadev Konar
              milindb Milind Barve
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: