ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [01/41] incubator-ignite git commit: futures: api cleanup
Date Mon, 09 Mar 2015 20:49:27 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/sprint-2 ad061ff7a -> ebc5bde14


futures: api cleanup


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

Branch: refs/heads/sprint-2
Commit: 680b0bac27ccc159b20e509d6a62ca8fc3631b9a
Parents: 9b2a034
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Wed Mar 4 18:46:24 2015 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Wed Mar 4 18:46:24 2015 +0300

----------------------------------------------------------------------
 .../ComputeFibonacciContinuationExample.java    | 12 ++--
 .../examples/datagrid/CacheApiExample.java      |  2 +-
 .../examples/ScalarContinuationExample.scala    | 12 ++--
 .../ignite/internal/IgniteInternalFuture.java   |  8 ---
 .../util/future/GridFinishedFuture.java         |  5 --
 .../util/future/GridFinishedFutureEx.java       |  5 --
 .../internal/util/future/GridFutureAdapter.java | 22 --------
 .../util/future/GridFutureAdapterEx.java        | 17 ------
 .../internal/util/future/IgniteFutureImpl.java  |  9 +--
 .../visor/cache/VisorCacheClearTask.java        |  2 +-
 .../org/apache/ignite/lang/IgniteFuture.java    |  9 +--
 .../internal/GridMultipleJobsSelfTest.java      |  2 +-
 .../GridTaskFutureImplStopGridSelfTest.java     |  2 +-
 .../internal/GridTaskListenerSelfTest.java      |  2 +-
 .../GridCacheAsyncOperationsLimitSelfTest.java  |  3 +-
 .../cache/GridCachePutAllFailoverSelfTest.java  |  6 +-
 .../util/future/IgniteFutureImplTest.java       | 58 +++-----------------
 .../loadtests/colocation/GridTestMain.java      |  2 +-
 ...GridJobExecutionLoadTestClientSemaphore.java |  2 +-
 ...JobExecutionSingleNodeSemaphoreLoadTest.java |  2 +-
 .../mergesort/GridMergeSortLoadTask.java        |  2 +-
 .../GridCacheStoreValueBytesTest.java           |  4 +-
 .../processors/schedule/ScheduleFutureImpl.java | 22 ++------
 .../schedule/GridScheduleSelfTest.java          |  4 +-
 24 files changed, 41 insertions(+), 173 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/examples/src/main/java/org/apache/ignite/examples/computegrid/ComputeFibonacciContinuationExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/computegrid/ComputeFibonacciContinuationExample.java
b/examples/src/main/java/org/apache/ignite/examples/computegrid/ComputeFibonacciContinuationExample.java
index 5665b9e..1dc96e5 100644
--- a/examples/src/main/java/org/apache/ignite/examples/computegrid/ComputeFibonacciContinuationExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/computegrid/ComputeFibonacciContinuationExample.java
@@ -138,9 +138,9 @@ public final class ComputeFibonacciContinuationExample {
                     compute.apply(new FibonacciClosure(nodeFilter), n - 1);
 
                     ComputeTaskFuture<BigInteger> futVal = compute.future();
-                    
+
                     fut1 = locMap.putIfAbsent(n - 1, futVal);
-                    
+
                     if (fut1 == null)
                         fut1 = futVal;
                 }
@@ -150,9 +150,9 @@ public final class ComputeFibonacciContinuationExample {
                     compute.apply(new FibonacciClosure(nodeFilter), n - 2);
 
                     ComputeTaskFuture<BigInteger> futVal = compute.<BigInteger>future();
-                    
+
                     fut2 = locMap.putIfAbsent(n - 2, futVal);
-                    
+
                     if (fut2 == null)
                         fut2 = futVal;
                 }
