ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [32/66] [abbrv] ignite git commit: IGNITE-950 - Fixed withKeepPortable flag.
Date Thu, 05 Nov 2015 03:28:24 GMT
IGNITE-950 - Fixed withKeepPortable flag.


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

Branch: refs/heads/ignite-1753-1282
Commit: 86e75ff3a531a3e967a8e9f1c8ab7a447b9c2c8d
Parents: 003435c
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Tue Nov 3 14:57:37 2015 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Tue Nov 3 14:57:37 2015 +0300

----------------------------------------------------------------------
 .../platform/cache/PlatformCache.java           |  2 +-
 .../cache/IgniteCachePeekModesAbstractTest.java | 30 ++++++++++++++------
 2 files changed, 22 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/86e75ff3/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
index 71bbc15..ecc33c2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
@@ -232,7 +232,7 @@ public class PlatformCache extends PlatformAbstractTarget {
         if (keepPortable)
             return this;
 
-        return new PlatformCache(platformCtx, cache.withSkipStore(), true);
+        return new PlatformCache(platformCtx, cache.withKeepBinary(), true);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/86e75ff3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
index 89610e7..056affc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
@@ -26,6 +26,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import javax.cache.Cache;
+import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.cache.CacheMemoryMode;
 import org.apache.ignite.cache.CachePeekMode;
@@ -35,6 +36,7 @@ import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.configuration.NearCacheConfiguration;
+import org.apache.ignite.internal.IgniteEx;
 import org.apache.ignite.internal.IgniteKernal;
 import org.apache.ignite.internal.util.typedef.T2;
 import org.apache.ignite.spi.IgniteSpiCloseableIterator;
@@ -260,16 +262,26 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
             for (Integer key : keys)
                 cache0.put(key, val);
 
-            SwapSpaceSpi swap = ignite(nodeIdx).configuration().getSwapSpaceSpi();
+            Ignite ignite = ignite(nodeIdx);
+
+            SwapSpaceSpi swap = ignite.configuration().getSwapSpaceSpi();
+
+            GridCacheAdapter<Integer, String> internalCache =
+                ((IgniteKernal)ignite).context().cache().internalCache();
+
+            CacheObjectContext coctx = internalCache.context().cacheObjectContext();
 
             Set<Integer> swapKeys = new HashSet<>();
 
-            IgniteSpiCloseableIterator<Integer> it = swap.keyIterator(SPACE_NAME, null);
+            IgniteSpiCloseableIterator<KeyCacheObject> it = swap.keyIterator(SPACE_NAME,
null);
 
             assertNotNull(it);
 
-            while (it.hasNext())
-                assertTrue(swapKeys.add(it.next()));
+            while (it.hasNext()) {
+                KeyCacheObject next = it.next();
+
+                assertTrue(swapKeys.add((Integer)next.value(coctx, false)));
+            }
 
             assertFalse(swapKeys.isEmpty());
 
@@ -277,9 +289,6 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
 
             Set<Integer> offheapKeys = new HashSet<>();
 
-            GridCacheAdapter<Integer, String> internalCache =
-                ((IgniteKernal)ignite(nodeIdx)).context().cache().internalCache();
-
             Iterator<Map.Entry<Integer, String>> offheapIt;
 
             if (internalCache.context().isNear())
@@ -645,7 +654,7 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
     private T2<List<Integer>, List<Integer>> swapKeys(int nodeIdx) {
         SwapSpaceSpi swap = ignite(nodeIdx).configuration().getSwapSpaceSpi();
 
-        IgniteSpiCloseableIterator<Integer> it = swap.keyIterator(SPACE_NAME, null);
+        IgniteSpiCloseableIterator<KeyCacheObject> it = swap.keyIterator(SPACE_NAME,
null);
 
         assertNotNull(it);
 
@@ -656,8 +665,11 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
         List<Integer> primary = new ArrayList<>();
         List<Integer> backups = new ArrayList<>();
 
+        CacheObjectContext coctx = ((IgniteEx)ignite(nodeIdx)).context().cache().internalCache()
+            .context().cacheObjectContext();
+
         while (it.hasNext()) {
-            Integer key = it.next();
+            Integer key = it.next().value(coctx, false);
 
             if (aff.isPrimary(node, key))
                 primary.add(key);


Mime
View raw message