[
https://issues.apache.org/jira/browse/HBASE-25195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Reid Chan resolved HBASE-25195.
-------------------------------
Hadoop Flags: Reviewed
Resolution: Fixed
> [branch-1] getNumOpenConnections is not effective
> -------------------------------------------------
>
> Key: HBASE-25195
> URL: https://issues.apache.org/jira/browse/HBASE-25195
> Project: HBase
> Issue Type: Improvement
> Components: metrics
> Reporter: Reid Chan
> Assignee: Reid Chan
> Priority: Minor
> Fix For: 1.7.0
>
>
> In MetricsHBaseServerWrapperImpl
> {code}
> @Override
> public int getNumOpenConnections() {
> if (!isServerStarted() || this.server.connectionList == null) {
> return 0;
> }
> return server.connectionList.size();
> }
> {code}
> But connectionList is created by Collections.synchronizedList(new
> LinkedList<Connection>());
> So each connectionList.size() will compete for the mutex, we can easily
> replace it with another parameter *numConnections*, as for metrics, it is
> enough.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)