ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [09/50] incubator-ignite git commit: # ignite-sprint-4 changed async put future to return null (IGNITE-461)
Date Mon, 27 Apr 2015 12:30:08 GMT
# ignite-sprint-4 changed async put future to return null (IGNITE-461)


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

Branch: refs/heads/ignite-648
Commit: 0ee27990da844ed6655e0381fe6da4ebf3543567
Parents: 86cc1ad
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Apr 23 09:48:18 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Apr 23 09:48:18 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/IgniteCacheProxy.java  | 15 +++++++++++++--
 .../cache/GridCacheAbstractFullApiSelfTest.java      |  4 ++--
 2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ee27990/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 5b9cfbf..c833705 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
@@ -814,8 +814,19 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V
             CacheOperationContext prev = onEnter(opCtx);
 
             try {
-                if (isAsync())
-                    setFuture(delegate.putAsync(key, val));
+                if (isAsync()) {
+                    IgniteInternalFuture<Boolean> fut = delegate.putAsync(key, val);
+
+                    IgniteInternalFuture<Void> fut0 = fut.chain(new CX1<IgniteInternalFuture<Boolean>,
Void>() {
+                        @Override public Void applyx(IgniteInternalFuture<Boolean>
fut) throws IgniteCheckedException {
+                            fut.get();
+
+                            return null;
+                        }
+                    });
+
+                    setFuture(fut0);
+                }
                 else
                     delegate.put(key, val);
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ee27990/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 8813e82..561c6a4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -1368,8 +1368,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
                 f = tx.future();
             }
 
-            fut1.get();
-            fut2.get();
+            assertNull(fut1.get());
+            assertNull(fut2.get());
 
             assert f == null || f.get().state() == COMMITTED;
         }


Mime
View raw message