ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [16/16] incubator-ignite git commit: # ignite-51
Date Wed, 04 Mar 2015 20:55:57 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/4f1568d7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4f1568d7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4f1568d7

Branch: refs/heads/ignite-51
Commit: 4f1568d75bd0e8182317b09b29016eeb1fec2f04
Parents: 9537359
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Mar 4 23:52:56 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Mar 4 23:54:30 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      | 37 +++-----------------
 .../local/atomic/GridLocalAtomicCache.java      |  5 +--
 2 files changed, 5 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f1568d7/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 c897477..44890f7 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
@@ -621,10 +621,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
     @Override public IgniteInternalFuture<Boolean> containsKeyAsync(K key) {
         A.notNull(key, "key");
 
-        final K key0 = ctx.portableEnabled() ? (K)ctx.marshalToPortable(key) : key;
-
         return getAllAsync(
-            Collections.singletonList(key0),
+            Collections.singletonList(key),
             /*force primary*/false,
             /*skip tx*/false,
             /*entry*/null,
@@ -638,10 +636,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
 
                 assert map.isEmpty() || map.size() == 1 : map.size();
 
-                if (ctx.portableEnabled())
-                    return map.isEmpty() ? false : map.values().iterator().next() != null;
-                else
-                    return map.get(key0) != null;
+                return map.isEmpty() ? false : map.values().iterator().next() != null;
             }
         });
     }
@@ -660,14 +655,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
     @Override public IgniteInternalFuture<Boolean> containsKeysAsync(Collection<?
extends K> keys) {
         A.notNull(keys, "keys");
 
-        if (ctx.portableEnabled() && !F.isEmpty(keys)) {
-            keys = F.viewReadOnly(keys, new C1<K, K>() {
-                @Override public K apply(K k) {
-                    return (K)ctx.marshalToPortable(k);
-                }
-            });
-        }
-
         return getAllAsync(
             keys,
             /*force primary*/false,
@@ -3687,12 +3674,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
                 if (ctx.deploymentEnabled())
                     ctx.deploy().registerClass(val);
 
-                K key0 = key;
-
-                if (ctx.portableEnabled())
-                    key0 = (K)ctx.marshalToPortable(key);
-
-                return tx.removeAllAsync(ctx, Collections.singletonList(key0), null, false,
+                return tx.removeAllAsync(ctx, Collections.singletonList(key), null, false,
                     ctx.equalsValArray(val)).get().success();
             }
 
@@ -3734,18 +3716,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
                     }
                 }
 
-                K key0 = key;
-
-                if (ctx.portableEnabled()) {
-                    try {
-                        key0 = (K)ctx.marshalToPortable(key);
-                    }
-                    catch (IgniteException e) {
-                        return new GridFinishedFuture<>(ctx.kernalContext(), e);
-                    }
-                }
-
-                return tx.removeAllAsync(ctx, Collections.singletonList(key0), null, false,
+                return tx.removeAllAsync(ctx, Collections.singletonList(key), null, false,
                     ctx.equalsValArray(val)).chain(
                     (IgniteClosure<IgniteInternalFuture<GridCacheReturn<CacheObject>>,
Boolean>)RET2FLAG);
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f1568d7/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 cffe3c2..130fbe4 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
@@ -500,10 +500,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
 
         assert m.isEmpty() || m.size() == 1 : m.size();
 
-        if (ctx.portableEnabled())
-            return m.isEmpty() ? null : m.values().iterator().next();
-        else
-            return m.get(key);
+        return m.isEmpty() ? null : m.values().iterator().next();
     }
 
     /** {@inheritDoc} */


Mime
View raw message