Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-303

Make contracts of LocalFileSystem and DistributedFileSystem consistent

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      There are a number of edge cases that the two file system implementations handle differently. In particular:

      • When trying to make a directory under an existing file, HDFS throws an IOException while LocalFileSystem doesn't.
      • The FileSytem#listStatus(Path) method returns null for a non-existent file on HDFS, while LocalFileSytem returns an empty FileStatus array.
      • When trying to rename a non-existent path, LocalFileSystem throws an IOException, while HDFS returns false.
      • When renaming a file or directory to a non-existent directory (e.g. /a/b to /c/d, where /c doesn't exist) LocalFileSystem succeeds (returns true) while HDFS fails (false).
      • When renaming a file (or directory) as an existing file (or directory) LocalFileSystem succeeds (returns true) while HDFS fails (false).
        We should document the expected behaviour for these cases in FileSystem's javadoc, and make sure all implementations conform to it.

        Attachments

        1. hadoop-4114.patch
          2 kB
          Tom White
        2. HDFS-303.patch
          2 kB
          Tom White
        3. HDFS-303-common-test-case.patch
          2 kB
          Tom White

          Issue Links

            Activity

              People

              • Assignee:
                boky01 Andras Bokor
                Reporter:
                tomwhite Tom White
              • Votes:
                0 Vote for this issue
                Watchers:
                15 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: