[
https://issues.apache.org/jira/browse/HDFS-9229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14973698#comment-14973698
]
Rakesh R commented on HDFS-9229:
--------------------------------
Thank you [~wheat9], [~jingzhao], [~zhz] for the useful discussions.
Thank you [~surendrasingh] for taking care this. I've few comments:
# Do we need to update size inside lock, how about moving it outside?
{code}
+ //Update NameDirSize Metric
+ namesystem.getFSImage().getStorage().updateNameDirSize();
{code}
# I could see name dir will be updated during FSImage#saveNamespace call
[FSImage.java#L1061|https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java#L1061],
probably we could cover this logic also, right?
# In tests, can we try avoids constant sleeping. One alternate approach I can
think is to call #rollEditLog() function explicitly. For example,
HATestUtil#waitForStandbyToCatchUp()
{code}
+ Thread.sleep(3*1000);
+ checkNNDirSize(cluster.getNameDirs(0), nn0.getNameDirSize());
+ checkNNDirSize(cluster.getNameDirs(1), nn1.getNameDirSize());
{code}
# There is one minor checkstyle warning, please fix it.
{code}
NNStorage.java:1090:23: 'nnDirSizeMap' hides a field.
{code}
> 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,
> HDFS-9229.003.patch, HDFS-9229.004.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)