[ https://issues.apache.org/jira/browse/HDFS-9229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14965963#comment-14965963 ]
Zhe Zhang commented on HDFS-9229: --------------------------------- Thanks for the work Surendra! A few quick comments: {code} + public String getNNDirectorySize() { + Map<String, Long> storageTypeMap = new HashMap<String, Long>(); {code} With Java 7 we don't need to specify type here. {code} + public long getDirecorySize() { + if (!isShared && root != null) { + return org.apache.commons.io.FileUtils.sizeOfDirectory(root); {code} Maybe we should import {{org.apache.commons.io.FileUtils}}? Another suggestion is to enhance the unit test to actually verify the size matches, instead of just verifying it's positive. > Expose size of NameNode directory as a metric > --------------------------------------------- > > Key: HDFS-9229 > URL: https://issues.apache.org/jira/browse/HDFS-9229 > Project: Hadoop HDFS > Issue Type: Improvement > Components: namenode > Affects Versions: 2.7.1 > Reporter: Zhe Zhang > Assignee: Surendra Singh Lilhore > Priority: Minor > Attachments: HDFS-9229.001.patch, HDFS-9229.002.patch > > > Useful for admins in reserving / managing NN local file system space. Also > useful when transferring NN backups. -- This message was sent by Atlassian JIRA (v6.3.4#6332)