You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2022/11/30 19:02:29 UTC

[GitHub] [hbase] virajjasani commented on a diff in pull request #4874: HBASE-27466: Making metrics instance containing one or more connections.

virajjasani commented on code in PR #4874:
URL: https://github.com/apache/hbase/pull/4874#discussion_r1036343917


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetricsConnection.java:
##########
@@ -54,6 +58,38 @@
 @InterfaceAudience.Private
 public class MetricsConnection implements StatisticTrackable {
 
+  static final Map<String, MetricsConnection> METRICS_INSTANCES =
+    new HashMap<String, MetricsConnection>();
+
+  static MetricsConnection getMetricsConnection(final AsyncConnection conn,
+    Supplier<ThreadPoolExecutor> batchPool, Supplier<ThreadPoolExecutor> metaPool) {
+    String scope = getScope(conn);
+    MetricsConnection metrics;
+    synchronized (METRICS_INSTANCES) {

Review Comment:
   The scope here should be unique per async connection object, is that correct?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org