You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Wei-Chiu Chuang (Jira)" <ji...@apache.org> on 2021/09/22 06:03:00 UTC

[jira] [Created] (HDFS-16233) Do not use exception handler to implement copy-on-write for EnumCounters

Wei-Chiu Chuang created HDFS-16233:
--------------------------------------

             Summary: Do not use exception handler to implement copy-on-write for EnumCounters
                 Key: HDFS-16233
                 URL: https://issues.apache.org/jira/browse/HDFS-16233
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: namenode
            Reporter: Wei-Chiu Chuang
         Attachments: Screen Shot 2021-09-22 at 1.59.59 PM.png

HDFS-14547 saves the NameNode heap space occupied by EnumCounters by essentially implementing a copy-on-write strategy.

At beginning, all EnumCounters refers to the same ConstEnumCounters to save heap space. When it is modified, an exception is thrown and the exception handler converts ConstEnumCounters to EnumCounters object and updates it.

Using exception handler to perform anything more than occasional is bad for performance. 

Propose: use instanceof keyword to detect the type of object and do COW accordingly.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org