ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsetrak...@apache.org
Subject [1/2] incubator-ignite git commit: # ignite-45 - fixing streaming.
Date Sat, 21 Mar 2015 06:09:02 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 01bc98478 -> 7deb14632


# ignite-45 - fixing streaming.


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

Branch: refs/heads/ignite-45
Commit: f90a853d0db4ce6af874ad3ff451b1550c2a101c
Parents: f1a46c4
Author: Dmitiry Setrakyan <dsetrakyan@gridgain.com>
Authored: Fri Mar 20 23:08:42 2015 -0700
Committer: Dmitiry Setrakyan <dsetrakyan@gridgain.com>
Committed: Fri Mar 20 23:08:42 2015 -0700

----------------------------------------------------------------------
 .../ignite/cache/query/ContinuousQuery.java     | 27 +++++---------------
 1 file changed, 7 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f90a853d/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 b920b54..dbfb5b5 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
@@ -35,7 +35,7 @@ import javax.cache.event.*;
  * method.
  * <p>
  * Query can be executed either on all nodes in topology using {@link IgniteCache#query(Query)}
- * method of only on the local node if local flag for query is {@code true} (see {@link #setLocal(boolean)}
method).
+ * method, or only on the local node, if {@link Query#setLocal(boolean)} parameter is set
to {@code true}.
  * Note that in case query is distributed and a new node joins, it will get the remote
  * filter for the query during discovery process before it actually joins topology,
  * so no updates will be missed.
@@ -62,34 +62,21 @@ import javax.cache.event.*;
  * ContinuousQuery&lt;UUID, Person&gt; qry = new ContinuousQuery&lt;&gt;();
  *
  * // Initial iteration query will return all persons with salary above 1000.
- * qry.setInitialQuery(Query.scan(new IgniteBiPredicate&lt;UUID, Person&gt;() {
- *     &#64;Override public boolean apply(UUID id, Person p) {
- *         return p.getSalary() &gt; 1000;
- *     }
- * }));
+ * qry.setInitialQuery(new ScanQuery((UUID nodeId, Person p) -> p.getSalary() &gt;
1000));
  *
  *
  * // Callback that is called locally when update notifications are received.
  * // It simply prints out information about all created persons.
- * qry.setLocalListener(new CacheEntryUpdatedListener&lt;UUID, Person&gt;() {
- *     &#64;Override public void onUpdated(Iterable&lt;CacheEntryEvent&lt;? extends
UUID, ? extends Person&gt;&gt; evts) {
- *         for (CacheEntryEvent&lt;? extends UUID, ? extends Person&gt; e : evts)
{
- *             Person p = e.getValue();
+ * qry.setLocalListener((evts) -> {
+ *     for (CacheEntryEvent&lt;? extends UUID, ? extends Person&gt; e : evts) {
+ *         Person p = e.getValue();
  *
- *             X.println("&gt;&gt;&gt;");
- *             X.println("&gt;&gt;&gt; " + p.getFirstName() + " " + p.getLastName()
+
- *                 "'s salary is " + p.getSalary());
- *             X.println("&gt;&gt;&gt;");
- *         }
+ *         System.out.println(p.getFirstName() + " " + p.getLastName() + "'s salary is "
+ p.getSalary());
  *     }
  * });
  *
  * // Continuous listener will be notified for persons with salary above 1000.
- * qry.setRemoteFilter(new CacheEntryEventFilter&lt;UUID, Person&gt;() {
- *     &#64;Override public boolean evaluate(CacheEntryEvent&lt;? extends UUID, ?
extends Person&gt; e) {
- *         return e.getValue().getSalary() &gt; 1000;
- *     }
- * });
+ * qry.setRemoteFilter(evt -> e.getValue().getSalary() &gt; 1000);
  *
  * // Execute query and get cursor that iterates through initial data.
  * QueryCursor&lt;Cache.Entry&lt;UUID, Person&gt;&gt; cur = cache.query(qry);


Mime
View raw message