[
https://issues.apache.org/jira/browse/HDFS-4103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13508421#comment-13508421
]
Suresh Srinivas commented on HDFS-4103:
---------------------------------------
Comments:
# INode.java
#* can you describe what probe object is in the comment for DUMMY
#* Add javadoc to #removeNode() to describe the Snapshot parameter. Please do
indicate that null Snapshot means there are no snapshots...
# INodeDirectory#removeNode - add javadoc for params. Also add a brief
description to the snapshot related code. Please do indicate the meaning of
null snapshot
# INodeDirectoryWithSnapshot.java
# #repliceDir() - it might be a good idea to add to the javadoc that replacing
is due to a directory undergoing addition, deletion or modification of a file.
Replcaing it with INodeDirectoryWithSnapshot will track this change for a
snapshot.
# "Replace a child that has the same name as newChild by newChild." instead of
"by newChild", saying "with newChild" could be better. Also you could add
{@code newChild}
# #getChild() please add javadoc about params. Also the snapshot may not be
null and you may have to still return the childern because INodeDirectory has
not changed to INodeDirectoryWithSnapshot due to no changes to the directory.
# getParent() + getParentInodesInPath can be merged
# getChildrenList() - add @param javadoc. Same comment as getChild() above.
Snapshot param need not be null.
# getModificationTime() - add @param javadoc. Same comment as getChild() above.
Snapshot param need not be null.
# FSImageFormat#addToParent - can this be made private. Just making snapshot
null assumption is not violated by another caller.
# There are bunch of places with empty line changes or empty lines added.
I have not reviewed the core part of the change SnapshotDiff. I will review
that part and post comments.
> Support O(1) snapshot creation
> ------------------------------
>
> Key: HDFS-4103
> URL: https://issues.apache.org/jira/browse/HDFS-4103
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: namenode
> Affects Versions: Snapshot (HDFS-2802)
> Reporter: Tsz Wo (Nicholas), SZE
> Assignee: Tsz Wo (Nicholas), SZE
> Attachments: h4103_20121129.patch, h4103_20121202.patch
>
>
> In our first snapshot implementation, snapshot creation runs in O(N) and
> occupies O(N) memory space, where N = # files + # directories + # symlinks in
> the snapshot. The advantages of the implementation are that there is no
> additional cost for the modifications after snapshots are created, and it
> leads to a simple implementation.
> In this JIRA, we optimize snapshot creation to O(1) although it introduces
> additional cost in the modifications after snapshots are created. Note that
> the INode is given as an assumption, otherwise, there is a non-constant cost
> to find the INode.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira