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

Íñigo Goiri commented on HDFS-14908:
------------------------------------

Thanks [~LiJinglun] for the patch.
{{DFSUtil#isParent()}} is a pretty common pattern so it is good to have it 
there.
I like the initial structure, but I would also split the last return with the 
OR into two if statements and return false at the end.
The compiler will end up doing the same but in this way it is a little more 
readable and we can add comments for each if.
BTW, another option would be to rely on {{Path}} which has a lot of this 
already.

> LeaseManager should check parent-child relationship when filter open files.
> ---------------------------------------------------------------------------
>
>                 Key: HDFS-14908
>                 URL: https://issues.apache.org/jira/browse/HDFS-14908
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 3.1.0, 3.0.1
>            Reporter: Jinglun
>            Assignee: Jinglun
>            Priority: Minor
>         Attachments: HDFS-14908.001.patch
>
>
> Now when doing listOpenFiles(), LeaseManager only checks whether the filter 
> path is the prefix of the open files. We should check whether the filter path 
> is the parent/ancestor of the open files.



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