alex-plekhanov commented on a change in pull request #9767:
URL: https://github.com/apache/ignite/pull/9767#discussion_r801331686



##########
File path: 
modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/KillQueryOnClientDisconnectTest.java
##########
@@ -183,7 +183,8 @@ protected IgniteInternalFuture 
cancelAndCheckClientDisconnect() {
             try {
                 TestSQLFunctions.cancelLatch.await();
 
-                List<GridRunningQueryInfo> runningQueries = 
(List<GridRunningQueryInfo>)serverNode().context().query().runningQueries(-1);
+                List<GridRunningQueryInfo> runningQueries = 
(List<GridRunningQueryInfo>)serverNode().context().query()

Review comment:
       Redundant change

##########
File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/QueryRegistryImpl.java
##########
@@ -21,50 +21,85 @@
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
-
-import org.apache.ignite.IgniteLogger;
+import java.util.stream.Collectors;
+import org.apache.calcite.util.Pair;
+import org.apache.ignite.cache.query.QueryCancelledException;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.processors.cache.query.GridCacheQueryType;
+import org.apache.ignite.internal.processors.query.GridQueryCancel;
+import org.apache.ignite.internal.processors.query.GridRunningQueryManager;
 import org.apache.ignite.internal.processors.query.RunningQuery;
+import 
org.apache.ignite.internal.processors.query.calcite.exec.ddl.RunningQueryManagerWrapper;
+import 
org.apache.ignite.internal.processors.query.calcite.util.AbstractService;
 import org.apache.ignite.internal.util.IgniteUtils;
+import org.jetbrains.annotations.Nullable;
 
 /**
  * Registry of the running queries.
  */
-public class QueryRegistryImpl implements QueryRegistry {
+public class QueryRegistryImpl extends AbstractService implements 
QueryRegistry {
     /** */
-    private final ConcurrentMap<UUID, RunningQuery> runningQrys = new 
ConcurrentHashMap<>();
+    private final ConcurrentMap<UUID, Pair<Long, RunningQuery>> runningQrys = 
new ConcurrentHashMap<>();
 
     /** */
-    private final IgniteLogger log;
+    private final GridRunningQueryManager runningQryMgr;
 
     /** */
-    public QueryRegistryImpl(IgniteLogger log) {
-        this.log = log;
+    public QueryRegistryImpl(GridKernalContext ctx) {
+        super(ctx);
+
+        runningQryMgr = new RunningQueryManagerWrapper(ctx);
     }
 
     /** {@inheritDoc} */
-    @Override public RunningQuery register(RunningQuery qry) {
-        return runningQrys.computeIfAbsent(qry.id(), k -> qry);
+    @Override public RunningQuery register(String sql, String schema, 
RunningQuery qry) {
+        return runningQrys.computeIfAbsent(qry.id(), k -> {
+            String nodeId;
+            if (qry.initiatorNodeId() != null)
+                nodeId = qry.initiatorNodeId().toString();
+            else
+                nodeId = kctx.discovery().localNode().id().toString();

Review comment:
       Not changed

##########
File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/RootQuery.java
##########
@@ -64,6 +64,9 @@
     /** SQL query. */
     private final String sql;
 
+    /** Schema. */
+    private final SchemaPlus schema;

Review comment:
       Not used now




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


Reply via email to