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

Elliott Clark commented on HBASE-6411:
--------------------------------------

bq.There's no access to the registry from outside the BaseMetricsSourceImpl 
class, so I don't see how extracting changes things. In the MetricsRegistry 
impl that I added you can see that concurrent maps are used to hold metrics. 
Didn't think that tags will be created a lot, but rather in initialization 
methods once, so haven't changed to using concurrent map for it.

The only usage before was through a guaranteed singleton that was only used on 
a single thread at a time (The master rpc thread or the replication thread).  
Once there's the possibility that a registry can be shared other places we need 
to guard against concurrent access.  I would vote using concurrent hash maps.  
That's usually my preferred way beacuse it's faster if there is a lot of 
contention.

bq.I agree, I haven't added it. It is from hadoop's code, as Ted Yu mentioned. 
I.e. I have same thoughts about doing exactly this:
Awesome.  we're on the same page then.  Too bad it's already in shipped hadoop 
code.  Seems like a design flaw on their part.  Oh well.

bq. That is why I suggested we replace this class with the registry in the 
first place.
When I started part of my purpose was to do the clean up so that the 
interfaces, used by classes in hbase-server, are not in any way tied to 
metrics2.  I want to modularize things and make most of hbase's use of hadoop 
actually pluggable.
                
> Move Master Metrics to metrics 2
> --------------------------------
>
>                 Key: HBASE-6411
>                 URL: https://issues.apache.org/jira/browse/HBASE-6411
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: Elliott Clark
>            Assignee: Elliott Clark
>         Attachments: HBASE-6411-0.patch, HBASE-6411-1.patch, 
> HBASE-6411-2.patch, HBASE-6411_concept.patch
>
>
> Move Master Metrics to metrics 2

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to