dgarus commented on a change in pull request #6923: IGNITE-12214: Continuous 
query system view.
URL: https://github.com/apache/ignite/pull/6923#discussion_r330550838
 
 

 ##########
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java
 ##########
 @@ -461,6 +466,61 @@ public void testClientsConnections() throws Exception {
         }
     }
 
+    /** */
+    @Test
+    public void testContinuousQuery() throws Exception {
+        try(IgniteEx g0 = startGrid(0); IgniteEx g1 = startGrid(1)) {
+            IgniteCache<Integer, Integer> cache = g0.createCache("cache-1");
+
+            QueryCursor qry = cache.query(new ContinuousQuery<>()
+                .setInitialQuery(new ScanQuery<>())
+                .setPageSize(100)
+                .setTimeInterval(1000)
+                .setLocalListener(evts -> {
+                    // No-op.
+                })
+                .setRemoteFilterFactory(() -> evt -> true)
+            );
+
+            for (int i=0; i<100; i++)
+                cache.put(i, i);
+
+            SystemView<ContinuousQueryView> qrys = 
g0.context().systemView().view(CQ_SYS_VIEW);
+
+            assertEquals(1, qrys.size());
+
+            //Info on originating node.
+            for (ContinuousQueryView cq : qrys) {
+                assertEquals("cache-1", cq.cacheName());
+                assertEquals(100, cq.bufferSize());
+                assertEquals(1000, cq.interval());
+                assertEquals(g0.localNode().id(), cq.nodeId());
+                //Local listener not null on originating node.
+                
assertTrue(cq.localListener().startsWith(getClass().getName()));
+                assertTrue(cq.remoteFilter().startsWith(getClass().getName()));
+                assertNull(cq.localTransformedListener());
+                assertNull(cq.remoteTransformer());
+            }
+
+            qrys = g1.context().systemView().view(CQ_SYS_VIEW);
+
+            assertEquals(1, qrys.size());
+
+            //Info on remote node.
+            for (ContinuousQueryView cq : qrys) {
+                assertEquals("cache-1", cq.cacheName());
+                assertEquals(100, cq.bufferSize());
+                assertEquals(1000, cq.interval());
+                assertEquals(g0.localNode().id(), cq.nodeId());
+                //Local listener is null on remote nodes.
+                assertNull(cq.localListener());
+                assertTrue(cq.remoteFilter().startsWith(getClass().getName()));
+                assertNull(cq.localTransformedListener());
+                assertNull(cq.remoteTransformer());
+            }
 
 Review comment:
   It looks like code duplication.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to