hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Lowe (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HADOOP-8709) globStatus changed behavior from 0.20/1.x
Date Tue, 21 Aug 2012 14:58:38 GMT

     [ https://issues.apache.org/jira/browse/HADOOP-8709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jason Lowe updated HADOOP-8709:
-------------------------------

    Attachment: HADOOP-8709.patch

Yes, I saw the discussion, but it seemed focused on listStatus and not globStatus.  I understand
the desire to differentiate between a non-existent and empty directory for listStatus, but
I'm not sure that applies to globStatus.  Most callers are not going to expect to handle *three*
types of behavior from globStatus when files are not found, as it currently can return null,
an empty array, or throw FNFE depending upon the situation.  Most callers simply care if there
were files found or not.  One might wonder why it isn't always throwing FNFE if nothing is
found.

I think backwards compatibility is an important goal, so my preference would be to preserve
the 1.x behavior.  Attaching a patch to that effect.  If there's enough demand for the FNFE
behavior, we can add an alternate interface so new clients can access that functionality without
breaking existing clients.

If we decide that it's more important for globStatus to throw FNFE than preserve compatibility
with 1.x, I think we should clean it up so it's consistent about it -- either always throw
FNFE or at a minimum stop returning null so callers only have to check for an empty array
or catch FNFE to realize no file was found.
                
> globStatus changed behavior from 0.20/1.x
> -----------------------------------------
>
>                 Key: HADOOP-8709
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8709
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.0, 2.0.0-alpha
>            Reporter: Jason Lowe
>            Assignee: Jason Lowe
>            Priority: Critical
>         Attachments: HADOOP-8709.patch, HADOOP-8709.patch
>
>
> In 0.20 or 1.x, globStatus will return an empty array if the glob pattern does not match
any files.  After HADOOP-6201 it throws FileNotFoundException.  The javadoc states it will
return an empty array.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message