[
https://issues.apache.org/jira/browse/HDFS-15133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17033184#comment-17033184
]
Ayush Saxena commented on HDFS-15133:
-------------------------------------
I had a quick try on this.
[~maobaolong] firstly you need to replace {{rootDir}} from {{FsDirectory}},
Since it is storing reference to all the child inodes and until there is anyone
holding reference to the inode, the inode will be in heap only. You can replace
it with storing root's Inode id, and create a method as {{getRootDir()}} which
fetches the root from the rootID from the DB.
Secondly, when you will be serializing the inode to store in DB it will loose
its traversal behavior, once you add root, then its child and so on, you can't
traverse to the last child by just fetching the root Inode. So, you need to
change the way present way of fetching the inodes. That shall be trickiest part
here IMO.
Thirdly once a inode is added to the DB, if you get the inode from the DB and
do any modifications, as adding blocks, changing replica states and other
stuffs, you need to again put it back in the DB and replace with the existing
one. For this you can create a method in {{FSDirectory}} to update the iNodes.
I tried that way only,
Whenever BlockReports or IBR are coming, and changing the block state, that
also you need to update in the inode, Fetch the inode id from the Block Info,
then get the corresponding Inode and update the new blockInfo there.
Off all I think writing file would be still doable stuff, For reading you need
to change the present read mechanism, due to lack of chaining through root, may
be something using the {{InodeId}}
> Use rocksdb to store NameNode inode and blockInfo
> -------------------------------------------------
>
> Key: HDFS-15133
> URL: https://issues.apache.org/jira/browse/HDFS-15133
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: namenode
> Affects Versions: 3.3.0
> Reporter: maobaolong
> Priority: Major
> Attachments: image-2020-01-28-12-30-33-015.png
>
>
> Maybe we don't need checkpoint to a fsimage file, the rocksdb checkpoint can
> achieve the same request.
> This is ozone and alluxio way to manage meta data of master node.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]