Source:
public void testLocalScanQuery() throws Exception { try(IgniteEx g0 = startGrid(0)) { IgniteCache<Integer, Integer> cache1 = g0.createCache( new CacheConfiguration<Integer, Integer>("cache1") .setGroupName("group1")); for (int i = 0; i < 11; i++) cache1.put(i, i); SystemView<ScanQueryView> qrySysView0 = g0.context().systemView().view(SCAN_QRY_SYS_VIEW); assertNotNull(qrySysView0); assertEquals(0, qrySysView0.size()); QueryCursor<Integer> qryRes1 = cache1.query( new ScanQuery<Integer, Integer>() .setFilter(new MyPredicate()) .setLocal(true) .setPageSize(10), new MyTransformer()); assertTrue(qryRes1.iterator().hasNext()); boolean res = waitForCondition(() -> qrySysView0.size() > 0, 5_000); assertTrue(res); ScanQueryView view = qrySysView0.iterator().next(); assertEquals(g0.localNode().id(), view.originNodeId()); assertEquals(0, view.queryId()); assertEquals("cache1", view.cacheName()); assertEquals(cacheId("cache1"), view.cacheId()); assertEquals(cacheGroupId("cache1", "group1"), view.cacheGroupId()); assertEquals("group1", view.cacheGroupName()); assertTrue(view.startTime() <= System.currentTimeMillis()); assertTrue(view.duration() >= 0); assertFalse(view.canceled()); assertEquals(MY_PREDICATE, view.filter()); assertTrue(view.local()); assertEquals(-1, view.partition()); assertEquals(toStringSafe(g0.context().discovery().topologyVersionEx()), view.topology()); assertEquals(MY_TRANSFORMER, view.transformer()); assertFalse(view.keepBinary()); assertNull(view.subjectId()); assertNull(view.taskName()); qryRes1.close(); res = waitForCondition(() -> qrySysView0.size() == 0, 5_000); assertTrue(res); } }

Target:
public void testLocalScanQuery() throws Exception { try(IgniteEx g0 = startGrid(0)) { IgniteCache<Integer, Integer> cache1 = g0.createCache( new CacheConfiguration<Integer, Integer>("cache1") .setGroupName("group1")); int part = g0.affinity("cache1").primaryPartitions(g0.localNode())[0]; List<Integer> partKeys = partitionKeys(cache1, part, 11, 0); for (Integer key : partKeys) cache1.put(key, key); SystemView<ScanQueryView> qrySysView0 = g0.context().systemView().view(SCAN_QRY_SYS_VIEW); assertNotNull(qrySysView0); assertEquals(0, qrySysView0.size()); QueryCursor<Integer> qryRes1 = cache1.query( new ScanQuery<Integer, Integer>() .setFilter(new TestPredicate()) .setLocal(true) .setPartition(part) .setPageSize(10), new TestTransformer()); assertTrue(qryRes1.iterator().hasNext()); boolean res = waitForCondition(() -> qrySysView0.size() > 0, 5_000); assertTrue(res); ScanQueryView view = qrySysView0.iterator().next(); assertEquals(g0.localNode().id(), view.originNodeId()); assertEquals(0, view.queryId()); assertEquals("cache1", view.cacheName()); assertEquals(cacheId("cache1"), view.cacheId()); assertEquals(cacheGroupId("cache1", "group1"), view.cacheGroupId()); assertEquals("group1", view.cacheGroupName()); assertTrue(view.startTime() <= System.currentTimeMillis()); assertTrue(view.duration() >= 0); assertFalse(view.canceled()); assertEquals(TEST_PREDICATE, view.filter()); assertTrue(view.local()); assertEquals(part, view.partition()); assertEquals(toStringSafe(g0.context().discovery().topologyVersionEx()), view.topology()); assertEquals(TEST_TRANSFORMER, view.transformer()); assertFalse(view.keepBinary()); assertNull(view.subjectId()); assertNull(view.taskName()); qryRes1.close(); res = waitForCondition(() -> qrySysView0.size() == 0, 5_000); assertTrue(res); } }