You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Reid Chan (Jira)" <ji...@apache.org> on 2020/10/18 09:46:00 UTC
[jira] [Updated] (HBASE-25195) [branch-1] getNumOpenConnections is
not effective
[ https://issues.apache.org/jira/browse/HBASE-25195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Reid Chan updated HBASE-25195:
------------------------------
Environment: (was: 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.)
> [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)