alex-plekhanov commented on a change in pull request #9376:
URL: https://github.com/apache/ignite/pull/9376#discussion_r706154230
##########
File path:
modules/indexing/src/test/java/org/apache/ignite/util/KillCommandsTests.java
##########
@@ -128,6 +154,68 @@ public static void doTestScanQueryCancel(IgniteEx cli,
List<IgniteEx> srvs, Cons
for (int i = 0; i < PAGE_SZ * PAGE_SZ - 1; i++)
assertNotNull(iter2.next());
+ checkScanQueryResources(cli, srvs, qryId);
+
+ qry2.close();
+ }
+
+ /**
+ * Checks cancel of the scan query during fetching.
+ *
+ * @param cli Client node.
+ * @param srvs Server nodes.
+ * @param qryCanceler Query cancel closure.
+ */
+ private static void checkScanQueryCancelDuringFetching(IgniteEx cli,
List<IgniteEx> srvs,
+ Consumer<T3<UUID, String, Long>> qryCanceler) throws Exception {
+ filterLatch = new CountDownLatch(1);
+ cancelLatch = new CountDownLatch(1);
+
+ IgniteCache<Object, Object> cache = cli.cache(DEFAULT_CACHE_NAME);
+
+ QueryCursor<Cache.Entry<Object, Object>> qry = cache.query(new
ScanQuery<>().setFilter((o, o2) -> {
+ try {
+ filterLatch.countDown();
+
+ cancelLatch.await(TIMEOUT, TimeUnit.MILLISECONDS);
+ }
+ catch (Exception ignored) {
+ // No-op.
+ }
+
+ return true;
+ }));
+
+ IgniteInternalFuture<?> fut = GridTestUtils.runAsync((Runnable)() ->
qry.iterator().next());
+
+ assertTrue(filterLatch.await(TIMEOUT, TimeUnit.MILLISECONDS));
+
+ List<List<?>> scanQries0 = execute(srvs.get(0),
+ "SELECT ORIGIN_NODE_ID, CACHE_NAME, QUERY_ID FROM
SYS.SCAN_QUERIES");
+
+ assertEquals(1, scanQries0.size());
+
+ UUID originNodeId = (UUID)scanQries0.get(0).get(0);
+ String cacheName = (String)scanQries0.get(0).get(1);
+ long qryId = (Long)scanQries0.get(0).get(2);
Review comment:
Deduplicate?
##########
File path:
modules/indexing/src/test/java/org/apache/ignite/util/KillCommandsTests.java
##########
@@ -82,14 +87,35 @@
/** Latch to block compute task execution. */
private static CountDownLatch computeLatch;
+ /** Scan query filter latch. */
+ private static CountDownLatch filterLatch;
Review comment:
volatile?
##########
File path:
modules/indexing/src/test/java/org/apache/ignite/util/KillCommandsTests.java
##########
@@ -82,14 +87,35 @@
/** Latch to block compute task execution. */
private static CountDownLatch computeLatch;
+ /** Scan query filter latch. */
+ private static CountDownLatch filterLatch;
+
+ /** Scan query cancel latch. */
+ private static CountDownLatch cancelLatch;
+
/**
* Test cancel of the scan query.
*
* @param cli Client node.
* @param srvs Server nodes.
* @param qryCanceler Query cancel closure.
*/
- public static void doTestScanQueryCancel(IgniteEx cli, List<IgniteEx>
srvs, Consumer<T3<UUID, String, Long>> qryCanceler) {
+ public static void doTestScanQueryCancel(IgniteEx cli, List<IgniteEx> srvs,
Review comment:
Arguments declaration should be all in one line, or each argument on a
separate line according to code style.
--
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]