You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2021/10/05 04:55:14 UTC

[GitHub] [hadoop] jianghuazhu commented on a change in pull request #3512: HDFS-16245.Record the number of INodeDirectory when loading the FSImage file.

jianghuazhu commented on a change in pull request #3512:
URL: https://github.com/apache/hadoop/pull/3512#discussion_r721887148



##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormatPBINode.java
##########
@@ -279,6 +283,9 @@ void loadINodeDirectorySection(InputStream in) throws IOException {
         INodeDirectory p = dir.getInode(e.getParent()).asDirectory();
         for (long id : e.getChildrenList()) {
           INode child = dir.getInode(id);
+          if (child.isDirectory()) {

Review comment:
       Thanks @sodonnel for the comment and review.
   When loading FsImage, we have recorded the number of all inodes (including INodeFile and INodeDirectory) in the log.
   For example, here is the specific record information:
   `2021-09-30 19:12:55,034 [15609]-INFO [main:FSImageFormatPBINode$Loader@409]-Loading xxxx INodes.`
   Yes, this is good. We can know the data of the loaded inode, but this is a sum. But we can't know how many INodeFiles or how many INodeDirectory are loaded, if we can know how many INodeFiles are loaded, similarly, we can know how many INodeDirectory is loaded. This will help us find the cause of the problem when there is an exception.
   Regarding the reason for dealing with INodeDirectory here. What I want to show is that in many cases, the number of files created will be more than the number of directories created. Therefore, it may use less time when calculating INodeDirectory.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org