ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: #gg-9828: GridCacheMapEntry should use EntryProcessor.
Date Tue, 10 Mar 2015 16:43:21 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-gg-9828 [created] 2a6536d01


#gg-9828: GridCacheMapEntry should use EntryProcessor.


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

Branch: refs/heads/ignite-gg-9828
Commit: 2a6536d01725d6c4a833d1b0a3ac0b5d909d4d2a
Parents: 6b7dcb8
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Tue Mar 10 19:43:15 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Tue Mar 10 19:43:15 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/GridCacheMapEntry.java  | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2a6536d0/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 c13d199..beddc37 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
@@ -1616,7 +1616,19 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
                     if (op == GridCacheOperation.TRANSFORM) {
                         transformClo = writeObj;
 
-                        writeObj = ((IgniteClosure<V, V>)writeObj).apply(rawGetOrUnmarshalUnlocked(true));
+                        oldVal = rawGetOrUnmarshalUnlocked(true);
+
+                        CacheInvokeEntry<K, V> entry = new CacheInvokeEntry(cctx, key,
oldVal);
+
+                        EntryProcessor<K, V, ?> entryProcessor = (EntryProcessor<K,
V, ?>) writeObj;
+
+                        Object computed = entryProcessor.process(entry, invokeArgs);
+
+                        writeObj = cctx.unwrapTemporary(entry.getValue());
+
+                        if (computed != null)
+                            invokeRes = new CacheInvokeResult<>(cctx.unwrapTemporary(computed));
+
                         valBytes = null;
                     }
 


Mime
View raw message