You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/08/10 19:24:27 UTC

[GitHub] [ignite] Berkof opened a new pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Berkof opened a new pull request #9314:
URL: https://github.com/apache/ignite/pull/9314


   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] Berkof commented on a change in pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
Berkof commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r699259322



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/StatisticsGatherer.java
##########
@@ -272,11 +272,18 @@ public void stop() {
         if (log.isTraceEnabled())
             log.trace(String.format("Statistics gathering stopping %d task...", gatheringInProgress.size()));
 
-        gatheringInProgress.values().forEach(ctx -> ctx.futureGather().cancel(true));
-
-        gatheringInProgress.clear();
+        cancelAllTasks();
 
         if (log.isDebugEnabled())
             log.debug("Statistics gathering stopped.");
     }
+
+    /**
+     * Cancel all currently running statistics gathering tasks.
+     */
+    public void cancelAllTasks() {
+        gatheringInProgress.values().forEach(ctx -> ctx.futureGather().cancel(true));
+
+        gatheringInProgress.clear();
+    }

Review comment:
       It won't totally fix the possibility of failure cause we can change state during processObsolescence execution. But I move state check directly into it to improve readability and lower this chance a bit.
   




-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] Berkof commented on a change in pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
Berkof commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r699259322



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/StatisticsGatherer.java
##########
@@ -272,11 +272,18 @@ public void stop() {
         if (log.isTraceEnabled())
             log.trace(String.format("Statistics gathering stopping %d task...", gatheringInProgress.size()));
 
-        gatheringInProgress.values().forEach(ctx -> ctx.futureGather().cancel(true));
-
-        gatheringInProgress.clear();
+        cancelAllTasks();
 
         if (log.isDebugEnabled())
             log.debug("Statistics gathering stopped.");
     }
+
+    /**
+     * Cancel all currently running statistics gathering tasks.
+     */
+    public void cancelAllTasks() {
+        gatheringInProgress.values().forEach(ctx -> ctx.futureGather().cancel(true));
+
+        gatheringInProgress.clear();
+    }

Review comment:
       It won't totally fix the possibility of failure cause we can change state during processObsolescence execution. But I move state check directly into it to improve readability and lower this chance a bit.
   




