ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [15/16] incubator-ignite git commit: # sprint-2 fix for ignite-523
Date Fri, 20 Mar 2015 15:45:35 GMT
# sprint-2 fix for ignite-523


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/38faddae
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/38faddae
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/38faddae

Branch: refs/heads/ignite-45
Commit: 38faddaebf257eecdb756441ab3f9e267369c250
Parents: 38a99a3
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Mar 20 17:23:22 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Mar 20 17:23:22 2015 +0300

----------------------------------------------------------------------
 .../continuous/CacheContinuousQueryHandler.java |  3 ++
 ...ridCacheContinuousQueryAbstractSelfTest.java | 29 ++++++++++++++++++--
 2 files changed, 30 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38faddae/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
index c475a30..72fd192 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
@@ -200,6 +200,9 @@ class CacheContinuousQueryHandler<K, V> implements GridContinuousHandler
{
                     try {
                         notify = rmtFilter.evaluate(evt);
                     }
+                    catch (Exception e) {
+                        U.error(cctx.logger(CacheContinuousQueryHandler.class), "CacheEntryEventFilter
failed: " + e);
+                    }
                     finally {
                         cctx.forceFlags(f);
                     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38faddae/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
index b19a6ca..080a5a3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
@@ -316,6 +316,32 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends
GridCommo
     /**
      * @throws Exception If failed.
      */
+    public void testFilterException() throws Exception {
+        IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
+
+        ContinuousQuery<Integer, Integer> qry = new ContinuousQuery<>();
+
+        qry.setLocalListener(new CacheEntryUpdatedListener<Integer, Integer>() {
+            @Override public void onUpdated(Iterable<CacheEntryEvent<? extends Integer,
? extends Integer>> evts) {
+                // No-op.
+            }
+        });
+
+        qry.setRemoteFilter(new CacheEntryEventFilter<Integer, Integer>() {
+            @Override public boolean evaluate(CacheEntryEvent<? extends Integer, ? extends
Integer> evt) {
+                throw new RuntimeException("Test error.");
+            }
+        });
+
+        try (QueryCursor<Cache.Entry<Integer, Integer>> ignored = cache.query(qry))
{
+            for (int i = 0; i < 100; i++)
+                cache.put(i, i);
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     public void testEntriesByFilter() throws Exception {
         IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
 
@@ -345,8 +371,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends
GridCommo
         });
 
         qry.setRemoteFilter(new CacheEntryEventFilter<Integer,Integer>() {
-            @Override
-            public boolean evaluate(CacheEntryEvent<? extends Integer,? extends Integer>
evt) {
+            @Override public boolean evaluate(CacheEntryEvent<? extends Integer,? extends
Integer> evt) {
                 return evt.getKey() > 2;
             }
         });


Mime
View raw message