ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [02/37] incubator-ignite git commit: #ignite-335: Change ContinuousQuery.setInitialQuery API.
Date Thu, 05 Mar 2015 10:31:41 GMT
#ignite-335: Change ContinuousQuery.setInitialQuery API.


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

Branch: refs/heads/ignite-290
Commit: 3d4ce6f627297d7377c6069e324448498df7c278
Parents: 12ee896
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Wed Feb 25 16:59:46 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Wed Feb 25 16:59:46 2015 +0300

----------------------------------------------------------------------
 .../datagrid/CacheContinuousQueryExample.java     |  2 +-
 .../ignite/cache/query/ContinuousQuery.java       | 18 +++++++++---------
 .../processors/cache/IgniteCacheProxy.java        |  6 +++---
 .../GridCacheContinuousQueryAbstractSelfTest.java |  4 ++--
 4 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d4ce6f6/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheContinuousQueryExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheContinuousQueryExample.java
b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheContinuousQueryExample.java
index 23a23f7..d1db86b 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheContinuousQueryExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheContinuousQueryExample.java
@@ -62,7 +62,7 @@ public class CacheContinuousQueryExample {
             // Create new continuous query.
             ContinuousQuery<Integer, String> qry = new ContinuousQuery<>();
 
-            qry.setInitialPredicate(new ScanQuery<>(new IgniteBiPredicate<Integer,
String>() {
+            qry.setInitialQuery(new ScanQuery<>(new IgniteBiPredicate<Integer, String>()
{
                 @Override public boolean apply(Integer key, String val) {
                     return key > 10;
                 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d4ce6f6/modules/core/src/main/java/org/apache/ignite/cache/query/ContinuousQuery.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/ContinuousQuery.java
b/modules/core/src/main/java/org/apache/ignite/cache/query/ContinuousQuery.java
index d99e95a..96db88e 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/query/ContinuousQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/query/ContinuousQuery.java
@@ -29,7 +29,7 @@ import javax.cache.event.*;
  * the node that executed the query and local listener will be notified.
  * <p>
  * Additionally, you can execute initial query to get currently existing data.
- * Query can be of any type (SQL, TEXT or SCAN) and can be set via {@link #setInitialPredicate(Query)}
+ * Query can be of any type (SQL, TEXT or SCAN) and can be set via {@link #setInitialQuery(Query)}
  * method.
  * <p>
  * Query can be executed either on all nodes in topology using {@link IgniteCache#query(Query)}
@@ -62,7 +62,7 @@ import javax.cache.event.*;
  * ContinuousQuery qry = Query.continuous();
  *
  * // Initial iteration query will return all persons with salary above 1000.
- * qry.setInitialPredicate(Query.scan(new IgniteBiPredicate&lt;UUID, Person&gt;()
{
+ * qry.setInitialQuery(Query.scan(new IgniteBiPredicate&lt;UUID, Person&gt;() {
  *     &#64;Override public boolean apply(UUID id, Person p) {
  *         return p.getSalary() &gt; 1000;
  *     }
@@ -124,8 +124,8 @@ public final class ContinuousQuery<K, V> extends Query<ContinuousQuery<K,V>>
{
      */
     public static final boolean DFLT_AUTO_UNSUBSCRIBE = true;
 
-    /** Initial filter. */
-    private Query initFilter;
+    /** Initial query. */
+    private Query initQry;
 
     /** Local listener. */
     private CacheEntryUpdatedListener<K, V> locLsnr;
@@ -149,11 +149,11 @@ public final class ContinuousQuery<K, V> extends Query<ContinuousQuery<K,V>>
{
      * which allows to iterate through entries which already existed at the
      * time continuous query is executed.
      *
-     * @param initFilter Initial query.
+     * @param initQuery Initial query.
      * @return {@code this} for chaining.
      */
-    public ContinuousQuery<K, V> setInitialPredicate(Query initFilter) {
-        this.initFilter = initFilter;
+    public ContinuousQuery<K, V> setInitialQuery(Query initQuery) {
+        this.initQry = initQuery;
 
         return this;
     }
@@ -163,8 +163,8 @@ public final class ContinuousQuery<K, V> extends Query<ContinuousQuery<K,V>>
{
      *
      * @return Initial query.
      */
-    public Query getInitialPredicate() {
-        return initFilter;
+    public Query getInitialQuery() {
+        return initQry;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d4ce6f6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index c361a27..e05f897 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -332,7 +332,7 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V
      * @return Initial iteration cursor.
      */
     private QueryCursor<Entry<K,V>> queryContinuous(ContinuousQuery<K, V>
qry, boolean loc) {
-        if (qry.getInitialPredicate() instanceof ContinuousQuery)
+        if (qry.getInitialQuery() instanceof ContinuousQuery)
             throw new IgniteException("Initial predicate for continuous query can't be an
instance of another " +
                 "continuous query. Use SCAN or SQL query for initial iteration.");
 
@@ -350,8 +350,8 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V
 
             final QueryCursor<Cache.Entry<K, V>> cur;
 
-            if (qry.getInitialPredicate() != null)
-                cur = loc ? localQuery(qry.getInitialPredicate()) : query(qry.getInitialPredicate());
+            if (qry.getInitialQuery() != null)
+                cur = loc ? localQuery(qry.getInitialQuery()) : query(qry.getInitialQuery());
             else
                 cur = null;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d4ce6f6/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 a69ce36..62c2c1d 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
@@ -619,7 +619,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends
GridCommo
 
         ContinuousQuery<Integer, Integer> qry = Query.continuous();
 
-        qry.setInitialPredicate(Query.scan(new P2<Integer, Integer>() {
+        qry.setInitialQuery(Query.scan(new P2<Integer, Integer>() {
             @Override public boolean apply(Integer k, Integer v) {
                 return k >= 5;
             }
@@ -664,7 +664,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends
GridCommo
 
         ContinuousQuery<Integer, Integer> qry = Query.continuous();
 
-        qry.setInitialPredicate(Query.scan(new P2<Integer, Integer>() {
+        qry.setInitialQuery(Query.scan(new P2<Integer, Integer>() {
             @Override public boolean apply(Integer k, Integer v) {
                 return k >= 5;
             }


Mime
View raw message