ignite-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [ignite] dgarus commented on a change in pull request #6927: IGNITE-12212: Cluster nodes system view.
Date Wed, 09 Oct 2019 08:31:17 GMT
dgarus commented on a change in pull request #6927: IGNITE-12212: Cluster nodes system view.
URL: https://github.com/apache/ignite/pull/6927#discussion_r332861822
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/ignite/internal/managers/systemview/GridSystemViewManager.java
 ##########
 @@ -122,6 +126,34 @@ public GridSystemViewManager(GridKernalContext ctx) {
         notifyListeners(sysView, viewCreationLsnrs, log);
     }
 
+    /**
+     * Registers view which exports {@link Collection} content provided by specified {@code
Supplier}.
+     *
+     * @param name Name.
+     * @param desc Description.
+     * @param rowCls Row class.
+     * @param dataSupplier Data supplier.
+     * @param rowFunc value to row function.
+     * @param <R> View row type.
+     * @param <D> Collection data type.
+     */
+    public <R, D> void registerView(String name, String desc, Class<R> rowCls,
Supplier<Collection<D>> dataSupplier,
+        Function<D, R> rowFunc) {
+
+        SystemView sysView = new SystemViewAdapter<>(name,
+            desc,
+            rowCls,
+            (SystemViewRowAttributeWalker<R>)walkers.get(rowCls),
+            dataSupplier,
+            rowFunc);
+
+        SystemView<?> old = systemViews.putIfAbsent(name, sysView);
+
+        assert old == null;
+
+        notifyListeners(sysView, viewCreationLsnrs, log);
 
 Review comment:
   code duplication

----------------------------------------------------------------
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