ignite-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [ignite] nizhikov commented on a change in pull request #6845: IGNITE-12145: Monitoring list engine.
Date Thu, 12 Sep 2019 10:57:18 GMT
nizhikov commented on a change in pull request #6845: IGNITE-12145: Monitoring list engine.
URL: https://github.com/apache/ignite/pull/6845#discussion_r323678265
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/ignite/internal/processors/metric/GridMetricManager.java
 ##########
 @@ -177,9 +222,63 @@
     /** Registered metrics registries. */
     private final ConcurrentHashMap<String, MetricRegistry> registries = new ConcurrentHashMap<>();
 
+    /** Metrics registry. */
+    private final ReadOnlyMetricRegistry metricsRegistry = new ReadOnlyMetricRegistry() {
+        /** {@inheritDoc} */
+        @NotNull @Override public Iterator<MetricRegistry> iterator() {
+            return registries.values().iterator();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void addMetricRegistryCreationListener(Consumer<MetricRegistry>
lsnr) {
+            metricRegCreationLsnrs.add(lsnr);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void addMetricRegistryRemoveListener(Consumer<MetricRegistry>
lsnr) {
+            metricRegRemoveLsnrs.add(lsnr);
+        }
+    };
+
+    /** Registered lists. */
+    private final ConcurrentHashMap<String, MonitoringList<?>> lists = new ConcurrentHashMap<>();
+
+    /** Lists registry. */
+    private final ReadOnlyMonitoringListRegistry listRegistry = new ReadOnlyMonitoringListRegistry()
{
+        /** {@inheritDoc} */
+        @Override public void addListCreationListener(Consumer<MonitoringList<?>>
lsnr) {
+            listCreationLsnrs.add(lsnr);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void addListRemoveListener(Consumer<MonitoringList<?>>
lsnr) {
+            listRemoveLsnrs.add(lsnr);
+        }
+
+        /** {@inheritDoc} */
+        @NotNull @Override public Iterator<MonitoringList<?>> iterator() {
+            return lists.values().iterator();
+        }
+    };
+
     /** Metric registry creation listeners. */
     private final List<Consumer<MetricRegistry>> metricRegCreationLsnrs = new
CopyOnWriteArrayList<>();
 
+    /** Metric registry remove listeners. */
+    private final List<Consumer<MetricRegistry>> metricRegRemoveLsnrs = new CopyOnWriteArrayList<>();
+
+    /** List creation listeners. */
+    private final List<Consumer<MonitoringList<?>>> listCreationLsnrs =
new CopyOnWriteArrayList<>();
+
+    /** List remove listeners. */
+    private final List<Consumer<MonitoringList<?>>> listRemoveLsnrs = new
CopyOnWriteArrayList<>();
+
+    /** Internal list remove listeners. */
+    private final ConcurrentMap<String, Consumer<MonitoringList<?>>> internalRemoveLsnrs
= new ConcurrentHashMap<>();
+
+    /** List enable listeners. */
+    private final ConcurrentMap<String, Consumer<String>> listEnableLsnrs = new
ConcurrentHashMap<>();
 
 Review comment:
   Renamed to `task`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message