# ignite-58
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c102312d Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c102312d Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c102312d Branch: refs/heads/ignite-sql-tests Commit: c102312ddae32275feea71222cf66c24a4c713b0 Parents: cc64610 Author: sboikov <sboi...@gridgain.com> Authored: Thu Feb 5 11:31:34 2015 +0300 Committer: sboikov <sboi...@gridgain.com> Committed: Thu Feb 5 11:31:34 2015 +0300 ---------------------------------------------------------------------- .../processors/cache/GridCacheSwapManager.java | 7 ++++ .../cache/IgniteCachePeekAbstractTest.java | 38 ++++++++++++++++++++ 2 files changed, 45 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c102312d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java index 6a42b8c..a0b1ecb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java @@ -424,7 +424,10 @@ public class GridCacheSwapManager<K, V> extends GridCacheManagerAdapter<K, V> { /** * @param key Key to read. * @param keyBytes Key bytes. + * @param part Key partition. * @param entryLocked {@code True} if cache entry is locked. + * @param readOffheap Read offheap flag. + * @param readSwap Read swap flag. * @return Value from swap or {@code null}. * @throws IgniteCheckedException If failed. */ @@ -593,6 +596,8 @@ public class GridCacheSwapManager<K, V> extends GridCacheManagerAdapter<K, V> { /** * @param entry Entry to read. * @param locked {@code True} if cache entry is locked. + * @param readOffheap Read offheap flag. + * @param readSwap Read swap flag. * @return Read value. * @throws IgniteCheckedException If read failed. */ @@ -642,6 +647,8 @@ public class GridCacheSwapManager<K, V> extends GridCacheManagerAdapter<K, V> { /** * @param key Key to read swap entry for. + * @param readOffheap Read offheap flag. + * @param readSwap Read swap flag. * @return Read value. * @throws IgniteCheckedException If read failed. */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c102312d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekAbstractTest.java index 33e4cd6..006cb8b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekAbstractTest.java @@ -269,6 +269,20 @@ public abstract class IgniteCachePeekAbstractTest extends IgniteCacheAbstractTes for (Integer key : swapKeys) { assertEquals(val, cache0.localPeek(key, SWAP)); + assertEquals(val, cache0.localPeek(key, PRIMARY, SWAP)); + assertEquals(val, cache0.localPeek(key, ONHEAP, SWAP)); + assertEquals(val, cache0.localPeek(key, ONHEAP, OFFHEAP, SWAP)); + assertEquals(val, cache0.localPeek(key, PRIMARY, ONHEAP, SWAP)); + assertEquals(val, cache0.localPeek(key, PRIMARY, ONHEAP, OFFHEAP, SWAP)); + + if (cacheMode() == LOCAL) { + assertEquals(val, cache0.localPeek(key, SWAP, BACKUP)); + assertEquals(val, cache0.localPeek(key, SWAP, NEAR)); + } + else { + assertNull(cache0.localPeek(key, SWAP, BACKUP)); + assertNull(cache0.localPeek(key, SWAP, NEAR)); + } assertNull(cache0.localPeek(key, ONHEAP)); assertNull(cache0.localPeek(key, OFFHEAP)); @@ -276,6 +290,18 @@ public abstract class IgniteCachePeekAbstractTest extends IgniteCacheAbstractTes for (Integer key : offheapKeys) { assertEquals(val, cache0.localPeek(key, OFFHEAP)); + assertEquals(val, cache0.localPeek(key, ONHEAP, OFFHEAP)); + assertEquals(val, cache0.localPeek(key, ONHEAP, SWAP, OFFHEAP)); + assertEquals(val, cache0.localPeek(key, PRIMARY, OFFHEAP)); + + if (cacheMode() == LOCAL) { + assertEquals(val, cache0.localPeek(key, OFFHEAP, BACKUP)); + assertEquals(val, cache0.localPeek(key, OFFHEAP, NEAR)); + } + else { + assertNull(cache0.localPeek(key, OFFHEAP, BACKUP)); + assertNull(cache0.localPeek(key, OFFHEAP, NEAR)); + } assertNull(cache0.localPeek(key, ONHEAP)); assertNull(cache0.localPeek(key, SWAP)); @@ -283,6 +309,18 @@ public abstract class IgniteCachePeekAbstractTest extends IgniteCacheAbstractTes for (Integer key : heapKeys) { assertEquals(val, cache0.localPeek(key, ONHEAP)); + assertEquals(val, cache0.localPeek(key, SWAP, ONHEAP)); + assertEquals(val, cache0.localPeek(key, SWAP, OFFHEAP, ONHEAP)); + assertEquals(val, cache0.localPeek(key, PRIMARY, ONHEAP)); + + if (cacheMode() == LOCAL) { + assertEquals(val, cache0.localPeek(key, ONHEAP, BACKUP)); + assertEquals(val, cache0.localPeek(key, ONHEAP, NEAR)); + } + else { + assertNull(cache0.localPeek(key, ONHEAP, BACKUP)); + assertNull(cache0.localPeek(key, ONHEAP, NEAR)); + } assertNull(cache0.localPeek(key, SWAP)); assertNull(cache0.localPeek(key, OFFHEAP));