You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "ChiaPing Tsai (JIRA)" <ji...@apache.org> on 2016/10/17 04:44:58 UTC
[jira] [Created] (HBASE-16855) Avoid NPE in MetricsConnection’s construction
ChiaPing Tsai created HBASE-16855:
-------------------------------------
Summary: Avoid NPE in MetricsConnection’s construction
Key: HBASE-16855
URL: https://issues.apache.org/jira/browse/HBASE-16855
Project: HBase
Issue Type: Bug
Reporter: ChiaPing Tsai
Priority: Minor
a) The batch pool may not be assigned a value in the ConnectionImpl’s construction.
b) The meta pool always be null in the ConnectionImpl’s construction.
For reasons outlined above, the NPE may happen in MetricsConnection’s construction
{noformat}
final ThreadPoolExecutor batchPool = (ThreadPoolExecutor) conn.getCurrentBatchPool();
final ThreadPoolExecutor metaPool = (ThreadPoolExecutor) conn.getCurrentMetaLookupPool();
this.registry.register(name(this.getClass(), "executorPoolActiveThreads", scope),
new RatioGauge() {
@Override
protected Ratio getRatio() {
return Ratio.of(batchPool.getActiveCount(), batchPool.getMaximumPoolSize());
}
});
this.registry.register(name(this.getClass(), "metaPoolActiveThreads", scope),
new RatioGauge() {
@Override
protected Ratio getRatio() {
return Ratio.of(metaPool.getActiveCount(), metaPool.getMaximumPoolSize());
}
});
{noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)