You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/04/12 07:33:34 UTC

[03/57] [abbrv] ignite git commit: IGNITE-4535 - Add option to store deserialized values on-heap

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingSingleTypeTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingSingleTypeTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingSingleTypeTest.java
index c59e5fe..acf33dc 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingSingleTypeTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOffheapBatchIndexingSingleTypeTest.java
@@ -41,7 +41,7 @@ public class CacheOffheapBatchIndexingSingleTypeTest extends CacheOffheapBatchIn
     public void testBatchRemove() throws Exception {
         Ignite ignite = grid(0);
 
-        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(1,
+        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(
             new Class<?>[] {Integer.class, CacheOffheapBatchIndexingBaseTest.Organization.class});
 
         final IgniteCache<Object, Object> cache = ignite.createCache(ccfg);
@@ -88,18 +88,6 @@ public class CacheOffheapBatchIndexingSingleTypeTest extends CacheOffheapBatchIn
         doStreamerBatchTest(50,
             1_000,
             new Class<?>[] {Integer.class, CacheOffheapBatchIndexingBaseTest.Organization.class},
-            1,
-            true);
-    }
-
-    /**
-     *
-     */
-    public void testPutAllAndStreamerDfltOffHeapRowCacheSize() {
-        doStreamerBatchTest(50,
-            1_000,
-            new Class<?>[] {Integer.class, CacheOffheapBatchIndexingBaseTest.Organization.class},
-            CacheConfiguration.DFLT_SQL_ONHEAP_ROW_CACHE_SIZE,
             true);
     }
 
@@ -110,7 +98,6 @@ public class CacheOffheapBatchIndexingSingleTypeTest extends CacheOffheapBatchIn
         doStreamerBatchTest(50,
             1_000,
             new Class<?>[] {Integer.class, CacheOffheapBatchIndexingBaseTest.Organization.class},
-            1,
             false);
     }
 
@@ -118,18 +105,17 @@ public class CacheOffheapBatchIndexingSingleTypeTest extends CacheOffheapBatchIn
      * @param iterations Number of iterations.
      * @param entitiesCnt Number of entities to put.
      * @param entityClasses Entity classes.
