[ 
https://issues.apache.org/jira/browse/HDFS-12573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16189142#comment-16189142
 ] 

Manoj Govindassamy commented on HDFS-12573:
-------------------------------------------

Thanks for working on this [~tasanuma0829]. Looks good overall. +1 with few 
comments below.

1. BlocksMap.java
{noformat}
  void removeBlock(Block block) {
    BlockInfo blockInfo = blocks.remove(block);
    decrementBlockStat(block);
    if (blockInfo == null)
      return;
{noformat}
To be accurate, {{decrementBlockStat()}} need to be done after {{blockinfo == 
null}} check.

2.
bq.  private void decrementBlockStat(Block block) {
We can have an assert to verify the count never goes below zero. I am ok even 
if you don't do this for performance or other sanity reasons.

2. FSNameSystem.java
bq.  @Metric({"TotalReplicatedBlocks", "Number of total replicated blocks"})
bq.  @Metric({"TotalECBlockGroups", "Number of total erasure coded blocks"})
The comment can be "Total number of replicated blocks" and "Total number of 
erasure coded block groups"

3. TestNameNodeMXBean.java
bq. verifyTotalBlocksMetrics(2L, namesystem.getTotalBlocks());
bq.   void verifyTotalBlocksMetrics(long expectedBlocks, long actualBlocks)
There is also value in sending the expectedTotalReplicatedBlocks (1L) and 
expectedTotalECBlockGroups (1L) number instead of the total expected blocks 2L. 
In the verification method we can add up the individual expected blocks to get 
the total expected blocks. This way we can make sure we are not assuming the 
count from other block types. The test already has deletion of files and 
re-verification of block counts which is very good. It would be even more 
better, if we can add the expected block counts individually.  

> Divide the total block metrics into replica and ec
> --------------------------------------------------
>
>                 Key: HDFS-12573
>                 URL: https://issues.apache.org/jira/browse/HDFS-12573
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: erasure-coding, metrics, namenode
>            Reporter: Takanobu Asanuma
>            Assignee: Takanobu Asanuma
>         Attachments: HDFS-12573.1.patch, HDFS-12573.2.patch
>
>
> Following HDFS-10999, let's separate total blocks metrics. It would be useful 
> for administrators.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to