Hadoop Common
  1. Hadoop Common
  2. HADOOP-771

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

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.8.0
    • Fix Version/s: 0.17.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      all

    • Hadoop Flags:
      Incompatible change
    • Release Note:
      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().

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

        Issue Links

          Activity

            People

            • Assignee:
              Mahadev konar
              Reporter:
              Milind Bhandarkar
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development