ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [20/20] incubator-ignite git commit: # ignite-297
Date Wed, 18 Feb 2015 17:34:21 GMT
# ignite-297


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

Branch: refs/heads/ignite-297
Commit: aca9f9827ebe445039ac9eef7683215143fda8e8
Parents: 9c1bbc1
Author: sboikov <semen.boikov@inria.fr>
Authored: Wed Feb 18 20:27:35 2015 +0300
Committer: sboikov <semen.boikov@inria.fr>
Committed: Wed Feb 18 20:27:35 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      | 20 ++++++++++++++------
 .../distributed/dht/GridDhtCacheEntry.java      |  2 +-
 .../local/atomic/GridLocalAtomicCache.java      |  5 ++++-
 3 files changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aca9f982/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 ff3d573..1e3105a 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
@@ -650,11 +650,10 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
     @Override public IgniteInternalFuture<Boolean> containsKeyAsync(K key) {
         A.notNull(key, "key");
 
-        if (ctx.portableEnabled())
-            key = (K)ctx.marshalToPortable(key);
+        final K key0 = ctx.portableEnabled() ? (K)ctx.marshalToPortable(key) : key;
 
         return getAllAsync(
-            Collections.singletonList(key),
+            Collections.singletonList(key0),
             /*force primary*/false,
             /*skip tx*/false,
             /*entry*/null,
@@ -668,7 +667,10 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
 
                 assert map.isEmpty() || map.size() == 1 : map.size();
 
-                return map.isEmpty() ? false : map.values().iterator().next() != null;
+                if (ctx.portableEnabled())
+                    return map.isEmpty() ? false : map.values().iterator().next() != null;
+                else
+                    return map.get(key0) != null;
             }
         });
     }
@@ -5080,7 +5082,10 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
 
         assert map.isEmpty() || map.size() == 1 : map.size();
 
-        return map.isEmpty() ? null : map.values().iterator().next();
+        if (ctx.portableEnabled())
+            return map.isEmpty() ? null : map.values().iterator().next();
+        else
+            return map.get(key);
     }
 
     /**
@@ -5105,7 +5110,10 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
 
                     assert map.isEmpty() || map.size() == 1 : map.size();
 
-                    return map.isEmpty() ? null : map.values().iterator().next();
+                    if (ctx.portableEnabled())
+                        return map.isEmpty() ? null : map.values().iterator().next();
+                    else
+                        return map.get(key);
                 }
             });
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aca9f982/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
index 24c97cc..cf4f5df 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
@@ -403,7 +403,7 @@ public class GridDhtCacheEntry<K, V> extends GridDistributedCacheEntry<K,
V> {
 
                 ReaderId<K, V>[] rdrs = Arrays.copyOf(this.rdrs, this.rdrs.length +
1);
 
-                rdrs[rdrs.length] = reader;
+                rdrs[rdrs.length - 1] = reader;
 
                 // Seal.
                 this.rdrs = rdrs;

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


Mime
View raw message