ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [19/24] ignite git commit: ignite-1282 - Fixing tests.
Date Thu, 26 Nov 2015 09:30:28 GMT
ignite-1282 - Fixing tests.


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

Branch: refs/heads/ignite-1.5
Commit: 809a44260d10fb394767ebb1df66857c22cc8cbd
Parents: 9c1b765
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Wed Nov 25 15:16:23 2015 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Wed Nov 25 15:16:23 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/cache/CacheTypeMetadata.java  |  2 ++
 .../processors/cache/GridCacheEventManager.java | 38 ++++++++++++++++++--
 2 files changed, 37 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/809a4426/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
index 2b7205b..76dea6a 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
@@ -33,7 +33,9 @@ import org.apache.ignite.lang.IgniteBiTuple;
 
 /**
  * Cache type metadata need for configuration of indexes or automatic persistence.
+ * @deprecated Use {@link org.apache.ignite.cache.QueryEntity} instead.
  */
+@Deprecated
 public class CacheTypeMetadata implements Serializable {
     /** */
     private static final long serialVersionUID = 0L;

http://git-wip-us.apache.org/repos/asf/ignite/blob/809a4426/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
index afca43b..7ff3a99 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
@@ -39,6 +39,9 @@ import static org.apache.ignite.events.EventType.EVT_CACHE_STOPPED;
  * Cache event manager.
  */
 public class GridCacheEventManager extends GridCacheManagerAdapter {
+    /** Force keep binary flag. Will be set if event notification encountered exception during
unmarshalling. */
+    private boolean forceKeepBinary;
+
     /**
      * Adds local event listener.
      *
@@ -262,6 +265,35 @@ public class GridCacheEventManager extends GridCacheManagerAdapter {
                     "(try to increase topology history size configuration property of configured
" +
                     "discovery SPI): " + evtNodeId);
 
+            keepPortable = keepPortable || forceKeepBinary;
+
+            Object key0;
+            Object val0;
+            Object oldVal0;
+
+            try {
+                key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable,
false);
+                val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, keepPortable,
false);
+                oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, keepPortable,
false);
+            }
+            catch (Exception e) {
+                if (!cctx.cacheObjectContext().processor().isPortableEnabled(cctx.config()))
+                    throw e;
+
+                if (log.isDebugEnabled())
+                    log.debug("Failed to unmarshall cache object value for the event notification:
" + e);
+
+                if (!forceKeepBinary)
+                    LT.warn(log, null, "Failed to unmarshall cache object value for the event
notification " +
+                        "(all further notifications will keep binary object format).");
+
+                forceKeepBinary = true;
+
+                key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, true, false);
+                val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, true, false);
+                oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, true,
false);
+            }
+
             cctx.gridEvents().record(new CacheEvent(cctx.name(),
                 cctx.localNode(),
                 evtNode,
@@ -269,12 +301,12 @@ public class GridCacheEventManager extends GridCacheManagerAdapter {
                 type,
                 part,
                 cctx.isNear(),
-                cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false),
+                key0,
                 xid,
                 lockId,
-                cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, keepPortable, false),
+                val0,
                 hasNewVal,
-                cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, keepPortable, false),
+                oldVal0,
                 hasOldVal,
                 subjId,
                 cloClsName,


Mime
View raw message