hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhe Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-7104) Fix and clarify INodeInPath getter functions
Date Tue, 23 Sep 2014 23:00:38 GMT

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

Zhe Zhang commented on HDFS-7104:
---------------------------------

[~jingzhao] Good point, we have to carefully distinguish _null inodes caused by snapshots_
and _null inodes caused by dirs not yet created_. 

bq. Since we do not usually call getINodes multiple times for the same INodesInPath instance,
I think we may consider starting from option 2.

Sounds good to me. I prefer to make {{getINodes()}} a real getter. It's not easy to find it
a descriptive name though. What it does is  _getting inodes for non-snapshot path components_.
How about {{getINodesWithoutSnapshots()}}. Any suggestions to make it less ugly?

> Fix and clarify INodeInPath getter functions
> --------------------------------------------
>
>                 Key: HDFS-7104
>                 URL: https://issues.apache.org/jira/browse/HDFS-7104
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Zhe Zhang
>            Assignee: Zhe Zhang
>            Priority: Minor
>         Attachments: HDFS-7104-20140923-v1.patch, HDFS-7104-20140923-v2.patch
>
>
> inodes is initialized with the number of patch components. After resolve, it contains
both non-null and null elements (introduced by dot-snapshot dirs).
> When getINodes is called, an array is returned excluding all non elements, which is the
correct behavior. Meanwhile, the inodes array is trimmed too, which shouldn't be done by a
getter.
> Because of the above, the behavior of getINodesInPath depends on whether getINodes has
been called, which is not correct.
> The name of getLastINodeInPath is confusing – it actually returns the last non-null
inode in the path. Also, shouldn't the return type be a single INode?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message