-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] AMashenkov commented on a change in pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
AMashenkov commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r704170005



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/IgniteStatisticsRepository.java
##########
@@ -93,127 +91,19 @@ public IgniteStatisticsRepository(
     ) {
         this.store = store;
         this.helper = helper;
-        this.log = logSupplier.apply(IgniteStatisticsRepository.class);
+        log = logSupplier.apply(IgniteStatisticsRepository.class);
 
+        ColumnPartitionDataViewSupplier colPartDataViewSupplier = new ColumnPartitionDataViewSupplier(store);

Review comment:
       ```suggestion
           ColumnPartitionDataViewSupplier colPartDataViewSupplier = new ColumnPartitionDataViewSupplier(store);
           
   ```




-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] AMashenkov commented on a change in pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
AMashenkov commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r704175825



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/StatisticsGatherer.java
##########
@@ -89,7 +102,25 @@ public LocalStatisticsGatheringContext aggregateStatisticsAsync(
         LocalStatisticsGatheringContext inProgressCtx = gatheringInProgress.putIfAbsent(key, ctx);
 
         if (inProgressCtx == null) {
-            CompletableFuture<ObjectStatisticsImpl> f = CompletableFuture.supplyAsync(aggregate, gatherPool);
+            CompletableFuture<ObjectStatisticsImpl> f = CompletableFuture.supplyAsync(
+                () -> {
+                    if (!gatheringLock.enterBusy() || !active) {
+                        if (log.isDebugEnabled())
+                            log.debug("Can't aggregate statistics by key " + key + " due to inactive state.");
+                        gatheringInProgress.remove(key, ctx);

Review comment:
       'active' flag should be changed under busy lock.
   If you failed to obtain lock, then someone who holds it must cancel gathering.
   
   Otherwise,  without holding the lock you will remove key under race, don't you?




-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] Berkof commented on pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
Berkof commented on pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#issuecomment-938384168


   Replaced with https://github.com/apache/ignite/pull/9423


-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] AMashenkov commented on a change in pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
AMashenkov commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r704165149



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/IgniteStatisticsConfigurationManager.java
##########
@@ -241,50 +241,11 @@ public IgniteStatisticsConfigurationManager(
 
         this.subscriptionProcessor.registerDistributedMetastorageListener(distrMetaStoreLsnr);
 
+        ColumnConfigurationViewSupplier colCfgViewSupplier = new ColumnConfigurationViewSupplier(this,
+            logSupplier);

Review comment:
       ```suggestion
           ColumnConfigurationViewSupplier colCfgViewSupplier = new ColumnConfigurationViewSupplier(this,             logSupplier);
   ```




-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] AMashenkov commented on a change in pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
AMashenkov commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r704183592



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/StatisticsGatherer.java
##########
@@ -152,14 +203,25 @@ public LocalStatisticsGatheringContext gatherLocalObjectsStatisticsAsync(
             if (log.isDebugEnabled())
                 log.debug("Cancel previous statistic gathering for [key=" + key + ']');
 
-            oldCtx.futureGather().cancel(false);
+            oldCtx.cancel();
+        }
+
+        if (!active) {
+            newCtx.cancel();
+            gatheringInProgress.remove(key);

Review comment:
       Do you read 'active' flag and remove key under busylock?




-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] AMashenkov commented on a change in pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
AMashenkov commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r704169337



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/IgniteStatisticsRepository.java
##########
@@ -93,127 +91,19 @@ public IgniteStatisticsRepository(
     ) {
         this.store = store;
         this.helper = helper;
-        this.log = logSupplier.apply(IgniteStatisticsRepository.class);
+        log = logSupplier.apply(IgniteStatisticsRepository.class);
 
+        ColumnPartitionDataViewSupplier colPartDataViewSupplier = new ColumnPartitionDataViewSupplier(store);
         sysViewMgr.registerFiltrableView(STAT_PART_DATA_VIEW, STAT_PART_DATA_VIEW_DESC,
-            new StatisticsColumnPartitionDataViewWalker(), this::columnPartitionStatisticsViewSupplier,
+            new StatisticsColumnPartitionDataViewWalker(), colPartDataViewSupplier::columnPartitionStatisticsViewSupplier,

Review comment:
       ```suggestion
               new StatisticsColumnPartitionDataViewWalker(), 
               colPartDataViewSupplier::columnPartitionStatisticsViewSupplier,
   ```

##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/IgniteStatisticsRepository.java
##########
@@ -93,127 +91,19 @@ public IgniteStatisticsRepository(
     ) {
         this.store = store;
         this.helper = helper;
-        this.log = logSupplier.apply(IgniteStatisticsRepository.class);
+        log = logSupplier.apply(IgniteStatisticsRepository.class);
 
+        ColumnPartitionDataViewSupplier colPartDataViewSupplier = new ColumnPartitionDataViewSupplier(store);
         sysViewMgr.registerFiltrableView(STAT_PART_DATA_VIEW, STAT_PART_DATA_VIEW_DESC,
-            new StatisticsColumnPartitionDataViewWalker(), this::columnPartitionStatisticsViewSupplier,
+            new StatisticsColumnPartitionDataViewWalker(), colPartDataViewSupplier::columnPartitionStatisticsViewSupplier,
             Function.identity());
 
+        ColumnLocalDataViewSupplier colLocDataViewSupplier = new ColumnLocalDataViewSupplier(this);
         sysViewMgr.registerFiltrableView(STAT_LOCAL_DATA_VIEW, STAT_LOCAL_DATA_VIEW_DESC,
-            new StatisticsColumnLocalDataViewWalker(), this::columnLocalStatisticsViewSupplier,
+            new StatisticsColumnLocalDataViewWalker(), colLocDataViewSupplier::columnLocalStatisticsViewSupplier,

Review comment:
       ```suggestion
               new StatisticsColumnLocalDataViewWalker(), 
               colLocDataViewSupplier::columnLocalStatisticsViewSupplier,
   ```




-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] AMashenkov commented on a change in pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
AMashenkov commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r687634379



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/StatisticsGatherer.java
##########
@@ -272,11 +272,18 @@ public void stop() {
         if (log.isTraceEnabled())
             log.trace(String.format("Statistics gathering stopping %d task...", gatheringInProgress.size()));
 
-        gatheringInProgress.values().forEach(ctx -> ctx.futureGather().cancel(true));
-
-        gatheringInProgress.clear();
+        cancelAllTasks();
 
         if (log.isDebugEnabled())
             log.debug("Statistics gathering stopped.");
     }
+
+    /**
+     * Cancel all currently running statistics gathering tasks.
+     */
+    public void cancelAllTasks() {
+        gatheringInProgress.values().forEach(ctx -> ctx.futureGather().cancel(true));
+
+        gatheringInProgress.clear();
+    }

Review comment:
       This can be is called from StatisticsManager.disableOperations() as a reaction on configuration changes.
   And StatisticsManager.processObsolescence() that is called from scheduler can put  into gatheringInProgress in parallel.
   Seems, both StatisticsManager methods are marked synchronized, but actually don't check the state under lock.




-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] AMashenkov commented on a change in pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
AMashenkov commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r704176920



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/StatisticsGatherer.java
##########
@@ -89,7 +102,25 @@ public LocalStatisticsGatheringContext aggregateStatisticsAsync(
         LocalStatisticsGatheringContext inProgressCtx = gatheringInProgress.putIfAbsent(key, ctx);
 
         if (inProgressCtx == null) {
-            CompletableFuture<ObjectStatisticsImpl> f = CompletableFuture.supplyAsync(aggregate, gatherPool);
+            CompletableFuture<ObjectStatisticsImpl> f = CompletableFuture.supplyAsync(
+                () -> {
+                    if (!gatheringLock.enterBusy() || !active) {
+                        if (log.isDebugEnabled())
+                            log.debug("Can't aggregate statistics by key " + key + " due to inactive state.");
+                        gatheringInProgress.remove(key, ctx);

Review comment:
       Once, obtaing the lock you will never release it if active==false.




-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] Berkof commented on a change in pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
Berkof commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r705328957



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/StatisticsGatherer.java
##########
@@ -89,7 +102,25 @@ public LocalStatisticsGatheringContext aggregateStatisticsAsync(
         LocalStatisticsGatheringContext inProgressCtx = gatheringInProgress.putIfAbsent(key, ctx);
 
         if (inProgressCtx == null) {
-            CompletableFuture<ObjectStatisticsImpl> f = CompletableFuture.supplyAsync(aggregate, gatherPool);
+            CompletableFuture<ObjectStatisticsImpl> f = CompletableFuture.supplyAsync(
+                () -> {
+                    if (!gatheringLock.enterBusy() || !active) {
+                        if (log.isDebugEnabled())
+                            log.debug("Can't aggregate statistics by key " + key + " due to inactive state.");
+                        gatheringInProgress.remove(key, ctx);

Review comment:
       We discussed it: I remove with the expected value, it's safe.
   
   Right, fixed.




-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] Berkof closed pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
Berkof closed pull request #9314:
URL: https://github.com/apache/ignite/pull/9314


   


-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] Berkof commented on a change in pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
Berkof commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r711891429



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/StatisticsGatherer.java
##########
@@ -152,14 +203,25 @@ public LocalStatisticsGatheringContext gatherLocalObjectsStatisticsAsync(
             if (log.isDebugEnabled())
                 log.debug("Cancel previous statistic gathering for [key=" + key + ']');
 
-            oldCtx.futureGather().cancel(false);
+            oldCtx.cancel();
+        }
+
+        if (!active) {
+            newCtx.cancel();
+            gatheringInProgress.remove(key);

Review comment:
       Not here, it's just a fast way to skip scheduling if active=false.




-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] Berkof commented on a change in pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
Berkof commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r705328957



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/StatisticsGatherer.java
##########
@@ -89,7 +102,25 @@ public LocalStatisticsGatheringContext aggregateStatisticsAsync(
         LocalStatisticsGatheringContext inProgressCtx = gatheringInProgress.putIfAbsent(key, ctx);
 
         if (inProgressCtx == null) {
-            CompletableFuture<ObjectStatisticsImpl> f = CompletableFuture.supplyAsync(aggregate, gatherPool);
+            CompletableFuture<ObjectStatisticsImpl> f = CompletableFuture.supplyAsync(
+                () -> {
+                    if (!gatheringLock.enterBusy() || !active) {
+                        if (log.isDebugEnabled())
+                            log.debug("Can't aggregate statistics by key " + key + " due to inactive state.");
+                        gatheringInProgress.remove(key, ctx);

Review comment:
       Right, fixed.




-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] AMashenkov commented on a change in pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
AMashenkov commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r704164450



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/IgniteStatisticsConfigurationManager.java
##########
@@ -241,50 +241,11 @@ public IgniteStatisticsConfigurationManager(
 
         this.subscriptionProcessor.registerDistributedMetastorageListener(distrMetaStoreLsnr);
 
+        ColumnConfigurationViewSupplier colCfgViewSupplier = new ColumnConfigurationViewSupplier(this,
+            logSupplier);
         sysViewMgr.registerFiltrableView(STAT_CFG_VIEW_NAME, STAT_CFG_VIEW_DESCRIPTION,
-            new StatisticsColumnConfigurationViewWalker(), this::columnConfigurationViewSupplier, Function.identity());
-    }
-
-    /**
-     * Statistics column configuration view filterable supplier.
-     *
-     * @param filter Filter.
-     * @return Iterable with selected statistics column configuration views.
-     */
-    private Iterable<StatisticsColumnConfigurationView> columnConfigurationViewSupplier(Map<String, Object> filter) {
-        String schema = (String)filter.get(StatisticsColumnConfigurationViewWalker.SCHEMA_FILTER);
-        String name = (String)filter.get(StatisticsColumnConfigurationViewWalker.NAME_FILTER);
-
-        Collection<StatisticsObjectConfiguration> configs;
-        try {
-            if (!F.isEmpty(schema) && !F.isEmpty(name)) {
-                StatisticsKey key = new StatisticsKey(schema, name);
-                StatisticsObjectConfiguration keyCfg = config(key);
-
-                if (keyCfg == null)
-                    return Collections.emptyList();
-
-                configs = Collections.singletonList(keyCfg);
-            }
-            else
-                configs = getAllConfig();
-        }
-        catch (IgniteCheckedException e) {
-            log.warning("Error while getting statistics configuration: " + e.getMessage(), e);
-
-            configs = Collections.emptyList();
-        }
-
-        List<StatisticsColumnConfigurationView> res = new ArrayList<>();
-
-        for (StatisticsObjectConfiguration cfg : configs) {
-            for (StatisticsColumnConfiguration colCfg : cfg.columnsAll().values()) {
-                if (!colCfg.tombstone())
-                    res.add(new StatisticsColumnConfigurationView(cfg, colCfg));
-            }
-        }
-
-        return res;
+            new StatisticsColumnConfigurationViewWalker(), colCfgViewSupplier::columnConfigurationViewSupplier,
+            Function.identity());

Review comment:
       ```suggestion
               new StatisticsColumnConfigurationViewWalker(), 
               colCfgViewSupplier::columnConfigurationViewSupplier,
               Function.identity());
   ```




-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] Berkof commented on a change in pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
Berkof commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r699259322



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/StatisticsGatherer.java
##########
@@ -272,11 +272,18 @@ public void stop() {
         if (log.isTraceEnabled())
             log.trace(String.format("Statistics gathering stopping %d task...", gatheringInProgress.size()));
 
-        gatheringInProgress.values().forEach(ctx -> ctx.futureGather().cancel(true));
-
-        gatheringInProgress.clear();
+        cancelAllTasks();
 
         if (log.isDebugEnabled())
             log.debug("Statistics gathering stopped.");
     }
+
+    /**
+     * Cancel all currently running statistics gathering tasks.
+     */
+    public void cancelAllTasks() {
+        gatheringInProgress.values().forEach(ctx -> ctx.futureGather().cancel(true));
+
+        gatheringInProgress.clear();
+    }

Review comment:
       It won't totally fix the possibility of failure cause we can change state during processObsolescence execution. But I move state check directly into it to improve readability and lower this chance a bit.
   




-- 
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: notifications-unsubscribe@ignite.apache.org

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



[GitHub] [ignite] AMashenkov commented on a change in pull request #9314: IGNITE-15281 add cluster state check into statistics manager.

Posted by GitBox <gi...@apache.org>.
AMashenkov commented on a change in pull request #9314:
URL: https://github.com/apache/ignite/pull/9314#discussion_r704169843



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/IgniteStatisticsRepository.java
##########
@@ -93,127 +91,19 @@ public IgniteStatisticsRepository(
     ) {
         this.store = store;
         this.helper = helper;
-        this.log = logSupplier.apply(IgniteStatisticsRepository.class);
+        log = logSupplier.apply(IgniteStatisticsRepository.class);
 
+        ColumnPartitionDataViewSupplier colPartDataViewSupplier = new ColumnPartitionDataViewSupplier(store);
         sysViewMgr.registerFiltrableView(STAT_PART_DATA_VIEW, STAT_PART_DATA_VIEW_DESC,
-            new StatisticsColumnPartitionDataViewWalker(), this::columnPartitionStatisticsViewSupplier,
+            new StatisticsColumnPartitionDataViewWalker(), colPartDataViewSupplier::columnPartitionStatisticsViewSupplier,
             Function.identity());
 
+        ColumnLocalDataViewSupplier colLocDataViewSupplier = new ColumnLocalDataViewSupplier(this);

Review comment:
       ```suggestion
           ColumnLocalDataViewSupplier colLocDataViewSupplier = new ColumnLocalDataViewSupplier(this);
           
   ```




-- 
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: notifications-unsubscribe@ignite.apache.org

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