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

Ayush Saxena commented on HDFS-15766:
-------------------------------------

Thanx [~LiJinglun], Checked the test again. Firstly :

{code:java}
-    routerProtocol.delete(mountPoint, true);
+    nnProtocol.delete(mountPoint, true);
{code}
Changing to {{nnProtocol}} isn't correct either, It returns {{false}] since 
{{mountPoint}} which is {{/mntsnapshot}} doesn't exist in the Namenode side. 
Hence it isn't of any use, (If you wrap this delete with assertTrue, it would 
return false and assertion will fail).

I think the correct thing in the test is to do this instead:
1. 
{code:java}
    assertTrue(routerProtocol.delete(snapshotFolder, true));
{code}
2.
Remove:
{code:java}
    routerProtocol.mkdirs(mountPoint, permission, false);
{code}

Since the mountPoint is already there, we added the mountPoint to resolver, 
Correct?

3. In the end remove {{mountPoint}} from the resolver.

4. Even better if we do this cleanup in a {{finally}} block.

nit:

{code:java}
 * @return Return zero-length list if the path is a mount point but there are
{code}
empty list sounds better than zero-length list

Other than that things looks ok

> RBF: MockResolver.getMountPoints() breaks the semantic of 
> FileSubclusterResolver.
> ---------------------------------------------------------------------------------
>
>                 Key: HDFS-15766
>                 URL: https://issues.apache.org/jira/browse/HDFS-15766
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Jinglun
>            Assignee: Jinglun
>            Priority: Major
>         Attachments: HDFS-15766.001.patch, HDFS-15766.002.patch
>
>
> MockResolver.getMountPoints() breaks the semantic of 
> FileSubclusterResolver.getMountPoints(). Currently it returns null when the 
> path is a mount point and no mount points are under the path. 
> {quote}Return zero-length list if the path is a mount point but there are no 
> mount points under the path.
> {quote}
>  
> This is required by router federation rename. I found this bug when writing 
> unit test for the rbf rename. Let's fix it here to avoid mixing up with the 
> router federation rename.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to