ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [07/50] [abbrv] incubator-ignite git commit: #gg-9828: GridCacheMapEntry should use EntryProcessor.
Date Thu, 12 Mar 2015 15:16:08 GMT
#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/01bc45dd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/01bc45dd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/01bc45dd

Branch: refs/heads/ignite-443
Commit: 01bc45dd201b2d7962be8e02443052380629f944
Parents: 2a6536d
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Tue Mar 10 19:49:27 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Tue Mar 10 19:49:27 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java      | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/01bc45dd/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 beddc37..d701d50 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
@@ -1622,14 +1622,23 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
 
                         EntryProcessor<K, V, ?> entryProcessor = (EntryProcessor<K,
V, ?>) writeObj;
 
-                        Object computed = entryProcessor.process(entry, invokeArgs);
+                        try {
+                            Object computed = entryProcessor.process(entry, invokeArgs);
 
-                        writeObj = cctx.unwrapTemporary(entry.getValue());
+                            writeObj = cctx.unwrapTemporary(entry.getValue());
 
-                        if (computed != null)
-                            invokeRes = new CacheInvokeResult<>(cctx.unwrapTemporary(computed));
+                            if (computed != null)
+                                invokeRes = new CacheInvokeResult<>(cctx.unwrapTemporary(computed));
 
-                        valBytes = null;
+                            valBytes = null;
+                        }
+                        catch (Exception e) {
+                            invokeRes = new CacheInvokeResult<>(e);
+
+                            writeObj = oldVal;
+
+                            valBytes = null;
+                        }
                     }
 
                     GridTuple3<Long, Long, Boolean> expiration = ttlAndExpireTime(expiryPlc,
explicitTtl,


Mime
View raw message