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

HDFS throws FileNotFoundException on getFileBlockLocations(path-to-directory)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 3.1.2
    • None
    • namenode
    • None

    Description

      The HDFS implementation of getFileBlockLocations(path, offset, len) throws an exception if the path references a directory.

      The base implementation (and all other filesystems) just return an empty array, something implemented in getFileBlockLocations(filestatsus, offset, len); something written up in filesystem.md as the correct behaviour.

      1. has been shown to break things: SPARK-14959
      2. there's no contract tests for these APIs; shows up in HADOOP-15044.
      3. even if this is considered a wontfix, it should raise something like PathIsDirectoryException rather than FNFE

      Attachments

        1. HDFS-12831.001.patch
          3 kB
          Hemanth Boyina

        Issue Links

          Activity

            People

              hemanthboyina Hemanth Boyina
              stevel@apache.org Steve Loughran
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: