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

Chris Douglas commented on HADOOP-8709:
---------------------------------------

+1 on restoring the 1.x semantics. Backwards compatibility is a concrete goal, 
and the correct semantics are not clear with the current API anyway.

The {{globStatus}} signature is unfortunate. It mixes URIs and regular 
expressions. It would be much clearer if the caller provided a base URI and a 
regexp to match descendants:

{code}
public RemoteIterator<FileStatus> glob(Path base, String regexp)
  throws IOException, FileNotFoundException, InterruptedException;
{code}

This can throw FNF if the base URI doesn't exist and return an empty iterator 
when the regexp doesn't match anything. At the time, the change to globStatus 
seemed to model this reasonably well (pre-glob char specify a base resource, 
segments after the first glob are part of the regexp), but I agree with the 
above: it's not worth the break in compatibility.
                
> 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

        

Reply via email to