Berkof commented on a change in pull request #9392:
URL: https://github.com/apache/ignite/pull/9392#discussion_r745520408
##########
File path:
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/StatisticsUtils.java
##########
@@ -172,4 +174,61 @@ public static StatisticsTarget
statisticsTarget(StatisticsKeyMessage msg) {
String[] cols = (msg.colNames() == null) ? null :
msg.colNames().toArray(new String[0]);
return new StatisticsTarget(msg.schema(), msg.obj(), cols);
}
+
+ /**
+ * Test if specified statistics is fit to all required versions.
+ * It means that specified statistics contains all columns with at least
versions
+ * from specified map.
+ *
+ * @param stat Statistics to check. Can be {@code null}.
+ * @param versions Map of column name to required version.
+ * @return {@code true} if it is, {@code false} otherwise.
Review comment:
Fixed.
##########
File path:
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/IgniteGlobalStatisticsManager.java
##########
@@ -0,0 +1,1026 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.query.stat;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.cluster.ClusterState;
+import org.apache.ignite.events.DiscoveryEvent;
+import org.apache.ignite.internal.GridTopic;
+import org.apache.ignite.internal.events.DiscoveryCustomEvent;
+import org.apache.ignite.internal.managers.communication.GridIoManager;
+import org.apache.ignite.internal.managers.communication.GridIoPolicy;
+import org.apache.ignite.internal.managers.communication.GridMessageListener;
+import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
+import org.apache.ignite.internal.managers.discovery.GridDiscoveryManager;
+import org.apache.ignite.internal.managers.systemview.GridSystemViewManager;
+import
org.apache.ignite.internal.managers.systemview.walker.StatisticsColumnGlobalDataViewWalker;
+import
org.apache.ignite.internal.managers.systemview.walker.StatisticsColumnLocalDataViewWalker;
+import
org.apache.ignite.internal.managers.systemview.walker.StatisticsColumnPartitionDataViewWalker;
+import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+import org.apache.ignite.internal.processors.cache.DynamicCacheChangeBatch;
+import
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager;
+import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture;
+import
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.PartitionsExchangeAware;
+import org.apache.ignite.internal.processors.cluster.GridClusterStateProcessor;
+import
org.apache.ignite.internal.processors.query.stat.config.StatisticsColumnConfiguration;
+import
org.apache.ignite.internal.processors.query.stat.config.StatisticsObjectConfiguration;
+import
org.apache.ignite.internal.processors.query.stat.messages.StatisticsKeyMessage;
+import
org.apache.ignite.internal.processors.query.stat.messages.StatisticsObjectData;
+import
org.apache.ignite.internal.processors.query.stat.messages.StatisticsRequest;
+import
org.apache.ignite.internal.processors.query.stat.messages.StatisticsResponse;
+import
org.apache.ignite.internal.processors.query.stat.view.StatisticsColumnConfigurationView;
+import
org.apache.ignite.internal.processors.query.stat.view.StatisticsColumnGlobalDataView;
+import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.thread.IgniteThreadPoolExecutor;
+
+/**
+ * Global statistics manager. Cache global statistics and collect it.
+ */
+public class IgniteGlobalStatisticsManager implements GridMessageListener {
+ /** */
+ private static final String STAT_GLOBAL_VIEW_NAME = "statisticsGlobalData";
+
+ /** */
+ private static final String STAT_GLOBAL_VIEW_DESCRIPTION = "Global
statistics.";
+
+ /** Statistics manager. */
+ private final IgniteStatisticsManagerImpl statMgr;
+
+ /** Statistics gatherer. */
+ //private final StatisticsProcessor statProc;
Review comment:
Removed
##########
File path:
modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/stat/StatisticsConfigurationTest.java
##########
@@ -231,7 +231,9 @@ public void checkClientNode() throws Exception {
IgniteEx client = startClientGrid("cli");
- collectStatistics(SMALL_TARGET);
+ Thread.sleep(1000);
Review comment:
Not really, replaced with awaitPME. And I increase TIMEOUT to make the
tests mode stable.
--
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]