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

Andrew Wang commented on HDFS-8196:
-----------------------------------

Thanks for the rev [~lewuathe], did another pass, one nit and one more major 
thing I missed before (apologies):

Nit:

{code}
  <tr><th>Total EC Striped Block Groups  Size 
(bytes)</th><td>{StripedBlocksTotalSize}</td></tr>
{code}

I think this should read:

{code}
  <tr><th>Total EC Striped Block Groups 
Size</th><td>{StripedBlocksTotalSize|fmt_bytes}</td></tr>
{code}

Major:

{code}
4032      public long getTotalStripedBlocks() {
4033        return StreamSupport.stream(blocksMap.getBlocks().spliterator(), 
false)
4034                .filter(BlockInfo::isStriped)
4035                .count();
4036      }
4037    
4038      public long getTotalStripedBlockSize() {
4039        return StreamSupport.stream(blocksMap.getBlocks().spliterator(), 
false)
4040                .filter(BlockInfo::isStriped)
4041                .mapToLong(BlockInfo::getNumBytes)
4042                .sum();
4043      }
{code}

Looks like these new methods iterate the entire block map to calculate the 
totals, which is inefficient. It also looks not thread safe.

Instead, what do you think about maintaining these counts in {{BlocksMap}}?

Another small nit, maybe we rename {{getTotalStripedBlocks}} to 
{{getTotalStripedBlockGroups}} for clarity?

> Erasure Coding related information on NameNode UI
> -------------------------------------------------
>
>                 Key: HDFS-8196
>                 URL: https://issues.apache.org/jira/browse/HDFS-8196
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: namenode
>    Affects Versions: HDFS-7285
>            Reporter: Kai Sasaki
>            Assignee: Kai Sasaki
>              Labels: NameNode, WebUI, hdfs-ec-3.0-nice-to-have
>         Attachments: HDFS-8196.01.patch, HDFS-8196.02.patch, 
> HDFS-8196.03.patch, Screen Shot 2017-02-06 at 22.30.40.png, Screen Shot 
> 2017-02-12 at 20.21.42.png, Screen Shot 2017-02-14 at 22.43.57.png
>
>
> NameNode WebUI shows EC related information and metrics. 
> This is depend on [HDFS-7674|https://issues.apache.org/jira/browse/HDFS-7674].



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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

Reply via email to