You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/04/18 09:46:59 UTC

[GitHub] [ignite] bratwurzt commented on a change in pull request #7680: IGNITE-12905 Custom spliterator for QueryKeyValueIterable

bratwurzt commented on a change in pull request #7680: IGNITE-12905 Custom spliterator for QueryKeyValueIterable
URL: https://github.com/apache/ignite/pull/7680#discussion_r410676005
 
 

 ##########
 File path: modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectContinuousProcessorTest.java
 ##########
 @@ -305,6 +312,34 @@ public void testCacheContinuousQueryReconnectNewServer() throws Exception {
         }
     }
 
+    @Test
+    public void testCacheContinuousQuerySpliteratorMultipleCalls() {
+        Ignite client = grid(serverCount());
+
+        assertTrue(client.cluster().localNode().isClient());
+
+        IgniteCache<Object, Object> clientCache = client.getOrCreateCache(new CacheConfiguration<>(DEFAULT_CACHE_NAME));
+
+        CacheEventListener lsnr = new CacheEventListener();
+
+        ContinuousQuery<Object, Object> qry = new ContinuousQuery<>();
+
+        qry.setInitialQuery(new ScanQuery<>(new IgniteBiPredicate<Object, Object>() {
+            @Override public boolean apply(Object key, Object val) {
+                return key != null;
+            }
+        }));
+        qry.setAutoUnsubscribe(true);
+
+        qry.setLocalListener(lsnr);
+
+        try(QueryCursor<?> cur = clientCache.query(qry)) {
+            cur.iterator();
+            cur.spliterator();
 
 Review comment:
   Yes, I am fine with that - as long as it doesn't throw exception "Iterator is already fetched or query was cancelled."

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services