[ 
https://issues.apache.org/jira/browse/HADOOP-8709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437920#comment-13437920
 ] 

Daryn Sharp commented on HADOOP-8709:
-------------------------------------

While I'm inclined to agree that the glob handling should be better, this is a 
non-trivial change for users to add an instantiation of {{GlobFilter}} (which 
seems like a possible misuse of the class) to determine if {{listStatus}} or 
{{globStatus}} should be called.  Then they also need to catch an unexpected 
exception where none was generated before.

This method is often used to poll if files exist yet (ex. 
{{/some-path/$TIMESTAMP/\*.blah}}). That code will break when the $TIMESTAMP 
dir doesn't exist yet.  There are also so many inconsistencies when the 
exception will be thrown.  Ex. "/path/does-not-exist/*" throws, but 
"/path/{does-not-exist,me-neither}/*" will not...  I'm also worried by the fact 
that existing code might now erroneously decide to create paths with metachars 
when a glob's parent dir doesn't exist.

I think this wasn't a conscious incompatibility, but was broken by the 
{{listStatus}} change.  I think it's a bad change since it fundamentally 
changes the semantics of 1.x behavior.  I'd say a new method should be used to 
introduce this new behavior and we should restore the previous behavior per the 
javadoc.
                
> 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
>
>
> 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

        

Reply via email to