xtern commented on code in PR #7038:
URL: https://github.com/apache/ignite-3/pull/7038#discussion_r2556735303


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/CursorPublicationPhaseHandler.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * 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.sql.engine.exec.fsm;
+
+import org.apache.ignite.internal.sql.engine.AsyncSqlCursor;
+import org.apache.ignite.internal.sql.engine.SqlQueryType;
+
+/** Handler that adds an additional delay to before publishing the cursor. */

Review Comment:
   ```suggestion
   /** Handler that adds an additional delay before publishing the cursor. */
   ```



##########
modules/sql-engine/src/testFixtures/java/org/apache/ignite/internal/sql/engine/util/SqlTestUtils.java:
##########
@@ -596,6 +597,23 @@ public static void 
waitUntilRunningQueriesCount(SqlQueryProcessor queryProcessor
         Awaitility.await().untilAsserted(() -> 
assertThat(queryProcessor.runningQueries().size(), matcher));
     }
 
+    /**
+     * Waits until the number of queries in given phase matches the specified 
matcher.
+     *
+     * @param queryProcessor The query processor to derive list of running 
queries.
+     * @param phase The {@link ExecutionPhase} of the interest.
+     * @param matcher THe matcher to check the number of running queries.
+     * @throws AssertionError If after waiting the number of running queries 
still does not match the specified matcher.
+     */
+    public static void waitUntilQueriesInPhaseCount(SqlQueryProcessor 
queryProcessor, ExecutionPhase phase, Matcher<Integer> matcher) {
+        Awaitility.await().untilAsserted(() -> assertThat(
+                (int) queryProcessor.runningQueries().stream()
+                        .filter(queryInfo -> queryInfo.phase() == phase)
+                        .count(),
+                matcher
+        ));

Review Comment:
   You probably know this, but it can be simplified.
   ```suggestion
           Awaitility.await().until(
                   () -> (int) queryProcessor.runningQueries().stream()
                           .filter(queryInfo -> queryInfo.phase() == phase)
                           .count(),
                   matcher
           );
   ```



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