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

Guanghao Zhang commented on HBASE-21136:
----------------------------------------

Use computeIfAbsent directly and don't need tableSources.get(table)?
{code:java}
    return tableSources.computeIfAbsent(table, k -> {
      MetricsTableSource newSource = CompatibilitySingletonFactory
      .getInstance(MetricsRegionServerSourceFactory.class).createTable(table, 
wrapper);
      // register the new metrics now
      newSource.registerMetrics();
      return newSource;
    });
{code}


> NPE in MetricsTableSourceImpl.updateFlushTime
> ---------------------------------------------
>
>                 Key: HBASE-21136
>                 URL: https://issues.apache.org/jira/browse/HBASE-21136
>             Project: HBase
>          Issue Type: Bug
>          Components: metrics
>            Reporter: Guanghao Zhang
>            Assignee: Duo Zhang
>            Priority: Major
>             Fix For: 3.0.0, 1.5.0, 2.2.0
>
>         Attachments: HBASE-21136-v1.patch, HBASE-21136.patch
>
>
> See https://builds.apache.org/job/PreCommit-HBASE-Build/14260/testReport/



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to