[
https://issues.apache.org/jira/browse/HDFS-9396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14994475#comment-14994475
]
Kihwal Lee commented on HDFS-9396:
----------------------------------
{code:java}
long totalInodes() {
readLock();
try {
return rootDir.getDirectoryWithQuotaFeature().getSpaceConsumed()
.getNameSpace();
} finally {
readUnlock();
}
}
{code}
It can simply do without locking.
{code:java}
return inodeMap.size();
{code}
> Total files and directories on jmx and web UI on standby is uninitialized
> -------------------------------------------------------------------------
>
> Key: HDFS-9396
> URL: https://issues.apache.org/jira/browse/HDFS-9396
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: Kihwal Lee
> Priority: Blocker
>
> After HDFS-6763, the quota on the standby namenode is not being updated until
> it transitions to active. This causes the jmx and the web ui files and dir
> count to be uninitialized or unupdated. In some cases it shows a negative
> number.
> It is because the legacy way of getting the inode count, which existed since
> before the creation of inode table. It relies on the root inode's quota being
> properly updated. We can make it simply return the size of the inode table.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)