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

DistributedFileSystem::listStatus incorrectly returns null for empty result sets

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.20.1, 0.20.2
    • Fix Version/s: 0.21.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Incompatible change, Reviewed
    • Release Note:
      FileSystem.listStatus() previously returned null for empty or nonexistent directories; will now return empty array for empty directories and throw FileNotFoundException for non-existent directory. Client code should be updated for new semantics.

      Description

      Currently the listStatus method returns null if no files match the request. This differs from the Checksum/LocalFileSystem implementation, which returns an empty array, and the nontvery-explict prescription of the FileSystem interface: "@return the statuses of the files/directories in the given patch" It's better to return an empty collection than have to add extra null checks. The method should return an empty array.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jghoman Jakob Homan
                Reporter:
                jghoman Jakob Homan
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: