ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [4/5] ignite git commit: IGNITE-950 - WIP fixing tests.
Date Thu, 22 Oct 2015 10:31:16 GMT
IGNITE-950 - WIP fixing tests.


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

Branch: refs/heads/ignite-950-new
Commit: f812afd1ed0d38771213686744ff9d3926d3ab51
Parents: d5df41b
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Thu Oct 22 10:20:26 2015 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Thu Oct 22 10:20:26 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/CacheObjectContext.java |  2 +-
 .../internal/processors/cache/GridCacheAdapter.java   |  4 +---
 .../internal/processors/cache/GridCacheMapEntry.java  | 14 ++++++++++----
 .../cache/local/atomic/GridLocalAtomicCache.java      |  8 ++++++--
 4 files changed, 18 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f812afd1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
index e7e081b..a69ee70 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
@@ -222,7 +222,7 @@ public class CacheObjectContext {
             CacheObject co = (CacheObject)o;
 
             if (!keepPortable || co.isPlatformType())
-                return unwrapPortable(co.value(this, false), keepPortable);
+                return unwrapPortable(co.value(this, true), keepPortable);
         }
 
         return o;

http://git-wip-us.apache.org/repos/asf/ignite/blob/f812afd1/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 ae987b7..11bc9a7 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
@@ -811,9 +811,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K,
V
             else
                 cacheVal = localCachePeek0(cacheKey, modes.heap, modes.offheap, modes.swap,
plc);
 
-            Object val = CU.value(cacheVal, ctx, true);
-
-            val = ctx.unwrapPortableIfNeeded(val, ctx.keepPortable());
+            Object val = ctx.unwrapPortableIfNeeded(cacheVal, ctx.keepPortable());
 
             return (V)val;
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/f812afd1/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 c45fed8..6546d76 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
@@ -3620,7 +3620,9 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
 
     /** {@inheritDoc} */
     @Override public <K, V> Cache.Entry<K, V> wrapLazyValue() {
-        return new LazyValueEntry<>(key);
+        CacheOperationContext opCtx = cctx.operationContextPerCall();
+
+        return new LazyValueEntry<>(key, opCtx != null && opCtx.isKeepPortable());
     }
 
     /** {@inheritDoc} */
@@ -4089,22 +4091,26 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
         /** */
         private final KeyCacheObject key;
 
+        /** */
+        private boolean keepBinary;
+
         /**
          * @param key Key.
          */
-        private LazyValueEntry(KeyCacheObject key) {
+        private LazyValueEntry(KeyCacheObject key, boolean keepBinary) {
             this.key = key;
+            this.keepBinary = keepBinary;
         }
 
         /** {@inheritDoc} */
         @Override public K getKey() {
-            return key.value(cctx.cacheObjectContext(), false);
+            return (K)cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepBinary);
         }
 
         /** {@inheritDoc} */
         @SuppressWarnings("unchecked")
         @Override public V getValue() {
-            return CU.value(peekVisibleValue(), cctx, true);
+            return (V)cctx.cacheObjectContext().unwrapPortableIfNeeded(peekVisibleValue(),
keepBinary);
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/f812afd1/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 ebeb3ef..bf0bb00 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
@@ -165,6 +165,8 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
 
         long start = statsEnabled ? System.nanoTime() : 0L;
 
+        CacheOperationContext opCtx = ctx.operationContextPerCall();
+
         boolean res = (Boolean)updateAllInternal(UPDATE,
             Collections.singleton(key),
             Collections.singleton(val),
@@ -175,7 +177,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
             filter,
             ctx.writeThrough(),
             ctx.readThrough(),
-            ctx.operationContextPerCall().isKeepPortable());
+            opCtx != null && opCtx.isKeepPortable());
 
         if (statsEnabled)
             metrics0().addPutTimeNanos(System.nanoTime() - start);
@@ -404,6 +406,8 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
 
         A.notNull(key, "key");
 
+        CacheOperationContext opCtx = ctx.operationContextPerCall();
+
         Boolean rmv = (Boolean)updateAllInternal(DELETE,
             Collections.singleton(key),
             null,
@@ -414,7 +418,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
             CU.empty0(),
             ctx.writeThrough(),
             ctx.readThrough(),
-            ctx.operationContextPerCall().isKeepPortable());
+            opCtx != null && opCtx.isKeepPortable());
 
         if (statsEnabled && rmv)
             metrics0().addRemoveTimeNanos(System.nanoTime() - start);


Mime
View raw message