jpisaac commented on a change in pull request #759:
URL: https://github.com/apache/phoenix/pull/759#discussion_r412313545
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/monitoring/PhoenixTableRegistry.java
##########
@@ -0,0 +1,87 @@
+package org.apache.phoenix.monitoring;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.hadoop.hbase.metrics.MetricRegistries;
+import org.apache.hadoop.hbase.metrics.MetricRegistry;
+import org.apache.hadoop.hbase.metrics.MetricRegistryInfo;
+import org.apache.phoenix.query.QueryServicesOptions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+
+/**
+ * Central place where we keep track of all the Table Level phoenix metrics.
+ * Registers as new MetricSource with Hbase Registry.
+ * Register each tableMetrics and store the instance of it associated with
TableName in a map
+ */
+
+public class PhoenixTableRegistry {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(PhoenixTableRegistry.class);
+ private static final boolean isTableLevelMetricsEnabled =
QueryServicesOptions.withDefaults().isTableLevelMetricsEnabled();
+
+ private static
ConcurrentMap<String,TableLevelMetricRegistry>tablePhoenixMapping;
+
+ static MetricRegistry metricRegistry;
+ static {
Review comment:
Need to rethink the use of singleton in the read/write path.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]