@@ -178,8 +178,8 @@ public final class ComputeFibonacciContinuationExample {
                     jobCtx.holdcc();
 
                     // Attach the same listener to both futures.
-                    fut1.listenAsync(lsnr);
-                    fut2.listenAsync(lsnr);
+                    fut1.listen(lsnr);
+                    fut2.listen(lsnr);
 
                     return null;
                 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheApiExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheApiExample.java
b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheApiExample.java
index d702555..1bec481 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheApiExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheApiExample.java
@@ -86,7 +86,7 @@ public class CacheApiExample {
         IgniteFuture<String> fut = asyncCache.future();
 
         //Asynchronously wait for result.
-        fut.listenAsync(new IgniteInClosure<IgniteFuture<String>>() {
+        fut.listen(new IgniteInClosure<IgniteFuture<String>>() {
             @Override
             public void apply(IgniteFuture<String> fut) {
                 try {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarContinuationExample.scala
----------------------------------------------------------------------
diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarContinuationExample.scala
b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarContinuationExample.scala
index 9067918..9a9e666 100644
--- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarContinuationExample.scala
+++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarContinuationExample.scala
@@ -122,9 +122,9 @@ class FibonacciClosure (
                 comp.apply(new FibonacciClosure(excludeNodeId), n - 1)
 
                 val futVal = comp.future[BigInteger]()
-                
+
                 fut1 = store.putIfAbsent(n - 1, futVal)
-                
+
                 if (fut1 == null)
                     fut1 = futVal
             }
@@ -134,9 +134,9 @@ class FibonacciClosure (
                 comp.apply(new FibonacciClosure(excludeNodeId), n - 2)
 
                 val futVal = comp.future[BigInteger]()
-                
+
                 fut2 = store.putIfAbsent(n - 2, futVal)
-                
+
                 if (fut2 == null)
                     fut2 = futVal
             }
@@ -152,8 +152,8 @@ class FibonacciClosure (
                 }
 
                 // Attach the same listener to both futures.
-                fut1.listenAsync(lsnr)
-                fut2.listenAsync(lsnr)
+                fut1.listen(lsnr)
+                fut2.listen(lsnr)
 
                 // Hold (suspend) job execution.
                 // It will be resumed in listener above via 'callcc()' call

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/main/java/org/apache/ignite/internal/IgniteInternalFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteInternalFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/IgniteInternalFuture.java
index 6f9be27..ed4a820 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteInternalFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteInternalFuture.java
@@ -172,14 +172,6 @@ public interface IgniteInternalFuture<R> {
     public void listenAsync(@Nullable IgniteInClosure<? super IgniteInternalFuture<R>>
lsnr);
 
     /**
-     * Removes given listeners from the future. If no listener is passed in, then all listeners
-     * will be removed.
-     *
-     * @param lsnr Listeners to remove.
-     */
-    public void stopListenAsync(@Nullable IgniteInClosure<? super IgniteInternalFuture<R>>...
lsnr);
-
-    /**
      * Make a chained future to convert result of this future (when complete) into a new
format.
      * It is guaranteed that done callback will be called only ONCE.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java
index 32924f2..c2f1b89 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFuture.java
@@ -183,11 +183,6 @@ public class GridFinishedFuture<T> implements IgniteInternalFuture<T>,
Externali
     }
 
     /** {@inheritDoc} */
-    @Override public void stopListenAsync(@Nullable IgniteInClosure<? super IgniteInternalFuture<T>>...
lsnr) {
-        // No-op.
-    }
-
-    /** {@inheritDoc} */
     @Override public <R> IgniteInternalFuture<R> chain(final IgniteClosure<?
super IgniteInternalFuture<T>, R> doneCb) {
         GridFutureAdapter<R> fut = new GridFutureAdapter<R>(ctx, syncNotify)
{
             @Override public String toString() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFutureEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFutureEx.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFutureEx.java
index f7eb9d9..84323be 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFutureEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFinishedFutureEx.java
@@ -165,11 +165,6 @@ public class GridFinishedFutureEx<T> implements IgniteInternalFuture<T>,
Externa
             lsnr.apply(this);
     }
 
-    /** {@inheritDoc} */
-    @Override public void stopListenAsync(@Nullable IgniteInClosure<? super IgniteInternalFuture<T>>...
lsnr) {
-        // No-op.
-    }
-
     /**
      * @return {@code True} if future failed.
      */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
index 5a7dcdd..4beb89a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
@@ -300,28 +300,6 @@ public class GridFutureAdapter<R> extends AbstractQueuedSynchronizer
implements
     }
 
     /** {@inheritDoc} */
-    @Override public void stopListenAsync(@Nullable IgniteInClosure<? super IgniteInternalFuture<R>>...
lsnr) {
-        synchronized (mux) {
-            if (lsnrs == null)
-                return;
-
-            if (lsnr == null || lsnr.length == 0)
-                lsnrs.clear();
-            else {
-                // Iterate through the whole list, removing all occurrences, if any.
-                for (Iterator<IgniteInClosure<? super IgniteInternalFuture<R>>>
it = lsnrs.iterator(); it.hasNext();) {
-                    IgniteInClosure<? super IgniteInternalFuture<R>> l1 = it.next();
-
-                    for (IgniteInClosure<? super IgniteInternalFuture<R>> l2
: lsnr)
-                        // Must be l1.equals(l2), not l2.equals(l1), because of the way listeners
are added.
-                        if (l1.equals(l2))
-                            it.remove();
-                }
-            }
-        }
-    }
-
-    /** {@inheritDoc} */
     @Override public <T> IgniteInternalFuture<T> chain(final IgniteClosure<?
super IgniteInternalFuture<R>, T> doneCb) {
         return new ChainFuture<>(ctx, syncNotify, this, doneCb);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapterEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapterEx.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapterEx.java
index 4836a90..ccce6e7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapterEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapterEx.java
@@ -250,23 +250,6 @@ public class GridFutureAdapterEx<R> extends AbstractQueuedSynchronizer
implement
     }
 
     /** {@inheritDoc} */
-    @Override public void stopListenAsync(@Nullable IgniteInClosure<? super IgniteInternalFuture<R>>...
lsnr) {
-        if (lsnr == null || lsnr.length == 0)
-            lsnrs.clear();
-        else {
-            // Iterate through the whole list, removing all occurrences, if any.
-            for (Iterator<IgniteInClosure<? super IgniteInternalFuture<R>>>
it = lsnrs.iterator(); it.hasNext(); ) {
-                IgniteInClosure<? super IgniteInternalFuture<R>> l1 = it.next();
-
-                for (IgniteInClosure<? super IgniteInternalFuture<R>> l2 : lsnr)
-                    // Must be l1.equals(l2), not l2.equals(l1), because of the way listeners
are added.
-                    if (l1.equals(l2))
-                        it.remove();
-            }
-        }
-    }
-
-    /** {@inheritDoc} */
     @Override public <T> IgniteInternalFuture<T> chain(final IgniteClosure<?
super IgniteInternalFuture<R>, T> doneCb) {
         final GridFutureAdapterEx<T> fut = new GridFutureAdapterEx<T>() {
             @Override public String toString() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java
index ded75ef..028616e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java
@@ -91,19 +91,12 @@ public class IgniteFutureImpl<V> implements IgniteFuture<V>
{
     }
 
     /** {@inheritDoc} */
-    @Override public void listenAsync(@Nullable final IgniteInClosure<? super IgniteFuture<V>>
lsnr) {
+    @Override public void listen(@Nullable final IgniteInClosure<? super IgniteFuture<V>>
lsnr) {
         if (lsnr != null)
             fut.listenAsync(new InternalFutureListener(lsnr));
     }
 
     /** {@inheritDoc} */
-    @Override public void stopListenAsync(IgniteInClosure<? super IgniteFuture<V>>
lsnr) {
-        A.notNull(lsnr, "lsnr");
-
-        fut.stopListenAsync(new InternalFutureListener(lsnr));
-    }
-
-    /** {@inheritDoc} */
     @Override public <T> IgniteFuture<T> chain(final IgniteClosure<? super
IgniteFuture<V>, T> doneCb) {
         IgniteInternalFuture<T> fut0 = fut.chain(new C1<IgniteInternalFuture<V>,
T>() {
             @Override public T apply(IgniteInternalFuture<V> fut) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTask.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTask.java
index f341a04..ce725a0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTask.java
@@ -100,7 +100,7 @@ public class VisorCacheClearTask extends VisorOneNodeTask<String, IgniteBiTuple<
 
             jobCtx.holdcc();
 
-            fut.listenAsync(lsnr);
+            fut.listen(lsnr);
 
             return true;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/main/java/org/apache/ignite/lang/IgniteFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/lang/IgniteFuture.java b/modules/core/src/main/java/org/apache/ignite/lang/IgniteFuture.java
index 2fcf7f4..79b01e5 100644
--- a/modules/core/src/main/java/org/apache/ignite/lang/IgniteFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/lang/IgniteFuture.java
@@ -153,14 +153,7 @@ public interface IgniteFuture<V> extends Future<V> {
      *
      * @param lsnr Listener closure to register. If not provided - this method is no-op.
      */
-    public void listenAsync(IgniteInClosure<? super IgniteFuture<V>> lsnr);
-
-    /**
-     * Removes given listener from the future.
-     *
-     * @param lsnr Listener to remove.
-     */
-    public void stopListenAsync(IgniteInClosure<? super IgniteFuture<V>> lsnr);
+    public void listen(IgniteInClosure<? super IgniteFuture<V>> lsnr);
 
     /**
      * Make a chained future to convert result of this future (when complete) into a new
format.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/test/java/org/apache/ignite/internal/GridMultipleJobsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridMultipleJobsSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/GridMultipleJobsSelfTest.java
index 565aaa7..62ade4e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridMultipleJobsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridMultipleJobsSelfTest.java
@@ -157,7 +157,7 @@ public class GridMultipleJobsSelfTest extends GridCommonAbstractTest {
                     if (cnt % LOG_MOD == 0)
                         X.println("Submitted jobs: " + cnt);
 
-                    fut.listenAsync(new CIX1<IgniteFuture<Boolean>>() {
+                    fut.listen(new CIX1<IgniteFuture<Boolean>>() {
                         @Override public void applyx(IgniteFuture<Boolean> f) {
                             try {
                                 assert f.get();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/test/java/org/apache/ignite/internal/GridTaskFutureImplStopGridSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridTaskFutureImplStopGridSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/GridTaskFutureImplStopGridSelfTest.java
index 3718373..f02899f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridTaskFutureImplStopGridSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridTaskFutureImplStopGridSelfTest.java
@@ -67,7 +67,7 @@ public class GridTaskFutureImplStopGridSelfTest extends GridCommonAbstractTest
{
         try {
             final ComputeTaskFuture<?> fut = executeAsync(ignite.compute(), GridStopTestTask.class.getName(),
null);
 
-            fut.listenAsync(new CI1<IgniteFuture>() {
+            fut.listen(new CI1<IgniteFuture>() {
                 @SuppressWarnings({"NakedNotify"})
                 @Override public void apply(IgniteFuture gridFut) {
                     synchronized (mux) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/test/java/org/apache/ignite/internal/GridTaskListenerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridTaskListenerSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/GridTaskListenerSelfTest.java
index 351eeac..dd9cb9d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridTaskListenerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridTaskListenerSelfTest.java
@@ -63,7 +63,7 @@ public class GridTaskListenerSelfTest extends GridCommonAbstractTest {
 
         ComputeTaskFuture<?> fut = executeAsync(ignite.compute(), TestTask.class.getName(),
null);
 
-        fut.listenAsync(lsnr);
+        fut.listen(lsnr);
 
         fut.get();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAsyncOperationsLimitSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAsyncOperationsLimitSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAsyncOperationsLimitSelfTest.java
index a199619..545447d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAsyncOperationsLimitSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAsyncOperationsLimitSelfTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.lang.*;
@@ -65,7 +64,7 @@ public class GridCacheAsyncOperationsLimitSelfTest extends GridCacheAbstractSelf
 
             IgniteFuture<?> fut = cacheAsync.future();
 
-            fut.listenAsync(new CI1<IgniteFuture<?>>() {
+            fut.listen(new CI1<IgniteFuture<?>>() {
                 @Override public void apply(IgniteFuture<?> t) {
                     cnt.decrementAndGet();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
index 9d2fe99..90aa7ee 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
@@ -259,7 +259,7 @@ public class GridCachePutAllFailoverSelfTest extends GridCommonAbstractTest
{
 
                     resQueue.put(fut); // Blocks if queue is full.
 
-                    fut.listenAsync(new CI1<IgniteFuture<Void>>() {
+                    fut.listen(new CI1<IgniteFuture<Void>>() {
                         @Override public void apply(IgniteFuture<Void> f) {
                             ComputeTaskFuture<?> taskFut = (ComputeTaskFuture<?>)f;
 
@@ -431,7 +431,7 @@ public class GridCachePutAllFailoverSelfTest extends GridCommonAbstractTest
{
 
                     resQueue.put(fut); // Blocks if queue is full.
 
-                    fut.listenAsync(new CI1<IgniteFuture<Void>>() {
+                    fut.listen(new CI1<IgniteFuture<Void>>() {
                         @Override public void apply(IgniteFuture<Void> f) {
                             ComputeTaskFuture<?> taskFut = (ComputeTaskFuture<?>)f;
 
@@ -482,7 +482,7 @@ public class GridCachePutAllFailoverSelfTest extends GridCommonAbstractTest
{
 
                 resQueue.put(fut); // Blocks if queue is full.
 
-                fut.listenAsync(new CI1<IgniteFuture<Void>>() {
+                fut.listen(new CI1<IgniteFuture<Void>>() {
                     @Override public void apply(IgniteFuture<Void> f) {
                         ComputeTaskFuture<?> taskFut = (ComputeTaskFuture<?>)f;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/test/java/org/apache/ignite/internal/util/future/IgniteFutureImplTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/future/IgniteFutureImplTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/util/future/IgniteFutureImplTest.java
index d57ed8e..d782d32 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/future/IgniteFutureImplTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/future/IgniteFutureImplTest.java
@@ -189,8 +189,8 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest {
 
         assertFalse(fut.isDone());
 
-        fut.listenAsync(lsnr1);
-        fut.listenAsync(lsnr2);
+        fut.listen(lsnr1);
+        fut.listen(lsnr2);
 
         U.sleep(100);
 
@@ -201,50 +201,6 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest {
 
         assertEquals(1, lsnr1Cnt.get());
         assertEquals(1, lsnr2Cnt.get());
-
-        lsnr1Cnt.set(0);
-        lsnr2Cnt.set(0);
-
-        // Stop one listener.
-        {
-            fut0 = new GridFutureAdapter<>(new GridTestKernalContext(log), true);
-
-            fut = new IgniteFutureImpl<>(fut0);
-
-            fut.syncNotify(true);
-
-            fut.listenAsync(lsnr1);
-            fut.listenAsync(lsnr2);
-
-            fut.stopListenAsync(lsnr2);
-
-            fut0.onDone("test");
-
-            assertEquals(1, lsnr1Cnt.get());
-            assertEquals(0, lsnr2Cnt.get());
-
-            lsnr1Cnt.set(0);
-        }
-
-        // Stop both listeners.
-        {
-            fut0 = new GridFutureAdapter<>(new GridTestKernalContext(log), true);
-
-            fut = new IgniteFutureImpl<>(fut0);
-
-            fut.syncNotify(true);
-
-            fut.listenAsync(lsnr1);
-            fut.listenAsync(lsnr2);
-
-            fut.stopListenAsync(lsnr2);
-            fut.stopListenAsync(lsnr1);
-
-            fut0.onDone("test");
-
-            assertEquals(0, lsnr1Cnt.get());
-            assertEquals(0, lsnr2Cnt.get());
-        }
     }
 
     /**
@@ -277,7 +233,7 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest {
                 }
             };
 
-            fut.listenAsync(lsnr1);
+            fut.listen(lsnr1);
 
             fut0.onDone(err0);
 
@@ -310,7 +266,7 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest {
                 }
             };
 
-            fut.listenAsync(lsnr1);
+            fut.listen(lsnr1);
 
             fut0.onDone(err0);
 
@@ -342,7 +298,7 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest {
 
         final AtomicInteger lsnrCnt = new AtomicInteger();
 
-        chained.listenAsync(new CI1<IgniteFuture<Integer>>() {
+        chained.listen(new CI1<IgniteFuture<Integer>>() {
             @Override public void apply(IgniteFuture<Integer> fut) {
                 assertEquals(10, (int)fut.get());
 
@@ -422,7 +378,7 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest {
                 }
             };
 
-            chained.listenAsync(lsnr1);
+            chained.listen(lsnr1);
 
             fut0.onDone(err0);
 
@@ -496,7 +452,7 @@ public class IgniteFutureImplTest extends GridCommonAbstractTest {
                 }
             };
 
-            chained.listenAsync(lsnr1);
+            chained.listen(lsnr1);
 
             fut0.onDone(err0);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/test/java/org/apache/ignite/loadtests/colocation/GridTestMain.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/colocation/GridTestMain.java
b/modules/core/src/test/java/org/apache/ignite/loadtests/colocation/GridTestMain.java
index e8ffedf..892f405 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/colocation/GridTestMain.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/colocation/GridTestMain.java
@@ -97,7 +97,7 @@ public class GridTestMain {
 
             q.put(f);
 
-            f.listenAsync(new CI1<IgniteFuture<?>>() {
+            f.listen(new CI1<IgniteFuture<?>>() {
                 @Override public void apply(IgniteFuture<?> o) {
                     q.poll();
                 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionLoadTestClientSemaphore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionLoadTestClientSemaphore.java
b/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionLoadTestClientSemaphore.java
index 9ddc91d..327e2da 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionLoadTestClientSemaphore.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionLoadTestClientSemaphore.java
@@ -74,7 +74,7 @@ public class GridJobExecutionLoadTestClientSemaphore implements Callable<Object>
 
             ComputeTaskFuture<Object> f = comp.future();
 
-            f.listenAsync(lsnr);
+            f.listen(lsnr);
 
             txCnt.increment();
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionSingleNodeSemaphoreLoadTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionSingleNodeSemaphoreLoadTest.java
b/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionSingleNodeSemaphoreLoadTest.java
index e8d7a13..d1665b5 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionSingleNodeSemaphoreLoadTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionSingleNodeSemaphoreLoadTest.java
@@ -180,7 +180,7 @@ public class GridJobExecutionSingleNodeSemaphoreLoadTest {
 
                 ComputeTaskFuture<Object> f = comp.future();
 
-                f.listenAsync(lsnr);
+                f.listen(lsnr);
 
                 iterCntr.increment();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/test/java/org/apache/ignite/loadtests/mergesort/GridMergeSortLoadTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/mergesort/GridMergeSortLoadTask.java
b/modules/core/src/test/java/org/apache/ignite/loadtests/mergesort/GridMergeSortLoadTask.java
index 34c8fb9..9e73c71 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/mergesort/GridMergeSortLoadTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/mergesort/GridMergeSortLoadTask.java
@@ -77,7 +77,7 @@ public class GridMergeSortLoadTask extends ComputeTaskSplitAdapter<int[],
int[]>
 
                         // Add a listener to the future, that will resume the
                         // parent task once the child one is completed.
-                        fut.listenAsync(new CI1<IgniteFuture<int[]>>() {
+                        fut.listen(new CI1<IgniteFuture<int[]>>() {
                             @Override public void apply(IgniteFuture<int[]> fut) {
                                 // CONTINUATION:
                                 // =============

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/core/src/test/java/org/apache/ignite/storevalbytes/GridCacheStoreValueBytesTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/storevalbytes/GridCacheStoreValueBytesTest.java
b/modules/core/src/test/java/org/apache/ignite/storevalbytes/GridCacheStoreValueBytesTest.java
index 05fd5f8..3cf96d8 100644
--- a/modules/core/src/test/java/org/apache/ignite/storevalbytes/GridCacheStoreValueBytesTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/storevalbytes/GridCacheStoreValueBytesTest.java
@@ -18,8 +18,6 @@
 package org.apache.ignite.storevalbytes;
 
 import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
@@ -238,7 +236,7 @@ public class GridCacheStoreValueBytesTest {
 
                                 IgniteFuture<Object> f = asyncCache.future();
 
-                                f.listenAsync(lsnr);
+                                f.listen(lsnr);
 
                                 cntr.incrementAndGet();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/schedule/src/main/java/org/apache/ignite/internal/processors/schedule/ScheduleFutureImpl.java
----------------------------------------------------------------------
diff --git a/modules/schedule/src/main/java/org/apache/ignite/internal/processors/schedule/ScheduleFutureImpl.java
b/modules/schedule/src/main/java/org/apache/ignite/internal/processors/schedule/ScheduleFutureImpl.java
index 34284ac..409915a 100644
--- a/modules/schedule/src/main/java/org/apache/ignite/internal/processors/schedule/ScheduleFutureImpl.java
+++ b/modules/schedule/src/main/java/org/apache/ignite/internal/processors/schedule/ScheduleFutureImpl.java
@@ -582,7 +582,7 @@ class ScheduleFutureImpl<R> implements SchedulerFuture<R>,
Externalizable {
     }
 
     /** {@inheritDoc} */
-    @Override public void listenAsync(@Nullable IgniteInClosure<? super IgniteFuture<R>>
lsnr) {
+    @Override public void listen(@Nullable IgniteInClosure<? super IgniteFuture<R>>
lsnr) {
         if (lsnr != null) {
             Throwable err;
             R res;
@@ -612,15 +612,6 @@ class ScheduleFutureImpl<R> implements SchedulerFuture<R>,
Externalizable {
     }
 
     /** {@inheritDoc} */
-    @Override public void stopListenAsync(@Nullable IgniteInClosure<? super IgniteFuture<R>>
lsnr) {
-        A.notNull(lsnr, "lsnr");
-
-        synchronized (mux) {
-            lsnrs.remove(lsnr);
-        }
-    }
-
-    /** {@inheritDoc} */
     @SuppressWarnings("ExternalizableWithoutPublicNoArgConstructor")
     @Override public <T> IgniteFuture<T> chain(final IgniteClosure<? super
IgniteFuture<R>, T> doneCb) {
         final GridFutureAdapter<T> fut = new GridFutureAdapter<T>(ctx, syncNotify)
{
@@ -629,7 +620,7 @@ class ScheduleFutureImpl<R> implements SchedulerFuture<R>,
Externalizable {
             }
         };
 
-        listenAsync(new CI1<IgniteFuture<R>>() {
+        listen(new CI1<IgniteFuture<R>>() {
             @Override public void apply(IgniteFuture<R> fut0) {
                 try {
                     fut.onDone(doneCb.apply(fut0));
@@ -964,13 +955,8 @@ class ScheduleFutureImpl<R> implements SchedulerFuture<R>,
Externalizable {
         }
 
         /** {@inheritDoc} */
-        @Override public void listenAsync(@Nullable IgniteInClosure<? super IgniteFuture<R>>
lsnr) {
-            ref.listenAsync(lsnr);
-        }
-
-        /** {@inheritDoc} */
-        @Override public void stopListenAsync(@Nullable IgniteInClosure<? super IgniteFuture<R>>
lsnr) {
-            ref.stopListenAsync(lsnr);
+        @Override public void listen(@Nullable IgniteInClosure<? super IgniteFuture<R>>
lsnr) {
+            ref.listen(lsnr);
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/680b0bac/modules/schedule/src/test/java/org/apache/ignite/internal/processors/schedule/GridScheduleSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/schedule/src/test/java/org/apache/ignite/internal/processors/schedule/GridScheduleSelfTest.java
b/modules/schedule/src/test/java/org/apache/ignite/internal/processors/schedule/GridScheduleSelfTest.java
index c9444bf..c887b2d 100644
--- a/modules/schedule/src/test/java/org/apache/ignite/internal/processors/schedule/GridScheduleSelfTest.java
+++ b/modules/schedule/src/test/java/org/apache/ignite/internal/processors/schedule/GridScheduleSelfTest.java
@@ -113,7 +113,7 @@ public class GridScheduleSelfTest extends GridCommonAbstractTest {
 
             final AtomicInteger notifyCnt = new AtomicInteger();
 
-            fut.listenAsync(new CI1<IgniteFuture<?>>() {
+            fut.listen(new CI1<IgniteFuture<?>>() {
                 @Override public void apply(IgniteFuture<?> e) {
                     notifyCnt.incrementAndGet();
                 }
@@ -171,7 +171,7 @@ public class GridScheduleSelfTest extends GridCommonAbstractTest {
 
             final AtomicInteger notifyCnt = new AtomicInteger();
 
-            fut.listenAsync(new CI1<IgniteFuture<?>>() {
+            fut.listen(new CI1<IgniteFuture<?>>() {
                 @Override public void apply(IgniteFuture<?> e) {
                     notifyCnt.incrementAndGet();
                 }


Mime
View raw message