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

Bharat Viswanadham commented on HDFS-12681:
-------------------------------------------

[~chris.douglas]
Thank You for info.
Yes, we have observed it being returning null.


{noformat}
In the cases we found (though this wasn't exhaustive), clients that used 
locations requested the locations in the first request (receiving 
LocatedFileStatus), not using 2 RPCs.

{noformat}

So, I need to call this makeQualifiedLocated

((LocatedFileStatus) file).makeQualifiedLocated(URI defaultUri,path) and then 
call
 ((LocatedFileStatus) file).getBlockLocations(); 

And now need to remove the code of using
{noformat}
 (file instanceof LocatedFileStatus)
{noformat}
as now it can't distiniguish whether it needs an RPC call, so we need to 
directly call fs.getFileBlockLocations?

{code:java}
As from code comments, it is mentioned 
/**
   * This function is used to transform the underlying HDFS LocatedBlocks to
   * BlockLocations. This method must be invoked before
   * {@link #getBlockLocations()}.
**/
{code}



> Fold HdfsLocatedFileStatus into HdfsFileStatus
> ----------------------------------------------
>
>                 Key: HDFS-12681
>                 URL: https://issues.apache.org/jira/browse/HDFS-12681
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Chris Douglas
>            Assignee: Chris Douglas
>            Priority: Minor
>             Fix For: 3.1.0
>
>         Attachments: HDFS-12681.00.patch, HDFS-12681.01.patch, 
> HDFS-12681.02.patch, HDFS-12681.03.patch, HDFS-12681.04.patch, 
> HDFS-12681.05.patch, HDFS-12681.06.patch, HDFS-12681.07.patch, 
> HDFS-12681.08.patch, HDFS-12681.09.patch, HDFS-12681.10.patch
>
>
> {{HdfsLocatedFileStatus}} is a subtype of {{HdfsFileStatus}}, but not of 
> {{LocatedFileStatus}}. Conversion requires copying common fields and shedding 
> unknown data. It would be cleaner and sufficient for {{HdfsFileStatus}} to 
> extend {{LocatedFileStatus}}.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to