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


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java:
##########
@@ -118,6 +118,7 @@ public class AsyncConnectionImpl implements AsyncConnection 
{
 
   private final AtomicBoolean closed = new AtomicBoolean(false);
 
+  private final String clusterId;

Review Comment:
   Good suggestion, compose the metricsScope in the constructor is way better 
than making it every times when needed.



##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetricsConnection.java:
##########
@@ -331,30 +371,53 @@ public Counter newMetric(Class<?> clazz, String name, 
String scope) {
   protected final ConcurrentMap<String, Counter> rpcCounters =
     new ConcurrentHashMap<>(CAPACITY, LOAD_FACTOR, CONCURRENCY_LEVEL);
 
-  MetricsConnection(String scope, Supplier<ThreadPoolExecutor> batchPool,
+  private MetricsConnection(String scope, Supplier<ThreadPoolExecutor> 
batchPool,
     Supplier<ThreadPoolExecutor> metaPool) {
     this.scope = scope;
+    this.batchPools.add(batchPool);
+    this.metaPools.add(metaPool);

Review Comment:
   Good catch. Thanks!



##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetricsConnection.java:
##########
@@ -54,6 +58,37 @@
 @InterfaceAudience.Private
 public class MetricsConnection implements StatisticTrackable {
 
+  static final Map<String, MetricsConnection> METRICS_INSTANCES =
+    new HashMap<String, MetricsConnection>();
+
+  static MetricsConnection getMetricsConnection(final String scope,

Review Comment:
   Great catch, updated.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to