ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject incubator-ignite git commit: IGNITE-96 - Fixed filter evaluation.
Date Sun, 08 Feb 2015 06:04:33 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-96 448731851 -> b00461f96


IGNITE-96 - Fixed filter evaluation.


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

Branch: refs/heads/ignite-96
Commit: b00461f9669373a8a8f9013a6a2636e461b0a254
Parents: 4487318
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Sat Feb 7 22:04:24 2015 -0800
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Sat Feb 7 22:04:24 2015 -0800

----------------------------------------------------------------------
 .../internal/processors/cache/GridCacheMapEntry.java     | 11 +++++++----
 .../cache/transactions/IgniteTxLocalAdapter.java         |  2 +-
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b00461f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index b64dc36..2312764 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -3693,17 +3693,17 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
     }
 
     /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
     @Override public Cache.Entry<K, V> wrap() {
         try {
-            IgniteInternalTx tx = cctx.tm().userTx();
+            IgniteInternalTx<K, V> tx = cctx.tm().userTx();
 
             V val;
 
             if (tx != null) {
-                val = (V)tx.writeMap().get(txKey());
+                GridTuple<V> peek = tx.peek(cctx, false, key, null);
 
-                if (val == null)
-                    val = (V)tx.readMap().get(txKey());
+                val = peek == null ? rawGetOrUnmarshal(false) : peek.get();
             }
             else
                 val = rawGetOrUnmarshal(false);
@@ -3714,6 +3714,9 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
 
             return entry;
         }
+        catch (GridCacheFilterFailedException ignored) {
+            throw new IgniteException("Should never happen.");
+        }
         catch (IgniteCheckedException e) {
             throw new IgniteException("Failed to wrap entry: " + this, e);
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b00461f9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index b2a7da4..b3d5beb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -296,7 +296,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K,
V>
             // We should look at tx entry previous value. If this is a user peek then previous
             // value is the same as value. If this is a filter evaluation peek then previous
value holds
             // value visible to filter while value contains value enlisted for write.
-            if (!F.isAll(e.cached().wrap(), filter))
+            if (!F.isEmpty(filter) && !F.isAll(e.cached().wrap(), filter))
                 return e.hasPreviousValue() ? F.t(CU.<V>failed(failFast, e.previousValue()))
: null;
 
             return e.hasPreviousValue() ? F.t(e.previousValue()) : null;


Mime
View raw message