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

Jinglun commented on HDFS-14908:
--------------------------------

Hi [~hexiaoqiao], v01 is not the final version using Strings.startsWith() and 
character comparison. I upload v04 as the final version of 
*[startsWIthAndCharAt]*.

 

Hi [~elgoiri] , v02~v04 use different ways to implement DFSUtil.isParnet(). 
{quote}v04 uses String.startsWith() + char comparison.   *[startsWIthAndCharAt]*

v02 uses String.startsWith().                                        
*[startsWith]*

v03 uses optimized startsWith().                                *[isParent]*

 

v02 + v03 are designed for common use while v04 only cover the case of 
listOpenFiles().
{quote}
[~hexiaoqiao] prefer using *[**startsWIthAndCharAt/v04**]* because that would 
be more readable and performance cost diff is small.

I'd prefer *[isParent/v03]* because I want DFSUtil.isParnet() to be a common 
method. If using *[**startsWIthAndCharAt/v04**]* then it won't be common 
because it doesn't cover all the cases. *[isParnet/v03]* also has a better 
performance especially in case 2. (case 2 means the path ends with a '/'). 

 

> 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, HDFS-14908.002.patch, 
> HDFS-14908.003.patch, HDFS-14908.004.patch, Test.java, TestV2.java, 
> TestV3.java
>
>
> 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