-     * @param onHeapRowCacheSize Cache size.
+
      * @param preloadInStreamer Data preload flag.
      */
     private void doStreamerBatchTest(int iterations,
         int entitiesCnt,
         Class<?>[] entityClasses,
-        int onHeapRowCacheSize,
         boolean preloadInStreamer) {
         Ignite ignite = grid(0);
 
         final IgniteCache<Object, Object> cache =
-            ignite.createCache(cacheConfiguration(onHeapRowCacheSize, entityClasses));
+            ignite.createCache(cacheConfiguration(entityClasses));
 
         try {
             if (preloadInStreamer)

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOperationsWithExpirationTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOperationsWithExpirationTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOperationsWithExpirationTest.java
index 7db8b9c..33c82b7 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOperationsWithExpirationTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheOperationsWithExpirationTest.java
@@ -28,7 +28,6 @@ import javax.cache.expiry.ModifiedExpiryPolicy;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMemoryMode;
 import org.apache.ignite.cache.query.SqlFieldsQuery;
 import org.apache.ignite.cache.query.annotations.QuerySqlField;
 import org.apache.ignite.configuration.CacheConfiguration;
@@ -41,9 +40,6 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
 import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.PRIMARY;
 import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_TIERED;
-import static org.apache.ignite.cache.CacheMemoryMode.ONHEAP_TIERED;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.PRIMARY_SYNC;
 
 /**
@@ -55,20 +51,16 @@ public class CacheOperationsWithExpirationTest extends GridCommonAbstractTest {
 
     /**
      * @param atomicityMode Atomicity mode.
-     * @param memoryMode Memory mode.
      * @param offheapMem Offheap memory size.
      * @param idx Indexing enabled flag.
      * @return Cache configuration.
      */
     private CacheConfiguration<String, TestIndexedType> cacheConfiguration(CacheAtomicityMode atomicityMode,
-        CacheMemoryMode memoryMode,
         long offheapMem,
         boolean idx) {
         CacheConfiguration<String, TestIndexedType> ccfg = new CacheConfiguration<>();
 
         ccfg.setAtomicityMode(atomicityMode);
-        ccfg.setMemoryMode(memoryMode);
-        ccfg.setOffHeapMaxMemory(offheapMem);
         ccfg.setBackups(1);
         ccfg.setAtomicWriteOrderMode(PRIMARY);
         ccfg.setWriteSynchronizationMode(PRIMARY_SYNC);
@@ -97,71 +89,15 @@ public class CacheOperationsWithExpirationTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testAtomicOffheapLimitedIndexEnabled() throws Exception {
-        concurrentPutGetRemoveExpireAndQuery(cacheConfiguration(ATOMIC, OFFHEAP_TIERED, 1024 * 1024, true));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testAtomicOffheapIndexEnabled() throws Exception {
-        concurrentPutGetRemoveExpireAndQuery(cacheConfiguration(ATOMIC, OFFHEAP_TIERED, 0, true));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     public void testAtomicIndexEnabled() throws Exception {
-        concurrentPutGetRemoveExpireAndQuery(cacheConfiguration(ATOMIC, ONHEAP_TIERED, 0, true));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTxOffheapLimitedIndexEnabled() throws Exception {
-        concurrentPutGetRemoveExpireAndQuery(cacheConfiguration(TRANSACTIONAL, OFFHEAP_TIERED, 1024 * 1024, true));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTxOffheapIndexEnabled() throws Exception {
-        concurrentPutGetRemoveExpireAndQuery(cacheConfiguration(TRANSACTIONAL, OFFHEAP_TIERED, 0, true));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testAtomicOffheapLimited() throws Exception {
-        concurrentPutGetRemoveExpireAndQuery(cacheConfiguration(ATOMIC, OFFHEAP_TIERED, 1024 * 1024, false));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testAtomicOffheap() throws Exception {
-        concurrentPutGetRemoveExpireAndQuery(cacheConfiguration(ATOMIC, OFFHEAP_TIERED, 0, false));
+        concurrentPutGetRemoveExpireAndQuery(cacheConfiguration(ATOMIC, 0, true));
     }
 
     /**
      * @throws Exception If failed.
      */
     public void testAtomic() throws Exception {
-        concurrentPutGetRemoveExpireAndQuery(cacheConfiguration(ATOMIC, ONHEAP_TIERED, 0, false));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTxOffheapLimited() throws Exception {
-        concurrentPutGetRemoveExpireAndQuery(cacheConfiguration(TRANSACTIONAL, OFFHEAP_TIERED, 1024 * 1024, false));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTxOffheap() throws Exception {
-        concurrentPutGetRemoveExpireAndQuery(cacheConfiguration(TRANSACTIONAL, OFFHEAP_TIERED, 0, false));
+        concurrentPutGetRemoveExpireAndQuery(cacheConfiguration(ATOMIC, 0, false));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheQueryEvictDataLostTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheQueryEvictDataLostTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheQueryEvictDataLostTest.java
new file mode 100644
index 0000000..7b79c72
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheQueryEvictDataLostTest.java
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import java.io.Serializable;
+import java.util.concurrent.ThreadLocalRandom;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.eviction.lru.LruEvictionPolicy;
+import org.apache.ignite.cache.query.SqlQuery;
+import org.apache.ignite.cache.query.annotations.QuerySqlField;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteInClosure;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/**
+ *
+ */
+public class CacheQueryEvictDataLostTest extends GridCommonAbstractTest {
+    /** */
+    private static final int KEYS = 100_000;
+
+    /**
+     *
+     */
+    public CacheQueryEvictDataLostTest() {
+        super(true);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration() throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration();
+
+        CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>();
+
+        ccfg.setName("cache-1");
+        ccfg.setEvictionPolicy(new LruEvictionPolicy(10));
+        ccfg.setOnheapCacheEnabled(true);
+        ccfg.setIndexedTypes(Integer.class, TestData.class);
+
+        cfg.setCacheConfiguration(ccfg);
+
+        return cfg;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testQueryDataLost() throws Exception {
+        final long stopTime = U.currentTimeMillis() + 30_000;
+
+        GridTestUtils.runMultiThreaded(new IgniteInClosure<Integer>() {
+            void putGet(IgniteCache<Object, Object> cache) {
+                ThreadLocalRandom rnd = ThreadLocalRandom.current();
+
+                for (int i = 0; i < KEYS; i++) {
+                    cache.put(rnd.nextInt(KEYS), new TestData(i));
+
+                    cache.get(rnd.nextInt(KEYS));
+                }
+            }
+
+            void query(IgniteCache<Object, Object> cache) {
+                SqlQuery<Object, Object> qry1 = new SqlQuery<>(TestData.class, "_key > ?");
+                qry1.setArgs(KEYS / 2);
+
+                cache.query(qry1).getAll();
+
+                SqlQuery<Object, Object> qry2 = new SqlQuery<>(TestData.class, "idxVal > ?");
+                qry2.setArgs(KEYS / 2);
+
+                cache.query(qry2).getAll();
+            }
+
+            @Override public void apply(Integer idx) {
+                IgniteCache<Object, Object> cache1 = grid().cache("cache-1");
+
+                while (U.currentTimeMillis() < stopTime) {
+                    if (idx == 0)
+                        putGet(cache1);
+                    else
+                        query(cache1);
+                }
+            }
+        }, 10, "test-thread");
+    }
+
+    /**
+     *
+     */
+    static class TestData implements Serializable {
+        /** */
+        @QuerySqlField(index = true)
+        private int idxVal;
+
+        /**
+         * @param idxVal Value.
+         */
+        public TestData(int idxVal) {
+            this.idxVal = idxVal;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheQueryOffheapEvictDataLostTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheQueryOffheapEvictDataLostTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheQueryOffheapEvictDataLostTest.java
deleted file mode 100644
index 3867b20..0000000
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheQueryOffheapEvictDataLostTest.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-import java.io.Serializable;
-import java.util.concurrent.ThreadLocalRandom;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.eviction.lru.LruEvictionPolicy;
-import org.apache.ignite.cache.query.SqlQuery;
-import org.apache.ignite.cache.query.annotations.QuerySqlField;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.IgniteInClosure;
-import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_TIERED;
-import static org.apache.ignite.cache.CacheMemoryMode.ONHEAP_TIERED;
-
-/**
- *
- */
-public class CacheQueryOffheapEvictDataLostTest extends GridCommonAbstractTest {
-    /** */
-    private static final int KEYS = 100_000;
-
-    /**
-     *
-     */
-    public CacheQueryOffheapEvictDataLostTest() {
-        super(true);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration() throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration();
-
-        CacheConfiguration<Object, Object> ccfg1 = new CacheConfiguration<>();
-
-        ccfg1.setName("cache-1");
-        ccfg1.setMemoryMode(OFFHEAP_TIERED);
-        ccfg1.setOffHeapMaxMemory(1024);
-        ccfg1.setIndexedTypes(Integer.class, TestData.class);
-
-        CacheConfiguration<Object, Object> ccfg2 = new CacheConfiguration<>();
-
-        ccfg2.setName("cache-2");
-        ccfg2.setMemoryMode(ONHEAP_TIERED);
-        ccfg2.setEvictionPolicy(new LruEvictionPolicy(10));
-        ccfg2.setOffHeapMaxMemory(1024);
-        ccfg2.setIndexedTypes(Integer.class, TestData.class);
-
-        cfg.setCacheConfiguration(ccfg1, ccfg2);
-
-        return cfg;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testQueryDataLost() throws Exception {
-        final long stopTime = U.currentTimeMillis() + 30_000;
-
-        GridTestUtils.runMultiThreaded(new IgniteInClosure<Integer>() {
-            void putGet(IgniteCache<Object, Object> cache) {
-                ThreadLocalRandom rnd = ThreadLocalRandom.current();
-
-                for (int i = 0; i < KEYS; i++) {
-                    cache.put(rnd.nextInt(KEYS), new TestData(i));
-
-                    cache.get(rnd.nextInt(KEYS));
-                }
-            }
-
-            void query(IgniteCache<Object, Object> cache) {
-                SqlQuery<Object, Object> qry1 = new SqlQuery<>(TestData.class, "_key > ?");
-                qry1.setArgs(KEYS / 2);
-
-                cache.query(qry1).getAll();
-
-                SqlQuery<Object, Object> qry2 = new SqlQuery<>(TestData.class, "idxVal > ?");
-                qry2.setArgs(KEYS / 2);
-
-                cache.query(qry2).getAll();
-            }
-
-            @Override public void apply(Integer idx) {
-                IgniteCache<Object, Object> cache1 = grid().cache("cache-1");
-                IgniteCache<Object, Object> cache2 = grid().cache("cache-2");
-
-                while (U.currentTimeMillis() < stopTime) {
-                    if (idx == 0) {
-                        putGet(cache1);
-                        putGet(cache2);
-                    }
-                    else {
-                        query(cache1);
-                        query(cache2);
-                    }
-                }
-            }
-        }, 10, "test-thread");
-    }
-
-    /**
-     *
-     */
-    static class TestData implements Serializable {
-        /** */
-        @QuerySqlField(index = true)
-        private int idxVal;
-
-        /**
-         * @param idxVal Value.
-         */
-        public TestData(int idxVal) {
-            this.idxVal = idxVal;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheRandomOperationsMultithreadedTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheRandomOperationsMultithreadedTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheRandomOperationsMultithreadedTest.java
index 2c2cf65..9861153 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheRandomOperationsMultithreadedTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheRandomOperationsMultithreadedTest.java
@@ -28,7 +28,6 @@ import javax.cache.Cache;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMemoryMode;
 import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.cache.eviction.EvictionPolicy;
 import org.apache.ignite.cache.eviction.lru.LruEvictionPolicy;
@@ -51,8 +50,6 @@ import org.jetbrains.annotations.Nullable;
 import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.PRIMARY;
 import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_TIERED;
-import static org.apache.ignite.cache.CacheMemoryMode.ONHEAP_TIERED;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
 
@@ -104,36 +101,9 @@ public class CacheRandomOperationsMultithreadedTest extends GridCommonAbstractTe
     /**
      * @throws Exception If failed.
      */
-    public void testAtomicOffheapTiered() throws Exception {
-        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
-            ATOMIC,
-            OFFHEAP_TIERED,
-            null,
-            false);
-
-        randomOperations(ccfg);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testAtomicOffheapTieredIndexing() throws Exception {
-        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
-            ATOMIC,
-            OFFHEAP_TIERED,
-            null,
-            true);
-
-        randomOperations(ccfg);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     public void testAtomicOffheapEviction() throws Exception {
         CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
             ATOMIC,
-            ONHEAP_TIERED,
             new LruEvictionPolicy<>(10),
             false);
 
@@ -146,7 +116,6 @@ public class CacheRandomOperationsMultithreadedTest extends GridCommonAbstractTe
     public void testAtomicOffheapEvictionIndexing() throws Exception {
         CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
             ATOMIC,
-            ONHEAP_TIERED,
             new LruEvictionPolicy<>(10),
             true);
 
@@ -156,36 +125,9 @@ public class CacheRandomOperationsMultithreadedTest extends GridCommonAbstractTe
     /**
      * @throws Exception If failed.
      */
-    public void testTxOffheapTiered() throws Exception {
-        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
-            TRANSACTIONAL,
-            OFFHEAP_TIERED,
-            null,
-            false);
-
-        randomOperations(ccfg);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTxOffheapTieredIndexing() throws Exception {
-        CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
-            TRANSACTIONAL,
-            OFFHEAP_TIERED,
-            null,
-            true);
-
-        randomOperations(ccfg);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     public void testTxOffheapEviction() throws Exception {
         CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
             TRANSACTIONAL,
-            ONHEAP_TIERED,
             new LruEvictionPolicy<>(10),
             false);
 
@@ -198,7 +140,6 @@ public class CacheRandomOperationsMultithreadedTest extends GridCommonAbstractTe
     public void testTxOffheapEvictionIndexing() throws Exception {
         CacheConfiguration<Object, Object> ccfg = cacheConfiguration(PARTITIONED,
             TRANSACTIONAL,
-            ONHEAP_TIERED,
             new LruEvictionPolicy<>(10),
             true);
 
@@ -391,7 +332,6 @@ public class CacheRandomOperationsMultithreadedTest extends GridCommonAbstractTe
     /**
      * @param cacheMode Cache mode.
      * @param atomicityMode Cache atomicity mode.
-     * @param memoryMode Cache memory mode.
      * @param evictionPlc Eviction policy.
      * @param indexing Indexing flag.
      * @return Cache configuration.
@@ -399,18 +339,16 @@ public class CacheRandomOperationsMultithreadedTest extends GridCommonAbstractTe
     private CacheConfiguration<Object, Object> cacheConfiguration(
         CacheMode cacheMode,
         CacheAtomicityMode atomicityMode,
-        CacheMemoryMode memoryMode,
         @Nullable  EvictionPolicy<Object, Object> evictionPlc,
         boolean indexing) {
         CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>();
 
         ccfg.setAtomicityMode(atomicityMode);
         ccfg.setCacheMode(cacheMode);
-        ccfg.setMemoryMode(memoryMode);
         ccfg.setWriteSynchronizationMode(FULL_SYNC);
         ccfg.setAtomicWriteOrderMode(PRIMARY);
         ccfg.setEvictionPolicy(evictionPlc);
-        ccfg.setOffHeapMaxMemory(0);
+        ccfg.setOnheapCacheEnabled(evictionPlc != null);
 
         if (cacheMode == PARTITIONED)
             ccfg.setBackups(1);

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ClientReconnectAfterClusterRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ClientReconnectAfterClusterRestartTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ClientReconnectAfterClusterRestartTest.java
index 20b947b..392cdc7 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ClientReconnectAfterClusterRestartTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ClientReconnectAfterClusterRestartTest.java
@@ -23,7 +23,6 @@ import org.apache.ignite.IgniteDataStreamer;
 import org.apache.ignite.binary.BinaryObject;
 import org.apache.ignite.binary.BinaryObjectBuilder;
 import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMemoryMode;
 import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.cache.QueryEntity;
 import org.apache.ignite.cache.QueryIndex;
@@ -32,7 +31,9 @@ import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.events.Event;
 import org.apache.ignite.events.EventType;
 import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.internal.util.lang.GridAbsPredicate;
 import org.apache.ignite.lang.IgnitePredicate;
+import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.jetbrains.annotations.NotNull;
 
@@ -76,7 +77,6 @@ public class ClientReconnectAfterClusterRestartTest extends GridCommonAbstractTe
         ccfg.setName(CACHE_PARAMS);
         ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
         ccfg.setCacheMode(CacheMode.PARTITIONED);
-        ccfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
 
         List<QueryEntity> queryEntities = new ArrayList<>();
 
@@ -161,9 +161,17 @@ public class ClientReconnectAfterClusterRestartTest extends GridCommonAbstractTe
 
             startGrid(0);
 
-            Thread.sleep(2_000);
+            assert GridTestUtils.waitForCondition(new GridAbsPredicate() {
+                @Override public boolean apply() {
+                    try {
+                        checkTopology(2);
 
-            checkTopology(2);
+                        return true;
+                    } catch (Exception ex) {
+                        return false;
+                    }
+                }
+            }, 30_000);
 
             info("Pre-insert");
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
index 2c083fb..148ce74 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
@@ -87,7 +87,6 @@ public class GridCacheOffHeapSelfTest extends GridCommonAbstractTest {
 
         cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
         cacheCfg.setCacheMode(REPLICATED);
-        cacheCfg.setOffHeapMaxMemory(1024L * 1024L * 1024L);
         cacheCfg.setIndexedTypes(Integer.class, CacheValue.class);
 
         cfg.setCacheConfiguration(cacheCfg);

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexEntryEvictTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexEntryEvictTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexEntryEvictTest.java
index dc0083d..d64aa7c 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexEntryEvictTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexEntryEvictTest.java
@@ -35,7 +35,6 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_TIERED;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
 
@@ -63,11 +62,8 @@ public class GridCacheOffheapIndexEntryEvictTest extends GridCommonAbstractTest
         cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
         cacheCfg.setCacheMode(PARTITIONED);
         cacheCfg.setBackups(1);
-        cacheCfg.setOffHeapMaxMemory(0);
         cacheCfg.setAtomicityMode(TRANSACTIONAL);
-        cacheCfg.setMemoryMode(OFFHEAP_TIERED);
         cacheCfg.setEvictionPolicy(null);
-        cacheCfg.setSqlOnheapRowCacheSize(10);
         cacheCfg.setIndexedTypes(Integer.class, TestValue.class);
         cacheCfg.setNearConfiguration(null);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexGetSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexGetSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexGetSelfTest.java
index c55f51c..f9e555e 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexGetSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexGetSelfTest.java
@@ -38,7 +38,6 @@ import org.apache.ignite.transactions.TransactionConcurrency;
 import org.apache.ignite.transactions.TransactionIsolation;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_TIERED;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
 import static org.apache.ignite.configuration.DeploymentMode.SHARED;
@@ -48,9 +47,6 @@ import static org.apache.ignite.configuration.DeploymentMode.SHARED;
  */
 public class GridCacheOffheapIndexGetSelfTest extends GridCommonAbstractTest {
     /** */
-    private static final long OFFHEAP_MEM = 10L * 1024L;
-
-    /** */
     private final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
 
     /** {@inheritDoc} */
@@ -79,11 +75,7 @@ public class GridCacheOffheapIndexGetSelfTest extends GridCommonAbstractTest {
         cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
         cacheCfg.setCacheMode(PARTITIONED);
         cacheCfg.setBackups(1);
-        cacheCfg.setOffHeapMaxMemory(OFFHEAP_MEM);
-        cacheCfg.setEvictSynchronized(true);
-        cacheCfg.setEvictSynchronizedKeyBufferSize(1);
         cacheCfg.setAtomicityMode(TRANSACTIONAL);
-        cacheCfg.setMemoryMode(OFFHEAP_TIERED);
         cacheCfg.setEvictionPolicy(null);
 
         return cacheCfg;

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQuerySimpleBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQuerySimpleBenchmark.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQuerySimpleBenchmark.java
index b729336..17ee024 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQuerySimpleBenchmark.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQuerySimpleBenchmark.java
@@ -26,7 +26,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMemoryMode;
 import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.cache.query.SqlFieldsQuery;
 import org.apache.ignite.cache.query.annotations.QuerySqlField;
@@ -71,8 +70,6 @@ public class GridCacheQuerySimpleBenchmark extends GridCommonAbstractTest {
             Long.class, Person.class
         );
 
-        ccfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
-
         c.setCacheConfiguration(ccfg);
 
         return c;

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/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 8f24670..d16e8bb 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
@@ -67,6 +67,7 @@ public class GridIndexingWithNoopSwapSelfTest extends GridCommonAbstractTest {
         plc.setMaxSize(1000);
 
         cc.setEvictionPolicy(plc);
+        cc.setOnheapCacheEnabled(true);
         cc.setBackups(1);
         cc.setAtomicityMode(TRANSACTIONAL);
         cc.setIndexedTypes(
@@ -108,6 +109,6 @@ public class GridIndexingWithNoopSwapSelfTest extends GridCommonAbstractTest {
         SqlQuery<Integer, ObjectValue> qry =
             new SqlQuery(ObjectValue.class, "intVal >= ? order by intVal");
 
-        assertEquals(0, cache.query(qry.setArgs(0)).getAll().size());
+        assertEquals(10, cache.query(qry.setArgs(0)).getAll().size());
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsOffheapLocalTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsOffheapLocalTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsOffheapLocalTest.java
deleted file mode 100644
index 560d258..0000000
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsOffheapLocalTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-/**
- *
- */
-public class IgniteBinaryObjectQueryArgumentsOffheapLocalTest extends IgniteBinaryObjectQueryArgumentsOffheapTest {
-    /** {@inheritDoc} */
-    @Override protected boolean isLocal() {
-        return true;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsOffheapTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsOffheapTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsOffheapTest.java
deleted file mode 100644
index d1428ae..0000000
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsOffheapTest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-import org.apache.ignite.cache.CacheMemoryMode;
-
-/**
- *
- */
-public class IgniteBinaryObjectQueryArgumentsOffheapTest extends IgniteBinaryObjectQueryArgumentsTest {
-    /** {@inheritDoc} */
-    @Override protected CacheMemoryMode memoryMode() {
-        return CacheMemoryMode.OFFHEAP_TIERED;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsTest.java
index 390a090..9d18b62 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsTest.java
@@ -30,7 +30,6 @@ import java.util.concurrent.ThreadLocalRandom;
 import javax.cache.Cache;
 
 import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.CacheMemoryMode;
 import org.apache.ignite.cache.QueryEntity;
 import org.apache.ignite.cache.query.SqlFieldsQuery;
 import org.apache.ignite.cache.query.SqlQuery;
@@ -103,13 +102,6 @@ public class IgniteBinaryObjectQueryArgumentsTest extends GridCommonAbstractTest
     }
 
     /**
-     * @return Memory mode.
-     */
-    protected CacheMemoryMode memoryMode() {
-        return CacheMemoryMode.ONHEAP_TIERED;
-    }
-
-    /**
      * @param cacheName Cache name.
      * @return Cache config.
      */
@@ -124,8 +116,6 @@ public class IgniteBinaryObjectQueryArgumentsTest extends GridCommonAbstractTest
 
         ccfg.setQueryEntities(Collections.singletonList(person));
 
-        ccfg.setMemoryMode(memoryMode());
-
         ccfg.setName(cacheName);
 
         return ccfg;
@@ -178,7 +168,6 @@ public class IgniteBinaryObjectQueryArgumentsTest extends GridCommonAbstractTest
 
         cfg.setName(cacheName);
 
-        cfg.setMemoryMode(memoryMode());
         cfg.setIndexedTypes(key, val);
 
         return cfg;

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinQueryConditionsTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinQueryConditionsTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinQueryConditionsTest.java
index ccac8ea..200ca87 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinQueryConditionsTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinQueryConditionsTest.java
@@ -23,7 +23,6 @@ import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.CacheMemoryMode;
 import org.apache.ignite.cache.QueryEntity;
 import org.apache.ignite.cache.QueryIndex;
 import org.apache.ignite.cache.affinity.Affinity;
@@ -40,8 +39,6 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
 import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.PRIMARY;
 import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
-import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_TIERED;
-import static org.apache.ignite.cache.CacheMemoryMode.ONHEAP_TIERED;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
 
 /**
@@ -63,9 +60,6 @@ public class IgniteCacheDistributedJoinQueryConditionsTest extends GridCommonAbs
     /** */
     private int total;
 
-    /** */
-    private CacheMemoryMode memMode = ONHEAP_TIERED;
-
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
@@ -105,15 +99,6 @@ public class IgniteCacheDistributedJoinQueryConditionsTest extends GridCommonAbs
     }
 
     /**
-     * @throws Exception If failed.
-     */
-    public void testJoinQuery1Offheap() throws Exception {
-        memMode = OFFHEAP_TIERED;
-
-        testJoinQuery1();
-    }
-
-    /**
      * @param idx Use index flag.
      * @throws Exception If failed.
      */
@@ -582,7 +567,6 @@ public class IgniteCacheDistributedJoinQueryConditionsTest extends GridCommonAbs
         ccfg.setAtomicWriteOrderMode(PRIMARY);
         ccfg.setAtomicityMode(ATOMIC);
         ccfg.setBackups(0);
-        ccfg.setMemoryMode(memMode);
 
         return ccfg;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapEvictQueryTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapEvictQueryTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapEvictQueryTest.java
index cb25c5f..22856b5 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapEvictQueryTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapEvictQueryTest.java
@@ -24,7 +24,6 @@ import java.util.concurrent.atomic.AtomicInteger;
 import javax.cache.CacheException;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteInterruptedException;
-import org.apache.ignite.cache.CacheMemoryMode;
 import org.apache.ignite.cache.CachePeekMode;
 import org.apache.ignite.cache.CacheWriteSynchronizationMode;
 import org.apache.ignite.cache.query.SqlFieldsQuery;
@@ -66,18 +65,13 @@ public class IgniteCacheOffheapEvictQueryTest extends GridCommonAbstractTest {
         cacheCfg.setAtomicityMode(TRANSACTIONAL);
         cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         cacheCfg.setBackups(0);
-        cacheCfg.setMemoryMode(CacheMemoryMode.ONHEAP_TIERED);
         cacheCfg.setEvictionPolicy(null);
         cacheCfg.setNearConfiguration(null);
 
-        cacheCfg.setSqlOnheapRowCacheSize(128);
-
         cacheCfg.setIndexedTypes(
             Integer.class, Integer.class
         );
 
-        cacheCfg.setOffHeapMaxMemory(2000); // Small offheap for evictions from offheap to swap.
-
         cfg.setCacheConfiguration(cacheCfg);
 
         return cfg;

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapIndexScanTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapIndexScanTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapIndexScanTest.java
index 7cea826..6f46d33 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapIndexScanTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapIndexScanTest.java
@@ -21,7 +21,6 @@ import java.io.Serializable;
 import java.util.concurrent.Callable;
 import java.util.concurrent.atomic.AtomicBoolean;
 import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.CacheMemoryMode;
 import org.apache.ignite.cache.query.SqlFieldsQuery;
 import org.apache.ignite.cache.query.annotations.QuerySqlField;
 import org.apache.ignite.configuration.CacheConfiguration;
@@ -57,8 +56,6 @@ public class IgniteCacheOffheapIndexScanTest extends GridCommonAbstractTest {
         CacheConfiguration<?,?> cacheCfg = new CacheConfiguration<>();
 
         cacheCfg.setCacheMode(LOCAL);
-        cacheCfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
-        cacheCfg.setSqlOnheapRowCacheSize(256);
         cacheCfg.setIndexedTypes(
             Integer.class, Person.class
         );

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapTieredMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapTieredMultithreadedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapTieredMultithreadedSelfTest.java
deleted file mode 100644
index f0551cd..0000000
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapTieredMultithreadedSelfTest.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ThreadLocalRandom;
-import java.util.concurrent.atomic.AtomicBoolean;
-import javax.cache.Cache;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.CacheMemoryMode;
-import org.apache.ignite.cache.query.SqlQuery;
-import org.apache.ignite.cache.query.annotations.QuerySqlField;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteInternalFuture;
-import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
-import static org.apache.ignite.cache.CacheMode.PARTITIONED;
-
-/**
- * Based on Yardstick benchmark.
- */
-public class IgniteCacheOffheapTieredMultithreadedSelfTest extends GridCommonAbstractTest {
-    /** */
-    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
-    /** */
-    private static final int RANGE = 1_000_000;
-
-    /** */
-    private static IgniteCache<Integer, Object> cache;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(ipFinder);
-
-        cfg.setDiscoverySpi(disco);
-
-        CacheConfiguration<?,?> cacheCfg = new CacheConfiguration<>();
-
-        cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setAtomicityMode(ATOMIC);
-        cacheCfg.setBackups(1);
-        cacheCfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
-        cacheCfg.setIndexedTypes(
-            Integer.class, Person.class
-        );
-
-        cfg.setCacheConfiguration(cacheCfg);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTestsStarted() throws Exception {
-        startGridsMultiThreaded(3, false);
-
-        cache = grid(0).cache(null);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTestsStopped() throws Exception {
-        stopAllGrids();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testQueryPut() throws Exception {
-        final AtomicBoolean end = new AtomicBoolean();
-
-        IgniteInternalFuture<?> fut = multithreadedAsync(new Callable<Void>() {
-            @Override public Void call() throws Exception {
-                ThreadLocalRandom rnd = ThreadLocalRandom.current();
-
-                while(!end.get()) {
-                    if (rnd.nextInt(5) == 0) {
-                        double salary = rnd.nextDouble() * RANGE * 1000;
-
-                        double maxSalary = salary + 1000;
-
-                        Collection<Cache.Entry<Integer, Object>> entries = executeQuery(salary, maxSalary);
-
-                        for (Cache.Entry<Integer, Object> entry : entries) {
-                            Person p = (Person)entry.getValue();
-
-                            if (p.getSalary() < salary || p.getSalary() > maxSalary)
-                                throw new Exception("Invalid person retrieved [min=" + salary + ", max=" + maxSalary +
-                                    ", person=" + p + ']');
-                        }
-                    }
-                    else {
-                        int i = rnd.nextInt(RANGE);
-
-                        cache.put(i, new Person(i, "firstName" + i, "lastName" + i, i * 1000));
-                    }
-                }
-
-                return null;
-            }
-        }, 64);
-
-        Thread.sleep(30 * 1000);
-
-        end.set(true);
-
-        fut.get();
-    }
-
-
-
-    /**
-     * @param minSalary Min salary.
-     * @param maxSalary Max salary.
-     * @return Query result.
-     * @throws Exception If failed.
-     */
-    private Collection<Cache.Entry<Integer, Object>> executeQuery(double minSalary, double maxSalary) throws Exception {
-        SqlQuery qry = new SqlQuery(Person.class, "salary >= ? and salary <= ?");
-
-        qry.setArgs(minSalary, maxSalary);
-
-        return cache.query(qry).getAll();
-    }
-
-    /**
-     * Person record used for query test.
-     */
-    public static class Person implements Serializable {
-        /** Person ID. */
-        @QuerySqlField(index = true)
-        private int id;
-
-        /** Organization ID. */
-        @QuerySqlField(index = true)
-        private int orgId;
-
-        /** First name (not-indexed). */
-        @QuerySqlField
-        private String firstName;
-
-        /** Last name (not indexed). */
-        @QuerySqlField
-        private String lastName;
-
-        /** Salary. */
-        @QuerySqlField(index = true)
-        private double salary;
-
-        /**
-         * Constructs empty person.
-         */
-        public Person() {
-            // No-op.
-        }
-
-        /**
-         * Constructs person record that is not linked to any organization.
-         *
-         * @param id Person ID.
-         * @param firstName First name.
-         * @param lastName Last name.
-         * @param salary Salary.
-         */
-        public Person(int id, String firstName, String lastName, double salary) {
-            this(id, 0, firstName, lastName, salary);
-        }
-
-        /**
-         * Constructs person record.
-         *
-         * @param id Person ID.
-         * @param orgId Organization ID.
-         * @param firstName First name.
-         * @param lastName Last name.
-         * @param salary Salary.
-         */
-        public Person(int id, int orgId, String firstName, String lastName, double salary) {
-            this.id = id;
-            this.orgId = orgId;
-            this.firstName = firstName;
-            this.lastName = lastName;
-            this.salary = salary;
-        }
-
-        /**
-         * @return Person id.
-         */
-        public int getId() {
-            return id;
-        }
-
-        /**
-         * @param id Person id.
-         */
-        public void setId(int id) {
-            this.id = id;
-        }
-
-        /**
-         * @return Organization id.
-         */
-        public int getOrganizationId() {
-            return orgId;
-        }
-
-        /**
-         * @param orgId Organization id.
-         */
-        public void setOrganizationId(int orgId) {
-            this.orgId = orgId;
-        }
-
-        /**
-         * @return Person first name.
-         */
-        public String getFirstName() {
-            return firstName;
-        }
-
-        /**
-         * @param firstName Person first name.
-         */
-        public void setFirstName(String firstName) {
-            this.firstName = firstName;
-        }
-
-        /**
-         * @return Person last name.
-         */
-        public String getLastName() {
-            return lastName;
-        }
-
-        /**
-         * @param lastName Person last name.
-         */
-        public void setLastName(String lastName) {
-            this.lastName = lastName;
-        }
-
-        /**
-         * @return Salary.
-         */
-        public double getSalary() {
-            return salary;
-        }
-
-        /**
-         * @param salary Salary.
-         */
-        public void setSalary(double salary) {
-            this.salary = salary;
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object o) {
-            return this == o || (o instanceof Person) && id == ((Person)o).id;
-        }
-
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            return id;
-        }
-
-        /** {@inheritDoc} */
-        @Override public String toString() {
-            return "Person [firstName=" + firstName +
-                ", id=" + id +
-                ", orgId=" + orgId +
-                ", lastName=" + lastName +
-                ", salary=" + salary +
-                ']';
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueriesLoadTest1.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueriesLoadTest1.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueriesLoadTest1.java
index dcc5647..7787ce2 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueriesLoadTest1.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueriesLoadTest1.java
@@ -57,7 +57,6 @@ import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_TIERED;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
 import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
@@ -160,7 +159,6 @@ public class IgniteCacheQueriesLoadTest1 extends GridCommonAbstractTest {
         parentCfg.setAffinity(aff);
         parentCfg.setAtomicityMode(TRANSACTIONAL);
         parentCfg.setCacheMode(PARTITIONED);
-        parentCfg.setMemoryMode(OFFHEAP_TIERED);
         parentCfg.setBackups(2);
         parentCfg.setWriteSynchronizationMode(FULL_SYNC);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedOffHeapTieredSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedOffHeapTieredSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedOffHeapTieredSelfTest.java
deleted file mode 100644
index 630dfd9..0000000
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedOffHeapTieredSelfTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-import org.apache.ignite.cache.CacheMemoryMode;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.configuration.CacheConfiguration;
-
-/**
- * Test queries in off-heap tiered mode.
- */
-public class IgniteCacheQueryMultiThreadedOffHeapTieredSelfTest extends IgniteCacheQueryMultiThreadedSelfTest {
-    /** {@inheritDoc} */
-    @Override protected CacheConfiguration cacheConfiguration() {
-        CacheConfiguration ccfg = super.cacheConfiguration();
-
-        ccfg.setCacheMode(CacheMode.REPLICATED);
-        ccfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
-        ccfg.setOffHeapMaxMemory(0);
-
-        return ccfg;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
index 54ef4fe..1f2ec99 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
@@ -31,7 +31,6 @@ import javax.cache.Cache;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.cache.CacheMemoryMode;
 import org.apache.ignite.cache.CachePeekMode;
 import org.apache.ignite.cache.eviction.lru.LruEvictionPolicy;
 import org.apache.ignite.cache.query.ScanQuery;
@@ -121,11 +120,7 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
         }
 
         cacheCfg.setEvictionPolicy(plc);
-
-        cacheCfg.setSqlOnheapRowCacheSize(128);
-
-        if (offheapEnabled())
-            cacheCfg.setOffHeapMaxMemory(evictsEnabled() ? 1000 : 0); // Small offheap for evictions.
+        cacheCfg.setOnheapCacheEnabled(plc != null);
 
         return cacheCfg;
     }
@@ -163,11 +158,6 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
         }
     }
 
-    /** @return {@code true} If offheap enabled. */
-    protected boolean offheapEnabled() {
-        return false;
-    }
-
     /** @return {@code true} If evictions enabled. */
     protected boolean evictsEnabled() {
         return false;
@@ -273,9 +263,6 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
         // Put test values into cache.
         final IgniteCache<Integer, String> c = cache(Integer.class, String.class);
 
-        if (c.getConfiguration(CacheConfiguration.class).getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
-            return;
-
         assertEquals(0, g.cache(null).localSize());
         assertEquals(0, c.query(new SqlQuery(String.class, "1 = 1")).getAll().size());
 
@@ -346,9 +333,6 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
         // Put test values into cache.
         final IgniteCache<Integer, Long> c = cache(Integer.class, Long.class);
 
-        if (c.getConfiguration(CacheConfiguration.class).getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
-            return;
-
         assertEquals(0, g.cache(null).localSize());
         assertEquals(0, c.query(new SqlQuery(Long.class, "1 = 1")).getAll().size());
 
@@ -422,9 +406,6 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
         // Put test values into cache.
         final IgniteCache<Integer, Object> c = cache(Integer.class, Object.class);
 
-        if (c.getConfiguration(CacheConfiguration.class).getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
-            return;
-
         assertEquals(0, g.cache(null).size());
         assertEquals(0, c.query(new SqlQuery(Object.class, "1 = 1")).getAll().size());
 
@@ -496,9 +477,6 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
         // Put test values into cache.
         final IgniteCache<Integer, TestValue> c = cache(Integer.class, TestValue.class);
 
-        if (c.getConfiguration(CacheConfiguration.class).getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
-            return;
-
         assertEquals(0, g.cache(null).localSize());
         assertEquals(0, c.query(new SqlQuery(TestValue.class, "1 = 1")).getAll().size());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest.java
deleted file mode 100644
index d7d2b5a..0000000
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-/**
- * Multi-threaded tests for cache queries.
- */
-public class IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest extends IgniteCacheQueryOffheapMultiThreadedSelfTest {
-    /** {@inheritDoc} */
-    @Override protected boolean evictsEnabled() {
-        return true;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryOffheapMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryOffheapMultiThreadedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryOffheapMultiThreadedSelfTest.java
deleted file mode 100644
index db132b8..0000000
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryOffheapMultiThreadedSelfTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-/**
- * Queries over off-heap indexes.
- */
-public class IgniteCacheQueryOffheapMultiThreadedSelfTest extends IgniteCacheQueryMultiThreadedSelfTest {
-    /** {@inheritDoc} */
-    @Override protected boolean offheapEnabled() {
-        return true;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCrossCachesJoinsQueryTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCrossCachesJoinsQueryTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCrossCachesJoinsQueryTest.java
index 6dd0d93..cd35788 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCrossCachesJoinsQueryTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCrossCachesJoinsQueryTest.java
@@ -35,7 +35,6 @@ import java.util.concurrent.Callable;
 import javax.cache.CacheException;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.CacheMemoryMode;
 import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.cache.QueryEntity;
 import org.apache.ignite.cache.QueryIndex;
@@ -56,8 +55,6 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.testframework.GridTestUtils;
 
-import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_TIERED;
-import static org.apache.ignite.cache.CacheMemoryMode.ONHEAP_TIERED;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.cache.CacheMode.REPLICATED;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
@@ -100,9 +97,6 @@ public class IgniteCrossCachesJoinsQueryTest extends AbstractH2CompareQueryTest
     /** */
     private static Random rnd;
 
-    /** */
-    private CacheMemoryMode memMode = ONHEAP_TIERED;
-
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
@@ -335,15 +329,6 @@ public class IgniteCrossCachesJoinsQueryTest extends AbstractH2CompareQueryTest
     /**
      * @throws Exception If failed.
      */
-    public void testDistributedJoins1Offheap() throws Exception {
-        memMode = OFFHEAP_TIERED;
-
-        testDistributedJoins1();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     public void testDistributedJoins2() throws Exception {
         distributedJoins = true;
 
@@ -737,7 +722,6 @@ public class IgniteCrossCachesJoinsQueryTest extends AbstractH2CompareQueryTest
         CacheConfiguration ccfg = new CacheConfiguration();
 
         ccfg.setName(cacheName);
-        ccfg.setMemoryMode(memMode);
         ccfg.setCacheMode(cacheMode);
 
         if (cacheMode == PARTITIONED)

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java
index d022b0f..8367b2c 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartDistributedJoinSelfTest.java
@@ -175,7 +175,8 @@ public class IgniteCacheQueryNodeRestartDistributedJoinSelfTest extends IgniteCa
                         if (c % logFreq == 0)
                             info("Executed queries: " + c);
                     }
-                }catch (Throwable e){
+                }
+                catch (Throwable e){
                     e.printStackTrace();
 
                     error("Got exception: " + e.getMessage());
@@ -193,40 +194,47 @@ public class IgniteCacheQueryNodeRestartDistributedJoinSelfTest extends IgniteCa
         IgniteInternalFuture<?> fut2 = multithreadedAsync(new Callable<Object>() {
             @SuppressWarnings({"BusyWait"})
             @Override public Object call() throws Exception {
-                GridRandom rnd = new GridRandom();
+                try {
+                    GridRandom rnd = new GridRandom();
 
-                while (!restartsDone.get()) {
-                    int g;
+                    while (!restartsDone.get()) {
+                        int g;
 
-                    do {
-                        g = rnd.nextInt(locks.length());
+                        do {
+                            g = rnd.nextInt(locks.length());
 
-                        if (fail.get())
-                            return null;
-                    }
-                    while (!locks.compareAndSet(g, 0, -1));
+                            if (fail.get())
+                                return null;
+                        }
+                        while (!locks.compareAndSet(g, 0, -1));
 
-                    log.info("Stop node: " + g);
+                        log.info("Stop node: " + g);
 
-                    stopGrid(g);
+                        stopGrid(g);
 
-                    Thread.sleep(rnd.nextInt(nodeLifeTime));
+                        Thread.sleep(rnd.nextInt(nodeLifeTime));
 
-                    log.info("Start node: " + g);
+                        log.info("Start node: " + g);
 
-                    startGrid(g);
+                        startGrid(g);
 
-                    Thread.sleep(rnd.nextInt(nodeLifeTime));
+                        Thread.sleep(rnd.nextInt(nodeLifeTime));
 
-                    locks.set(g, 0);
+                        locks.set(g, 0);
 
-                    int c = restartCnt.incrementAndGet();
+                        int c = restartCnt.incrementAndGet();
 
-                    if (c % logFreq == 0)
-                        info("Node restarts: " + c);
+                        if (c % logFreq == 0)
+                            info("Node restarts: " + c);
+                    }
+
+                    return true;
                 }
+                catch (Throwable e) {
+                    e.printStackTrace();
 
-                return true;
+                    return true;
+                }
             }
         }, restartThreadsNum, "restart-thread");
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
index 484c99b..02b6b3b 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAbstractSelfTest.java
@@ -31,7 +31,6 @@ import javax.cache.integration.CompletionListenerFuture;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteDataStreamer;
 import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMemoryMode;
 import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.cache.eviction.lru.LruEvictionPolicy;
 import org.apache.ignite.cache.query.SqlQuery;
@@ -78,13 +77,12 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
 
         ccfg.setCacheMode(cacheMode());
         ccfg.setAtomicityMode(atomicityMode());
-        ccfg.setMemoryMode(memoryMode());
-        ccfg.setOffHeapMaxMemory(0);
 
         LruEvictionPolicy plc = new LruEvictionPolicy();
         plc.setMaxSize(MAX_CACHE_SIZE);
 
         ccfg.setEvictionPolicy(plc);
+        ccfg.setOnheapCacheEnabled(true);
         ccfg.setIndexedTypes(Integer.class, Integer.class);
         ccfg.setBackups(2);
         ccfg.setWriteSynchronizationMode(FULL_SYNC);
@@ -125,11 +123,6 @@ public abstract class CacheTtlAbstractSelfTest extends GridCommonAbstractTest {
     protected abstract CacheAtomicityMode atomicityMode();
 
     /**
-     * @return Memory mode.
-     */
-    protected abstract CacheMemoryMode memoryMode();
-
-    /**
      * @return Cache mode.
      */
     protected abstract CacheMode cacheMode();

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAtomicAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAtomicAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAtomicAbstractSelfTest.java
new file mode 100644
index 0000000..51054c4
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAtomicAbstractSelfTest.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+
+/**
+ * TTL test with offheap.
+ */
+public abstract class CacheTtlAtomicAbstractSelfTest extends CacheTtlAbstractSelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return CacheAtomicityMode.ATOMIC;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAtomicLocalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAtomicLocalSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAtomicLocalSelfTest.java
new file mode 100644
index 0000000..3644636
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAtomicLocalSelfTest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.CacheMode;
+
+/**
+ * TTL test with offheap.
+ */
+public class CacheTtlAtomicLocalSelfTest extends CacheTtlAtomicAbstractSelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return CacheMode.LOCAL;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 1;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAtomicPartitionedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAtomicPartitionedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAtomicPartitionedSelfTest.java
new file mode 100644
index 0000000..5c1a484
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlAtomicPartitionedSelfTest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache.ttl;
+
+import org.apache.ignite.cache.*;
+
+/**
+ * TTL test with offheap.
+ */
+public class CacheTtlAtomicPartitionedSelfTest extends CacheTtlAtomicAbstractSelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return CacheMode.PARTITIONED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 2;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAbstractSelfTest.java
deleted file mode 100644
index 59ed837..0000000
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAbstractSelfTest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.ignite.internal.processors.cache.ttl;
-
-import org.apache.ignite.cache.*;
-
-/**
- * TTL test with offheap.
- */
-public abstract class CacheTtlOffheapAbstractSelfTest extends CacheTtlAbstractSelfTest {
-    /** {@inheritDoc} */
-    @Override protected CacheMemoryMode memoryMode() {
-        return CacheMemoryMode.OFFHEAP_TIERED;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicAbstractSelfTest.java
deleted file mode 100644
index 6afb4d0..0000000
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicAbstractSelfTest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.ignite.internal.processors.cache.ttl;
-
-import org.apache.ignite.cache.CacheAtomicityMode;
-
-/**
- * TTL test with offheap.
- */
-public abstract class CacheTtlOffheapAtomicAbstractSelfTest extends CacheTtlOffheapAbstractSelfTest {
-    /** {@inheritDoc} */
-    @Override protected CacheAtomicityMode atomicityMode() {
-        return CacheAtomicityMode.ATOMIC;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicLocalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicLocalSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicLocalSelfTest.java
deleted file mode 100644
index da6631a..0000000
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ttl/CacheTtlOffheapAtomicLocalSelfTest.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.ignite.internal.processors.cache.ttl;
-
-import org.apache.ignite.cache.CacheMode;
-
-/**
- * TTL test with offheap.
- */
-public class CacheTtlOffheapAtomicLocalSelfTest extends CacheTtlOffheapAtomicAbstractSelfTest {
-    /** {@inheritDoc} */
-    @Override protected CacheMode cacheMode() {
-        return CacheMode.LOCAL;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return 1;
-    }
-}
\ No newline at end of file