ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [45/50] [abbrv] incubator-ignite git commit: # ignite-51
Date Wed, 11 Mar 2015 12:52:29 GMT
# ignite-51


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

Branch: refs/heads/ignite-gg-9828
Commit: ca17be026772062fb7726deeff22caaed364f61e
Parents: 8061123
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Mar 11 12:44:52 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Mar 11 12:56:18 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java        | 18 ++++++++++++++++--
 .../dht/atomic/GridDhtAtomicCache.java            |  4 ++--
 .../cache/local/atomic/GridLocalAtomicCache.java  |  4 ++--
 .../cache/GridCacheAbstractFullApiSelfTest.java   |  6 +++---
 .../IgniteCacheSystemTransactionsSelfTest.java    |  2 +-
 5 files changed, 24 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ca17be02/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index ccfcb3d..a966a86 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -107,6 +107,20 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
             }
         };
 
+    /** {@link GridCacheReturn}-to-null conversion. */
+    protected static final IgniteClosure RET2NULL =
+        new CX1<IgniteInternalFuture<GridCacheReturn>, Object>() {
+            @Nullable @Override public Object applyx(IgniteInternalFuture<GridCacheReturn>
fut) throws IgniteCheckedException {
+                fut.get();
+
+                return null;
+            }
+
+            @Override public String toString() {
+                return "Cache return value to null converter.";
+            }
+        };
+
     /** {@link GridCacheReturn}-to-success conversion. */
     private static final IgniteClosure RET2FLAG =
         new CX1<IgniteInternalFuture<GridCacheReturn>, Boolean>() {
@@ -2980,7 +2994,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
 
         return asyncOp(new AsyncInOp(m.keySet()) {
             @Override public IgniteInternalFuture<?> inOp(IgniteTxLocalAdapter tx)
{
-                return tx.putAllAsync(ctx, m, false, null, -1, filter);
+                return tx.putAllAsync(ctx, m, false, null, -1, filter).chain(RET2NULL);
             }
 
             @Override public String toString() {
@@ -3124,7 +3138,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
 
         IgniteInternalFuture<Object> fut = asyncOp(new AsyncInOp(keys) {
             @Override public IgniteInternalFuture<?> inOp(IgniteTxLocalAdapter tx)
{
-                return tx.removeAllAsync(ctx, keys, null, false, filter);
+                return tx.removeAllAsync(ctx, keys, null, false, filter).chain(RET2NULL);
             }
 
             @Override public String toString() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ca17be02/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index c5329d6..4474432 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -467,7 +467,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
             false,
             false,
             null,
-            filter);
+            filter).chain(RET2NULL);
     }
 
     /** {@inheritDoc} */
@@ -517,7 +517,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
         CacheEntryPredicate[] filter) {
         A.notNull(keys, "keys");
 
-        return removeAllAsync0(keys, null, false, false, filter);
+        return removeAllAsync0(keys, null, false, false, filter).chain(RET2NULL);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ca17be02/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index c32a8a2..f2648f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -345,7 +345,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
             null,
             false,
             false,
-            filter);
+            filter).chain(RET2NULL);
     }
 
     /** {@inheritDoc} */
@@ -398,7 +398,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
         CacheEntryPredicate[] filter) {
         ctx.denyOnLocalRead();
 
-        return removeAllAsync0(keys, false, false, filter);
+        return removeAllAsync0(keys, false, false, filter).chain(RET2NULL);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ca17be02/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 32ebe17..f25229d 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
@@ -1596,8 +1596,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
         IgniteFuture<?> f2 = cacheAsync.future();
 
-        f2.get();
-        f1.get();
+        assertNull(f2.get());
+        assertNull(f1.get());
 
         checkSize(F.asSet("key1", "key2"));
 
@@ -2496,7 +2496,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
         cacheAsync.removeAll(F.asSet("key1", "key2"));
 
-        cacheAsync.future().get();
+        assertNull(cacheAsync.future().get());
 
         checkSize(F.asSet("key3"));
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ca17be02/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSystemTransactionsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSystemTransactionsSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSystemTransactionsSelfTest.java
index ef13bba..4fcd001 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSystemTransactionsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSystemTransactionsSelfTest.java
@@ -180,7 +180,7 @@ public class IgniteCacheSystemTransactionsSelfTest extends GridCacheAbstractSelf
                         entry.lockedByAny());
 
                     assertEquals("Invalid entry value [g=" + g + ", cacheName=" + cacheName
+ ", entry=" + entry + ']',
-                        val, entry.rawGet());
+                        val, entry.rawGet().value(cache.context().cacheObjectContext(), false));
                 }
             }
         }


Mime
View raw message