ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: ignite-645 Remove GridCachePeekMode
Date Tue, 31 Mar 2015 11:17:18 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-645 fd4c54a67 -> 2cd7c86cd


ignite-645 Remove GridCachePeekMode


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

Branch: refs/heads/ignite-645
Commit: 2cd7c86cd6213e756f2be9c42ec394e120bc672c
Parents: fd4c54a
Author: Andrey Gura <agura@gridgain.com>
Authored: Tue Mar 31 14:16:43 2015 +0300
Committer: Andrey Gura <agura@gridgain.com>
Committed: Tue Mar 31 14:16:43 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/CacheProjection.java       | 20 +----
 .../processors/cache/GridCacheAdapter.java      |  5 --
 .../cache/GridCacheProjectionImpl.java          | 13 +--
 .../processors/cache/GridCacheProxyImpl.java    | 12 ---
 .../distributed/dht/GridDhtCacheAdapter.java    |  9 +-
 .../dht/atomic/GridDhtAtomicCache.java          |  9 +-
 .../dht/colocated/GridDhtColocatedCache.java    |  8 +-
 .../distributed/near/GridNearCacheAdapter.java  |  6 +-
 .../processors/task/GridTaskProcessor.java      |  9 +-
 ...GridCacheDhtEvictionNearReadersSelfTest.java | 14 +--
 .../dht/GridCacheDhtEvictionSelfTest.java       | 24 ++---
 .../dht/GridCacheDhtMappingSelfTest.java        |  2 +-
 .../near/GridCacheNearMultiNodeSelfTest.java    | 50 +++++------
 .../near/GridCacheNearOneNodeSelfTest.java      | 25 ++----
 .../near/GridCacheNearReadersSelfTest.java      | 92 +++++++-------------
 .../processors/igfs/IgfsProcessorSelfTest.java  |  3 +-
 .../processors/igfs/IgfsSizeSelfTest.java       | 46 +---------
 .../junits/common/GridCommonAbstractTest.java   | 42 +++++++++
 .../cache/GridIndexingWithNoopSwapSelfTest.java |  2 +-
 19 files changed, 174 insertions(+), 217 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
