hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom White (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HDFS-538) DistributedFileSystem::listStatus incorrectly returns null for empty result sets
Date Fri, 14 Aug 2009 08:59:14 GMT

    [ https://issues.apache.org/jira/browse/HDFS-538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743140#action_12743140
] 

Tom White commented on HDFS-538:
--------------------------------

How do we distinguish between an empty directory and a non-existent file (or directory)? In
the current implementation, an empty directory returns an empty array, and a non-existent
file returns null. I think we should keep this distinction and change the documentation of
FileSystem, and the implementation of LocalFileSystem to conform.

bq. it seems to me to be important to fix the semantics sooner than later.

I agree. This should be made clear in the release notes.

> DistributedFileSystem::listStatus incorrectly returns null for empty result sets
> --------------------------------------------------------------------------------
>
>                 Key: HDFS-538
>                 URL: https://issues.apache.org/jira/browse/HDFS-538
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Jakob Homan
>            Assignee: Jakob Homan
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message