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

Steve Loughran commented on HADOOP-9310:
----------------------------------------

The current behaviour from the base class is (unintetionally?) to return an 
empty location array on a directory.

This is a consequence of a directory having length 0, so the "gone off the end 
of the file" logic kicks in
{code}
    if (status.getLen() <= start) {
      return new BlockLocation[0];
    }
{code}
                
> {FileSystem,FileContext}.getFileBlockLocations() are incompletely and 
> incorrectly specified
> -------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-9310
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9310
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>            Reporter: Steve Loughran
>
> The javadocs of the {{getFileBlockLocations()}} methods in {{FileSystem}} and 
> {{FileContext}} incorrectly specify the result when a nonexistent region is 
> passed in (it's an empty array, not null), and nowhere is the response to a 
> call of the method against a directory defined.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to