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

DistributedFileSystem::listStatus incorrectly returns null for empty result sets

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.20.1, 0.20.2
    • 0.21.0
    • None
    • None
    • Incompatible change, Reviewed
    • 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

        1. HDFS-538.patch
          2 kB
          Jakob Homan

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: