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

Ravuri Sushma sree commented on HDFS-15203:
-------------------------------------------

Hi  [~kihwal]


In believe the intention behind this Unit Test was getting block locations 
using the following two overloaded methods in FileSystem.java

 
{code:java}
public BlockLocation[] getFileBlockLocations(FileStatus file,
 long start, long len) throws IOException {{code}
and 
{code:java}
public BlockLocation[] getFileBlockLocations(Path p,
 long start, long len) throws IOException {{code}
Coming to ViewFsBaseTest, there is no such getFileBlockLocations method in 
FileContext.java accepting FileStatus as parameter,

 
{code:java}
// Same test but now get it via the FileStatus Parameter
 fcView.getFileBlockLocations(viewFilePath, 0, 10240+100);
 targetBL = fcTarget.getFileBlockLocations(targetFilePath, 0, 10240+100);{code}
Looks redundant and in my opinion it should be removed.

> A bug in ViewFileSystemBaseTest
> -------------------------------
>
>                 Key: HDFS-15203
>                 URL: https://issues.apache.org/jira/browse/HDFS-15203
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Kihwal Lee
>            Priority: Trivial
>
> Missing an assignment here:
> {code:java}
>   @Test
>   public void testGetBlockLocations() throws IOException {
>     ...
>     // Same test but now get it via the FileStatus Parameter
>     fsView.getFileBlockLocations(
>         fsView.getFileStatus(viewFilePath), 0, 10240+100);
>     targetBL = fsTarget.getFileBlockLocations(
>         fsTarget.getFileStatus(targetFilePath), 0, 10240+100);
>     compareBLs(viewBL, targetBL);
>  {code}
> But more importantly, I am not sure what is the difference between this and 
> the previous check. Are they redundant?
> {code:java}
>     BlockLocation[] viewBL = 
> fsView.getFileBlockLocations(fsView.getFileStatus(viewFilePath), 0, 
> 10240+100);
>     Assert.assertEquals(SupportsBlocks ? 10 : 1, viewBL.length);
>     BlockLocation[] targetBL = 
> fsTarget.getFileBlockLocations(fsTarget.getFileStatus(targetFilePath), 0, 
> 10240+100);
>     compareBLs(viewBL, targetBL);
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
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