index 558f8af..9d27366 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
@@ -377,23 +377,6 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> {
     public IgniteInternalFuture<V> reloadAsync(K key);
 
     /**
-     * Peeks at in-memory cached value using default {@link GridCachePeekMode#SMART}
-     * peek mode.
-     * <p>
-     * This method will not load value from any persistent store or from a remote node.
-     * <h2 class="header">Transactions</h2>
-     * This method does not participate in any transactions, however, it will
-     * peek at transactional value according to the {@link GridCachePeekMode#SMART} mode
-     * semantics. If you need to look at global cached value even from within transaction,
-     * you can use {@link GridCache#peek(Object, Collection)} method.
-     *
-     * @param key Entry key.
-     * @return Peeked value.
-     * @throws NullPointerException If key is {@code null}.
-     */
-    @Nullable public V peek(K key);
-
-    /**
      * @param key Key.
      * @param peekModes Peek modes.
      * @param plc Expiry policy if TTL should be updated.
@@ -415,8 +398,7 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> {
      * iterate over given peek modes in the order passed in, and try to peek at value using
      * each peek mode. Once a {@code non-null} value is found, it will be immediately returned.
      * <p>
-     * Note that if modes are not provided this method works exactly the same way as
-     * {@link #peek(Object)}, implicitly using {@link GridCachePeekMode#SMART} mode.
+     * Note that if modes are not provided this method works implicitly using {@link GridCachePeekMode#SMART} mode.
      * <h2 class="header">Transactions</h2>
      * This method does not participate in any transactions, however, it may
      * peek at transactional value depending on the peek modes used.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/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 b7cf2fd..acc4254 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
@@ -887,11 +887,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
     }
 
     /** {@inheritDoc} */
-    @Override public V peek(K key) {
-        return peek(key, (CacheEntryPredicate)null);
-    }
-
-    /** {@inheritDoc} */
     @Override public V peek(K key, @Nullable Collection<GridCachePeekMode> modes) throws IgniteCheckedException {
         return peek0(key, modes, ctx.tm().localTxx());
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
index 4ab187d..ceed8ce 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
@@ -813,11 +813,6 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V
     }
 
     /** {@inheritDoc} */
-    @Override public V peek(K key) {
-        return cache.peek(key, filter);
-    }
-
-    /** {@inheritDoc} */
     @Nullable @Override public V localPeek(K key,
         CachePeekMode[] peekModes,
         @Nullable IgniteCacheExpiryPolicy plc)
@@ -840,7 +835,13 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V
 
     /** {@inheritDoc} */
     @Nullable @Override public Cache.Entry<K, V> entry(K key) {
-        V val = peek(key);
+        V val;
+        try {
+            val = localPeek(key, new CachePeekMode[] {CachePeekMode.ONHEAP}, null);
+        }
+        catch (IgniteCheckedException e) {
+            throw new IgniteException(e);
+        }
 
         if (!isAll(key, val))
             return null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index 1c25ef0..e221b31 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -1140,18 +1140,6 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public V peek(K key) {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return delegate.peek(key);
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
     @Nullable @Override public V localPeek(K key,
         CachePeekMode[] peekModes,
         @Nullable IgniteCacheExpiryPolicy plc)

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index 4d90f89..03aa547 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.processors.cache.distributed.dht;
 
 import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.affinity.*;
@@ -874,8 +875,12 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
 
             Cache.Entry<K, V> entry = (Cache.Entry<K, V>)o;
 
-            return partId == ctx.affinity().partition(entry.getKey()) &&
-                F.eq(entry.getValue(), peek(entry.getKey()));
+            try {
+                return partId == ctx.affinity().partition(entry.getKey()) &&
+                    F.eq(entry.getValue(), localPeek(entry.getKey(), new CachePeekMode[] {CachePeekMode.ONHEAP}, null));
+            } catch (IgniteCheckedException e) {
+                throw new IgniteException(e);
+            }
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index cf317a5..1c82d07 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.processors.cache.distributed.dht.atomic;
 
 import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.cluster.*;
@@ -254,7 +255,11 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
 
     /** {@inheritDoc} */
     @Override public Cache.Entry<K, V> entry(K key) throws GridDhtInvalidPartitionException {
-        return new CacheEntryImpl<>(key, peek(key));
+        try {
+            return new CacheEntryImpl<>(key, localPeek(key, new CachePeekMode[] {CachePeekMode.ONHEAP}, null));
+        } catch (IgniteCheckedException e) {
+            throw new IgniteException(e);
+        }
     }
 
     /** {@inheritDoc} */
@@ -1794,8 +1799,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                 if (hasNear) {
                     if (primary && updRes.sendToDht()) {
                         if (!ctx.affinity().belongs(node, entry.partition(), topVer)) {
-                            GridCacheVersionConflictContext ctx = updRes.conflictResolveResult();
-
                             // If put the same value as in request then do not need to send it back.
                             if (op == TRANSFORM || writeVal != updRes.newValue()) {
                                 res.addNearValue(i,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
index cdf1638..4637792 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.processors.cache.distributed.dht.colocated;
 
 import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.affinity.*;
@@ -412,7 +413,12 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
 
     /** {@inheritDoc} */
     @Override public Cache.Entry<K, V> entry(K key) throws GridDhtInvalidPartitionException {
-        return new CacheEntryImpl<>(key, peek(key));
+        try {
+            return new CacheEntryImpl<>(key, localPeek(key, new CachePeekMode[] {CachePeekMode.ONHEAP}, null));
+        }
+        catch (IgniteCheckedException e) {
+            throw new IgniteException(e);
+        }
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index 2b5d4de..3376af3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@ -444,7 +444,11 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
     @Override public Cache.Entry<K, V> entry(K key) {
         // We don't try wrap entry from near or dht cache.
         // Created object will be wrapped once some method is called.
-        return new CacheEntryImpl<>(key, peek(key));
+        try {
+            return new CacheEntryImpl<>(key, localPeek(key, new CachePeekMode[] {CachePeekMode.ONHEAP}, null));
+        } catch (IgniteCheckedException e) {
+            throw new IgniteException(e);
+        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
index 9eac084..4add987 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.processors.task;
 
 import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.compute.*;
 import org.apache.ignite.events.*;
@@ -343,7 +344,13 @@ public class GridTaskProcessor extends GridProcessorAdapter {
 
         assert ctx.security().enabled();
 
-        return tasksMetaCache.peek(new GridTaskNameHashKey(taskNameHash));
+        try {
+            return tasksMetaCache.localPeek(
+                new GridTaskNameHashKey(taskNameHash), new CachePeekMode[] {CachePeekMode.ONHEAP}, null);
+        }
+        catch (IgniteCheckedException e) {
+            throw new IgniteException(e);
+        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
index cf1882a..99b95ce 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
@@ -256,7 +256,7 @@ public class GridCacheDhtEvictionNearReadersSelfTest extends GridCommonAbstractT
         assert entryPrimary != null;
         assert entryBackup != null;
 
-        assertEquals(val, nearOther.peek(key));
+        assertEquals(val, localPeek(nearOther, key));
 
         assertTrue(!entryPrimary.readers().isEmpty());
 
@@ -268,13 +268,13 @@ public class GridCacheDhtEvictionNearReadersSelfTest extends GridCommonAbstractT
         futBackup.get(3000);
         futPrimary.get(3000);
 
-        assertNull(dhtPrimary.peek(key));
-        assertNull(nearPrimary.peek(key));
+        assertNull(localPeek(dhtPrimary, key));
+        assertNull(localPeek(nearPrimary, key));
 
-        assertNull(dhtBackup.peek(key));
-        assertNull(nearBackup.peek(key));
+        assertNull(localPeek(dhtBackup, key));
+        assertNull(localPeek(nearBackup, key));
 
-        assertNull(dhtOther.peek(key));
-        assertNull(nearOther.peek(key));
+        assertNull(localPeek(dhtOther, key));
+        assertNull(localPeek(nearOther, key));
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
index 3b16864..39ef872 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java
@@ -210,11 +210,11 @@ public class GridCacheDhtEvictionSelfTest extends GridCommonAbstractTest {
         // Put on primary node.
         nearPrimary.put(key, val, null);
 
-        assertEquals(val, nearPrimary.peek(key));
-        assertEquals(val, dhtPrimary.peek(key));
+        assertEquals(val, localPeek(nearPrimary, key));
+        assertEquals(val, localPeek(dhtPrimary, key));
 
-        assertEquals(val, nearBackup.peek(key));
-        assertEquals(val, dhtBackup.peek(key));
+        assertEquals(val, localPeek(nearBackup, key));
+        assertEquals(val, localPeek(dhtBackup, key));
 
         GridDhtCacheEntry entryPrimary = (GridDhtCacheEntry)dhtPrimary.peekEx(key);
         GridDhtCacheEntry entryBackup = (GridDhtCacheEntry)dhtBackup.peekEx(key);
@@ -281,11 +281,11 @@ public class GridCacheDhtEvictionSelfTest extends GridCommonAbstractTest {
         for (Integer key : keys) {
             String val = "v" + key;
 
-            assertEquals(val, nearPrimary.peek(key));
-            assertEquals(val, dhtPrimary.peek(key));
+            assertEquals(val, localPeek(nearPrimary, key));
+            assertEquals(val, localPeek(dhtPrimary, key));
 
-            assertEquals(val, nearBackup.peek(key));
-            assertEquals(val, dhtBackup.peek(key));
+            assertEquals(val, localPeek(nearBackup, key));
+            assertEquals(val, localPeek(dhtBackup, key));
         }
 
         final AtomicInteger cntBackup = new AtomicInteger();
@@ -324,8 +324,8 @@ public class GridCacheDhtEvictionSelfTest extends GridCommonAbstractTest {
         for (Integer key : keys) {
             String msg = "Failed key: " + key;
 
-            assertNull(msg, nearBackup.peek(key));
-            assertNull(msg, dhtBackup.peek(key));
+            assertNull(msg, localPeek(nearBackup, key));
+            assertNull(msg, localPeek(dhtBackup, key));
             assertNull(msg, nearBackup.peekEx(key));
             assertNull(msg, dhtBackup.peekEx(key));
         }
@@ -333,8 +333,8 @@ public class GridCacheDhtEvictionSelfTest extends GridCommonAbstractTest {
         for (Integer key : keys) {
             String msg = "Failed key: " + key;
 
-            assertNull(msg, nearPrimary.peek(key));
-            assertNull(msg, dhtPrimary.peek(key));
+            assertNull(msg, localPeek(nearPrimary, key));
+            assertNull(msg, localPeek(dhtPrimary, key));
             assertNull(msg, nearPrimary.peekEx(key));
             assertNull(dhtPrimary.peekEx(key));
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtMappingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtMappingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtMappingSelfTest.java
index 682a321..bf8a27b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtMappingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtMappingSelfTest.java
@@ -90,7 +90,7 @@ public class GridCacheDhtMappingSelfTest extends GridCommonAbstractTest {
             GridDhtCacheAdapter<Integer, Integer> dht = ((GridNearCacheAdapter<Integer, Integer>)
                 ((IgniteKernal)g).<Integer, Integer>internalCache()).dht();
 
-            if (dht.peek(kv) != null) {
+            if (localPeek(dht, kv) != null) {
                 info("Key found on node: " + g.cluster().localNode().id());
 
                 cnt++;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
index 7774076..8a9816d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java
@@ -382,7 +382,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
                 if (entry != null)
                     assertNull("Unexpected entry: " + entry, entry.rawGetOrUnmarshal(false));
 
-                assertNotNull(dht(primaryGrid(3)).peek(3));
+                assertNotNull(localPeek(dht(primaryGrid(3)), 3));
 
                 tx.commit();
             }
@@ -399,8 +399,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
         assertEquals("2", near.localPeek(2, CachePeekMode.ONHEAP));
         assertEquals("3", near.localPeek(3, CachePeekMode.ONHEAP));
 
-        assertEquals("2", dht(primaryGrid(2)).peek(2));
-        assertEquals("3", dht(primaryGrid(3)).peek(3));
+        assertEquals("2", localPeek(dht(primaryGrid(2)), 2));
+        assertEquals("3", localPeek(dht(primaryGrid(3)), 3));
 
         assertEquals(2, near.localSize());
         assertEquals(2, near.localSize());
@@ -415,7 +415,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
         assertEquals("2", near.localPeek(2, CachePeekMode.ONHEAP));
         assertEquals("2", near.get(2));
 
-        assertEquals("2", dht(primaryGrid(2)).peek(2));
+        assertEquals("2", localPeek(dht(primaryGrid(2)), 2));
 
         assertEquals(1, near.localSize());
         assertEquals(1, near.localSize());
@@ -444,7 +444,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
 
         info("Primary grid for key 3: " + U.toShortString(primaryIgnite.cluster().localNode()));
 
-        assertEquals("3", dht(primaryIgnite).peek(3));
+        assertEquals("3", localPeek(dht(primaryIgnite), 3));
 
         assertEquals(1, near.localSize());
         assertEquals(1, near.localSize());
@@ -459,7 +459,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
         for (Ignite b : backups) {
             info("Backup grid for key 3: " + U.toShortString(b.cluster().localNode()));
 
-            assertEquals("3", dht(b).peek(3));
+            assertEquals("3", localPeek(dht(b), 3));
 
             assertEquals(1, dht(b).size());
         }
@@ -482,8 +482,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
         assertEquals("2", near.get(2));
         assertEquals("3", near.get(3));
 
-        assertEquals("2", dht(primaryGrid(2)).peek(2));
-        assertEquals("3", dht(primaryGrid(3)).peek(3));
+        assertEquals("2", localPeek(dht(primaryGrid(2)), 2));
+        assertEquals("3", localPeek(dht(primaryGrid(3)), 3));
 
         assertEquals(2, near.localSize());
         assertEquals(2, near.localSize());
@@ -526,8 +526,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
         assertEquals("2", near.localPeek(2, CachePeekMode.ONHEAP));
         assertEquals("3", near.localPeek(3, CachePeekMode.ONHEAP));
 
-        assertEquals("2", dht(primaryGrid(2)).peek(2));
-        assertEquals("3", dht(primaryGrid(3)).peek(3));
+        assertEquals("2", localPeek(dht(primaryGrid(2)), 2));
+        assertEquals("3", localPeek(dht(primaryGrid(3)), 3));
 
         assertEquals(2, near.localSize());
         assertEquals(2, near.localSize());
@@ -594,8 +594,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
         assertNull(near0.peekNearOnly(key));
         assertNull(near1.peekNearOnly(key));
 
-        assertEquals(val, dht0.peek(key));
-        assertEquals(val, dht1.peek(key));
+        assertEquals(val, localPeek(dht0, key));
+        assertEquals(val, localPeek(dht1, key));
     }
 
     /** @throws Exception If failed. */
@@ -678,8 +678,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
             assertTrue("Invalid near entry [hash=" + nearEntry2, nearEntry2.valid(topVer));
 
             assertEquals(val, cache.localPeek(key, CachePeekMode.ONHEAP));
-            assertEquals(val, dht(0).peek(key));
-            assertEquals(val, dht(1).peek(key));
+            assertEquals(val, dhtPeek(0, key));
+            assertEquals(val, dhtPeek(1, key));
 
             GridNearCacheEntry nearEntry3 = nearEntry(0, key);
 
@@ -697,7 +697,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
             assertEquals(val, cache.getAndRemove(key));
 
             assertNull(cache.localPeek(key, CachePeekMode.ONHEAP));
-            assertNull(dht(primaryGrid(key)).peek(key));
+            assertNull(localPeek(dht(primaryGrid(key)), key));
 
             assertTrue(cache.isLocalLocked(key, false));
             assertTrue(cache.isLocalLocked(key, true));
@@ -743,7 +743,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
             near.put(key, val);
 
             assertEquals(val, near.localPeek(key, CachePeekMode.ONHEAP));
-            assertEquals(val, dht(primaryGrid(key)).peek(key));
+            assertEquals(val, localPeek(dht(primaryGrid(key)), key));
 
             assertTrue(near.isLocalLocked(key, false));
             assertTrue(near.isLocalLocked(key, true));
@@ -755,7 +755,7 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
                 assertEquals(val, near.getAndRemove(key));
 
                 assertNull(near.localPeek(key, CachePeekMode.ONHEAP));
-                assertNull(dht(primaryGrid(key)).peek(key));
+                assertNull(localPeek(dht(primaryGrid(key)), key));
 
                 assertTrue(near.isLocalLocked(key, false));
                 assertTrue(near.isLocalLocked(key, true));
@@ -801,8 +801,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
 
         cache.put(key, val);
 
-        assertEquals(val, dht(0).peek(key));
-        assertEquals(val, dht(1).peek(key));
+        assertEquals(val, dhtPeek(0, key));
+        assertEquals(val, dhtPeek(1, key));
 
         assertNull(near(0).peekNearOnly(key));
         assertNull(near(1).peekNearOnly(key));
@@ -819,8 +819,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
         else
             assertEquals(val, cache.get(key));
 
-        assertEquals(val, dht(0).peek(key));
-        assertEquals(val, dht(1).peek(key));
+        assertEquals(val, dhtPeek(0, key));
+        assertEquals(val, dhtPeek(1, key));
 
         assertNull(near(0).peekNearOnly(key));
         assertNull(near(1).peekNearOnly(key));
@@ -847,8 +847,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
 
         cache.put(key, val);
 
-        assertEquals(val, dht(0).peek(key));
-        assertEquals(val, dht(1).peek(key));
+        assertEquals(val, dhtPeek(0, key));
+        assertEquals(val, dhtPeek(1, key));
 
         assertNull(near(0).peekNearOnly(key));
         assertNull(near(1).peekNearOnly(key));
@@ -872,8 +872,8 @@ public class GridCacheNearMultiNodeSelfTest extends GridCommonAbstractTest {
             assertTrue(cache.remove(key));
         }
 
-        assertNull(dht(0).peek(key));
-        assertNull(dht(1).peek(key));
+        assertNull(dhtPeek(0, key));
+        assertNull(dhtPeek(1, key));
 
         assertNull(near(0).peekNearOnly(key));
         assertNull(near(1).peekNearOnly(key));

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
index d361d91..3cc4e01 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOneNodeSelfTest.java
@@ -27,7 +27,6 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
 import org.apache.ignite.testframework.junits.common.*;
 import org.apache.ignite.transactions.*;
 
-import javax.cache.configuration.*;
 import java.util.concurrent.*;
 import java.util.concurrent.locks.*;
 
@@ -132,7 +131,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
         assertEquals(1, near.size());
         assertEquals(1, near.size());
 
-        String d = dht.peek(1);
+        String d = localPeek(dht, 1);
 
         assert d != null;
         assertEquals(d, "1");
@@ -163,7 +162,6 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
             GridCacheEntryEx entry = dht.peekEx(2);
 
             assert entry == null || entry.rawGetOrUnmarshal(false) == null : "Invalid entry: " + entry;
-            assert dht.peek(3) != null;
 
             tx.commit();
         }
@@ -215,13 +213,13 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
             near.put(1, "1");
 
             assertEquals("1", near.localPeek(1, CachePeekMode.ONHEAP));
-            assertEquals("1", dht().peek(1));
+            assertEquals("1", dhtPeek(1));
 
             assertEquals("1", near.get(1));
             assertEquals("1", near.getAndRemove(1));
 
             assertNull(near.localPeek(1, CachePeekMode.ONHEAP));
-            assertNull(dht().peek(1));
+            assertNull(dhtPeek(1));
 
             assertTrue(near.isLocalLocked(1, false));
             assertTrue(near.isLocalLocked(1, true));
@@ -246,7 +244,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
             near.put(1, "1");
 
             assertEquals("1", near.localPeek(1, CachePeekMode.ONHEAP));
-            assertEquals("1", dht().peek(1));
+            assertEquals("1", dhtPeek(1));
 
             assertTrue(near.isLocalLocked(1, false));
             assertTrue(near.isLocalLocked(1, true));
@@ -258,7 +256,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
                 assertEquals("1", near.getAndRemove(1));
 
                 assertNull(near.localPeek(1, CachePeekMode.ONHEAP));
-                assertNull(dht().peek(1));
+                assertNull(dhtPeek(1));
 
                 assertTrue(near.isLocalLocked(1, false));
                 assertTrue(near.isLocalLocked(1, true));
@@ -284,7 +282,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
 
         cache.put(1, "val1");
 
-        assertEquals("val1", dht().peek(1));
+        assertEquals("val1", dhtPeek(1));
         assertNull(near().peekNearOnly(1));
 
         Transaction tx = grid().transactions().txStart(PESSIMISTIC, REPEATABLE_READ);
@@ -293,7 +291,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
 
         tx.commit();
 
-        assertEquals("val1", dht().peek(1));
+        assertEquals("val1", dhtPeek(1));
         assertNull(near().peekNearOnly(1));
     }
 
@@ -303,7 +301,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
 
         cache.put(1, "val1");
 
-        assertEquals("val1", dht().peek(1));
+        assertEquals("val1", dhtPeek(1));
         assertNull(near().peekNearOnly(1));
 
         Transaction tx = grid().transactions().txStart(PESSIMISTIC, REPEATABLE_READ);
@@ -314,7 +312,7 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
 
         tx.commit();
 
-        assertNull(dht().peek(1));
+        assertNull(dhtPeek(1));
         assertNull(near().peekNearOnly(1));
     }
 
@@ -337,11 +335,6 @@ public class GridCacheNearOneNodeSelfTest extends GridCommonAbstractTest {
             create = true;
         }
 
-        /** @param create Create flag. */
-        void create(boolean create) {
-            this.create = create;
-        }
-
         /** @return Create flag. */
         boolean isCreate() {
             return create;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java
index ad2668d..a0d9f03 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java
@@ -45,8 +45,6 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
  * Checks that readers are properly handled.
  */
 public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
-    /**Cache peek modes array taht consist of only ONHEAP mode. */
-    private static final CachePeekMode[] ONHEAP_PEEK_MODES = new CachePeekMode[] {CachePeekMode.ONHEAP};
     /** Number of grids. */
     private int grids = 2;
 
@@ -258,10 +256,10 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
         assertTrue(cache1.containsKey(2));
         assertTrue(cache2.containsKey(2));
 
-        assertEquals("v2", near(cache1).peek(2));
-        assertEquals("v2", near(cache2).peek(2));
-        assertEquals("v2", dht(cache1).peek(2));
-        assertEquals("v2", dht(cache2).peek(2));
+        assertEquals("v2", nearPeek(cache1, 2));
+        assertEquals("v2", nearPeek(cache2, 2));
+        assertEquals("v2", dhtPeek(cache1, 2));
+        assertEquals("v2", dhtPeek(cache2, 2));
 
         assertNull(near(cache1).peekNearOnly(2));
         assertNull(near(cache2).peekNearOnly(2));
@@ -286,7 +284,7 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
         cache2.localEvict(Collections.singleton(1));
 
         assertNull(near(cache2).peekNearOnly(1));
-        assertEquals("v1", dht(cache2).peek(1));
+        assertEquals("v1", dhtPeek(cache2, 1));
 
         assertEquals("v1", cache1.getAndPut(1, "z1"));
 
@@ -294,7 +292,7 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
         assertFalse(e1.readers().contains(n2.id()));
 
         assertNull(near(cache2).peekNearOnly(1));
-        assertEquals("z1", dht(cache2).peek(1));
+        assertEquals("z1", dhtPeek(cache2, 1));
     }
 
     /** @throws Exception If failed. */
@@ -445,9 +443,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
 
         assertNull(cache.getAndPut(key1, val1));
 
-        assertEquals(val1, dht(0).peek(key1));
-        assertEquals(val1, dht(1).peek(key1));
-        assertNull(dht(2).peek(key1));
+        assertEquals(val1, dhtPeek(0, key1));
+        assertEquals(val1, dhtPeek(1, key1));
+        assertNull(dhtPeek(2, key1));
 
         assertNull(near(0).peekNearOnly(key1));
         assertNull(near(1).peekNearOnly(key1));
@@ -455,9 +453,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
 
         cache.put(key2, val2);
 
-        assertNull(dht(0).peek(key2));
-        assertEquals(val2, dht(1).peek(key2));
-        assertEquals(val2, dht(2).peek(key2));
+        assertNull(dhtPeek(0, key2));
+        assertEquals(val2, dhtPeek(1, key2));
+        assertEquals(val2, dhtPeek(2, key2));
 
         assertEquals(val2, near(0).peekNearOnly(key2));
         assertNull(near(1).peekNearOnly(key2));
@@ -467,9 +465,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
 
         cache.put(key2, val22);
 
-        assertNull(dht(0).peek(key2));
-        assertEquals(val22, dht(1).peek(key2));
-        assertEquals(val22, dht(2).peek(key2));
+        assertNull(dhtPeek(0, key2));
+        assertEquals(val22, dhtPeek(1, key2));
+        assertEquals(val22, dhtPeek(2, key2));
 
         assertEquals(val22, near(0).peekNearOnly(key2));
         assertNull(near(1).peekNearOnly(key2));
@@ -477,9 +475,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
 
         cache.remove(key2);
 
-        assertNull(dht(0).peek(key2));
-        assertNull(dht(1).peek(key2));
-        assertNull(dht(2).peek(key2));
+        assertNull(dhtPeek(0, key2));
+        assertNull(dhtPeek(1, key2));
+        assertNull(dhtPeek(2, key2));
 
         assertNull(near(0).peekNearOnly(key2));
         assertNull(near(1).peekNearOnly(key2));
@@ -487,9 +485,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
 
         cache.remove(key1);
 
-        assertNull(dht(0).peek(key1));
-        assertNull(dht(1).peek(key1));
-        assertNull(dht(2).peek(key1));
+        assertNull(dhtPeek(0, key1));
+        assertNull(dhtPeek(1, key1));
+        assertNull(dhtPeek(2, key1));
 
         assertNull(near(0).peekNearOnly(key1));
         assertNull(near(1).peekNearOnly(key1));
@@ -538,9 +536,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
             try {
                 assertNull(cache.getAndPut(key1, val1));
 
-                assertEquals(val1, dht(0).peek(key1));
-                assertEquals(val1, dht(1).peek(key1));
-                assertNull(dht(2).peek(key1));
+                assertEquals(val1, dhtPeek(0, key1));
+                assertEquals(val1, dhtPeek(1, key1));
+                assertNull(dhtPeek(2, key1));
 
                 // Since near entry holds the lock, it should
                 // contain correct value.
@@ -551,9 +549,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
 
                 cache.put(key2, val2);
 
-                assertNull(dht(0).peek(key2));
-                assertEquals(val2, dht(1).peek(key2));
-                assertEquals(val2, dht(2).peek(key2));
+                assertNull(dhtPeek(0, key2));
+                assertEquals(val2, dhtPeek(1, key2));
+                assertEquals(val2, dhtPeek(2, key2));
 
                 assertEquals(val2, near(0).peekNearOnly(key2));
                 assertNull(near(1).peekNearOnly(key2));
@@ -563,9 +561,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
 
                 cache.put(key2, val22);
 
-                assertNull(dht(0).peek(key2));
-                assertEquals(val22, dht(1).peek(key2));
-                assertEquals(val22, dht(2).peek(key2));
+                assertNull(dhtPeek(0, key2));
+                assertEquals(val22, dhtPeek(1, key2));
+                assertEquals(val22, dhtPeek(2, key2));
 
                 assertEquals(val22, near(0).peekNearOnly(key2));
                 assertNull(near(1).peekNearOnly(key2));
@@ -573,9 +571,9 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
 
                 cache.remove(key2);
 
-                assertNull(dht(0).peek(key2));
-                assertNull(dht(1).peek(key2));
-                assertNull(dht(2).peek(key2));
+                assertNull(dhtPeek(0, key2));
+                assertNull(dhtPeek(1, key2));
+                assertNull(dhtPeek(2, key2));
 
                 assertNull(dht(0).peekEx(key2));
                 assertNotNull(dht(1).peekEx(key2));
@@ -593,28 +591,4 @@ public class GridCacheNearReadersSelfTest extends GridCommonAbstractTest {
             lock1.unlock();
         }
     }
-
-    /**
-     * @param cache Cache.
-     * @param key Key.
-     */
-    private static <K, V> V nearPeek(IgniteCache<K, V> cache, K key) throws IgniteCheckedException {
-        return localPeek(near(cache), key);
-    }
-
-    /**
-     * @param cache Cache.
-     * @param key Key.
-     */
-    private static <K, V> V dhtPeek(IgniteCache<K, V> cache, K key) throws IgniteCheckedException {
-        return localPeek(dht(cache), key);
-    }
-
-    /**
-     * @param cache Cache.
-     * @param key Key.
-     */
-    private static <K, V> V localPeek(GridCacheAdapter<K, V> cache, K key) throws IgniteCheckedException {
-        return cache.localPeek(key, ONHEAP_PEEK_MODES, null);
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java
index b110bfa..96229c0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java
@@ -209,7 +209,8 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest {
             IgfsFileImpl info = (IgfsFileImpl)igfs.info(path);
 
             for (int i = 0; i < nodesCount(); i++) {
-                IgfsFileInfo fileInfo = (IgfsFileInfo)grid(i).cachex(metaCacheName).peek(info.fileId());
+                IgfsFileInfo fileInfo =
+                    (IgfsFileInfo)grid(i).cachex(metaCacheName).localPeek(info.fileId(), ONHEAP_PEEK_MODES, null);
 
                 assertNotNull(fileInfo);
                 assertNotNull(fileInfo.listing());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
index 3a49e6c..2b6c62a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
@@ -404,7 +404,7 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
             // Await for actual delete to occur.
             for (IgfsBlock block : file.blocks()) {
                 for (int i = 0; i < GRID_CNT; i++) {
-                    while (cache(grid(i).localNode().id()).peek(block.key()) != null)
+                    while (localPeek(cache(grid(i).localNode().id()), block.key()) != null)
                         U.sleep(100);
                 }
             }
@@ -651,39 +651,6 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
     }
 
     /**
-     * Create block key.
-     *
-     * @param path Path.
-     * @param blockId Block ID.
-     * @return Block key.
-     * @throws Exception If failed.
-     */
-    private IgfsBlockKey blockKey(IgfsPath path, long blockId) throws Exception {
-        IgfsEx igfs0 = (IgfsEx)grid(0).fileSystem(IGFS_NAME);
-
-        IgniteUuid fileId = igfs0.context().meta().fileId(path);
-
-        return new IgfsBlockKey(fileId, null, true, blockId);
-    }
-
-    /**
-     * Determine primary node for the given block key.
-     *
-     * @param key Block key.
-     * @return Node ID.
-     */
-    private UUID primary(IgfsBlockKey key) {
-        IgniteEx grid = grid(0);
-
-        for (ClusterNode node : grid.cluster().nodes()) {
-            if (grid.affinity(DATA_CACHE_NAME).isPrimary(node, key))
-                return node.id();
-        }
-
-        return null;
-    }
-
-    /**
      * Determine primary and backup node IDs for the given block key.
      *
      * @param key Block key.
@@ -714,17 +681,6 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
     }
 
     /**
-     * Get IGFS of the given node.
-     *
-     * @param ignite Node;
-     * @return IGFS.
-     * @throws Exception If failed.
-     */
-    private IgfsImpl igfs(Ignite ignite) throws Exception {
-        return (IgfsImpl) ignite.fileSystem(IGFS_NAME);
-    }
-
-    /**
      * Get data cache for the given node ID.
      *
      * @param nodeId Node ID.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
index 9dd40d0..b890692 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
@@ -52,6 +52,9 @@ import static org.apache.ignite.internal.processors.cache.GridCacheUtils.*;
  * Super class for all common tests.
  */
 public abstract class GridCommonAbstractTest extends GridAbstractTest {
+    /**Cache peek modes array that consist of only ONHEAP mode. */
+    protected static final CachePeekMode[] ONHEAP_PEEK_MODES = new CachePeekMode[] {CachePeekMode.ONHEAP};
+
     /**
      * @param startGrid If {@code true}, then grid node will be auto-started.
      */
@@ -552,6 +555,45 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
     }
 
     /**
+     * @param key Key.
+     */
+    protected <K, V> V dhtPeek(K key) throws IgniteCheckedException {
+        return localPeek(this.<K, V>dht(), key);
+    }
+
+    /**
+     * @param idx Index.
+     * @param key Key.
+     */
+    protected <K, V> V dhtPeek(int idx, K key) throws IgniteCheckedException {
+        return localPeek(this.<K, V>dht(idx), key);
+    }
+
+    /**
+     * @param cache Cache.
+     * @param key Key.
+     */
+    protected <K, V> V nearPeek(IgniteCache<K, V> cache, K key) throws IgniteCheckedException {
+        return localPeek(near(cache), key);
+    }
+
+    /**
+     * @param cache Cache.
+     * @param key Key.
+     */
+    protected static <K, V> V dhtPeek(IgniteCache<K, V> cache, K key) throws IgniteCheckedException {
+        return localPeek(dht(cache), key);
+    }
+
+    /**
+     * @param cache Cache.
+     * @param key Key.
+     */
+    protected static <K, V> V localPeek(GridCacheAdapter<K, V> cache, K key) throws IgniteCheckedException {
+        return cache.localPeek(key, ONHEAP_PEEK_MODES, null);
+    }
+
+    /**
      * @param comp Compute.
      * @param task Task.
      * @param arg Task argument.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2cd7c86c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridIndexingWithNoopSwapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridIndexingWithNoopSwapSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridIndexingWithNoopSwapSelfTest.java
index c650b6b..ad41bc5 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridIndexingWithNoopSwapSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridIndexingWithNoopSwapSelfTest.java
@@ -99,7 +99,7 @@ public class GridIndexingWithNoopSwapSelfTest extends GridCommonAbstractTest {
             cache.put(i, new ObjectValue("test" + i, i));
 
         for (int i = 0; i < cnt; i++) {
-            assertNotNull(cache.peek(i));
+            assertNotNull(localPeek(cache, i));
 
             cache.evict(i); // Swap.
         }


Mime
View raw message