ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [07/47] ignite git commit: IGNITE-5267 - Moved ignite-ps module to ignite-core
Date Sun, 11 Jun 2017 20:03:33 GMT
http://git-wip-us.apache.org/repos/asf/ignite/blob/6bf5ce46/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreDataStructuresTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreDataStructuresTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreDataStructuresTest.java
deleted file mode 100644
index 718cf54..0000000
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreDataStructuresTest.java
+++ /dev/null
@@ -1,196 +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.cache.database;
-
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteAtomicLong;
-import org.apache.ignite.IgniteAtomicSequence;
-import org.apache.ignite.IgniteQueue;
-import org.apache.ignite.IgniteSet;
-import org.apache.ignite.configuration.CollectionConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.MemoryConfiguration;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
-import org.apache.ignite.configuration.PersistentStoreConfiguration;
-import org.apache.ignite.configuration.WALMode;
-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.GridTestUtils;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-/**
- *
- */
-public class IgnitePersistentStoreDataStructuresTest extends GridCommonAbstractTest {
-    /** */
-    private static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
-
-        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
-
-        MemoryConfiguration dbCfg = new MemoryConfiguration();
-
-        MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
-
-        memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setInitialSize(200 * 1024 * 1024);
-        memPlcCfg.setMaxSize(200 * 1024 * 1024);
-
-        dbCfg.setMemoryPolicies(memPlcCfg);
-        dbCfg.setDefaultMemoryPolicyName("dfltMemPlc");
-
-        cfg.setMemoryConfiguration(dbCfg);
-
-        cfg.setPersistentStoreConfiguration(new PersistentStoreConfiguration().setWalMode(WALMode.LOG_ONLY));
-
-        cfg.setActiveOnStart(false);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTestsStopped() throws Exception {
-        GridTestUtils.deleteDbFiles();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        super.beforeTest();
-
-        GridTestUtils.deleteDbFiles();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        super.afterTest();
-
-        stopAllGrids();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testQueue() throws Exception {
-        Ignite ignite = startGrids(4);
-
-        ignite.active(true);
-
-        IgniteQueue<Object> queue = ignite.queue("testQueue", 100, new CollectionConfiguration());
-
-        for (int i = 0; i < 100; i++)
-            queue.offer(i);
-
-        stopAllGrids();
-
-        ignite = startGrids(4);
-
-        ignite.active(true);
-
-        queue = ignite.queue("testQueue", 0, null);
-
-        for (int i = 0; i < 100; i++)
-            assertEquals(i, queue.poll());
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testAtomic() throws Exception {
-        Ignite ignite = startGrids(4);
-
-        ignite.active(true);
-
-        IgniteAtomicLong atomicLong = ignite.atomicLong("testLong", 0, true);
-
-        for (int i = 0; i < 100; i++)
-            atomicLong.incrementAndGet();
-
-        stopAllGrids();
-
-        ignite = startGrids(4);
-
-        ignite.active(true);
-
-        atomicLong = ignite.atomicLong("testLong", 0, false);
-
-        for (int i = 100; i != 0; )
-            assertEquals(i--, atomicLong.getAndDecrement());
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testSequence() throws Exception {
-        Ignite ignite = startGrids(4);
-
-        ignite.active(true);
-
-        IgniteAtomicSequence sequence = ignite.atomicSequence("testSequence", 0, true);
-
-        int i = 0;
-
-        while (i < 1000) {
-            sequence.incrementAndGet();
-
-            i++;
-        }
-
-        stopAllGrids();
-
-        ignite = startGrids(4);
-
-        ignite.active(true);
-
-        sequence = ignite.atomicSequence("testSequence", 0, false);
-
-        assertTrue(sequence.incrementAndGet() > i);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testSet() throws Exception {
-        Ignite ignite = startGrids(4);
-
-        ignite.active(true);
-
-        IgniteSet<Object> set = ignite.set("testSet", new CollectionConfiguration());
-
-        for (int i = 0; i < 100; i++)
-            set.add(i);
-
-        stopAllGrids();
-
-        ignite = startGrids(4);
-
-        ignite.active(true);
-
-        set = ignite.set("testSet", null);
-
-        assertFalse(set.add(99));
-
-        for (int i = 0; i < 100; i++)
-            assertTrue(set.contains(i));
-
-        assertEquals(100, set.size());
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/6bf5ce46/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreSchemaLoadTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreSchemaLoadTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreSchemaLoadTest.java
deleted file mode 100644
index bed17ac..0000000
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreSchemaLoadTest.java
+++ /dev/null
@@ -1,297 +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.cache.database;
-
-import java.io.Serializable;
-import java.util.Arrays;
-import java.util.LinkedHashMap;
-import java.util.concurrent.atomic.AtomicInteger;
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheRebalanceMode;
-import org.apache.ignite.cache.QueryEntity;
-import org.apache.ignite.cache.QueryIndex;
-import org.apache.ignite.cache.QueryIndexType;
-import org.apache.ignite.cache.query.annotations.QuerySqlField;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.PersistentStoreConfiguration;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.IgniteInterruptedCheckedException;
-import org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor;
-import org.apache.ignite.internal.processors.cache.database.DbCheckpointListener;
-import org.apache.ignite.internal.processors.cache.database.GridCacheDatabaseSharedManager;
-import org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing;
-import org.apache.ignite.internal.util.lang.GridAbsPredicate;
-import org.apache.ignite.internal.util.typedef.internal.U;
-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.GridTestUtils;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK;
-
-/**
- *
- */
-public class IgnitePersistentStoreSchemaLoadTest extends GridCommonAbstractTest {
-    /** */
-    private static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
-    /** Index name. */
-    private static final String IDX_NAME = "my_idx";
-
-    /** Cache name. */
-    private static final String TMPL_NAME = "test_cache*";
-
-    /** Table name. */
-    private static final String TBL_NAME = Person.class.getSimpleName();
-
-    /** Schema name. */
-    private static final String SCHEMA_NAME = "PUBLIC";
-
-    /** Cache name. */
-    private static final String CACHE_NAME = TBL_NAME;
-
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
-
-        cfg.setCacheConfiguration(cacheCfg(TMPL_NAME));
-
-        PersistentStoreConfiguration pCfg = new PersistentStoreConfiguration();
-
-        pCfg.setCheckpointingFrequency(1000);
-
-        cfg.setPersistentStoreConfiguration(pCfg);
-
-        return cfg;
-    }
-
-    /** */
-    private CacheConfiguration cacheCfg(String name) {
-        CacheConfiguration<?, ?> cfg = new CacheConfiguration<>();
-
-        cfg.setName(name);
-
-        cfg.setRebalanceMode(CacheRebalanceMode.NONE);
-
-        cfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
-
-        return cfg;
-    }
-
-    /** */
-    private QueryEntity getEntity() {
-        LinkedHashMap<String, String> fields = new LinkedHashMap<>();
-
-        fields.put("id", Integer.class.getName());
-        fields.put("name", String.class.getName());
-
-        QueryEntity entity = new QueryEntity(Integer.class.getName(), Person.class.getName());
-        entity.setFields(fields);
-        entity.setTableName(TBL_NAME);
-
-        return entity;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        System.setProperty(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK, "true");
-
-        stopAllGrids();
-
-        deleteWorkFiles();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        stopAllGrids();
-
-        deleteWorkFiles();
-
-        System.clearProperty(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK);
-    }
-
-    /** */
-    public void testPersistIndex() throws Exception {
-        IgniteEx ig0 = startGrid(0);
-        startGrid(1);
-
-        final AtomicInteger cnt = new AtomicInteger();
-
-        GridCacheDatabaseSharedManager db = (GridCacheDatabaseSharedManager)ig0.context().cache().context().database();
-
-        db.addCheckpointListener(new DbCheckpointListener() {
-            @Override public void onCheckpointBegin(Context context) {
-                cnt.incrementAndGet();
-            }
-        });
-
-        QueryIndex idx = new QueryIndex("name");
-
-        idx.setName(IDX_NAME);
-
-        ig0.context().query().dynamicTableCreate(SCHEMA_NAME, getEntity(), TMPL_NAME, null, null, null, 1, true);
-
-        assert indexCnt(ig0, CACHE_NAME) == 0;
-
-        ig0.context().query().dynamicIndexCreate(CACHE_NAME, SCHEMA_NAME, TBL_NAME, idx, false).get();
-
-        assert indexCnt(ig0, CACHE_NAME) == 1;
-
-        waitForCheckpoint(cnt);
-
-        stopGrid(1);
-
-        IgniteEx ig1 = startGrid(1);
-
-        assert indexCnt(ig1, CACHE_NAME) == 1;
-    }
-
-    /** */
-    public void testPersistCompositeIndex() throws Exception {
-        IgniteEx ig0 = startGrid(0);
-        startGrid(1);
-
-        final AtomicInteger cnt = new AtomicInteger();
-
-        GridCacheDatabaseSharedManager db = (GridCacheDatabaseSharedManager)ig0.context().cache().context().database();
-
-        db.addCheckpointListener(new DbCheckpointListener() {
-            @Override public void onCheckpointBegin(Context context) {
-                cnt.incrementAndGet();
-            }
-        });
-
-        ig0.context().query().dynamicTableCreate(SCHEMA_NAME, getEntity(), TMPL_NAME, null, null, null, 1, true);
-
-        assert indexCnt(ig0, CACHE_NAME) == 0;
-
-        QueryIndex idx = new QueryIndex(Arrays.asList("id", "name"), QueryIndexType.SORTED);
-
-        idx.setName(IDX_NAME);
-
-        ig0.context().query().dynamicIndexCreate(CACHE_NAME, SCHEMA_NAME, TBL_NAME, idx, false).get();
-
-        assert indexCnt(ig0, CACHE_NAME) == 1;
-
-        waitForCheckpoint(cnt);
-
-        stopGrid(1);
-
-        IgniteEx ig1 = startGrid(1);
-
-        assert indexCnt(ig1, CACHE_NAME) == 1;
-    }
-
-    /** */
-    private void waitForCheckpoint(final AtomicInteger cnt) throws IgniteInterruptedCheckedException {
-        final int i = cnt.get();
-
-        GridTestUtils.waitForCondition(new GridAbsPredicate() {
-            @Override public boolean apply() {
-                return cnt.get() > i;
-            }
-        }, 2000);
-    }
-
-    /** */
-    private int indexCnt(IgniteEx node, String cacheName) {
-
-        DynamicCacheDescriptor desc = node.context().cache().cacheDescriptor(cacheName);
-
-        int cnt = 0;
-
-        for (QueryEntity entity : desc.schema().entities()) {
-            cnt += entity.getIndexes().size();
-        }
-
-        return cnt;
-    }
-
-    /**
-     * @return Indexing.
-     */
-    private IgniteH2Indexing getIndexing(IgniteEx ignite) {
-        return U.field(ignite.context().query(), "idx");
-    }
-
-    /**
-     *
-     */
-    private void deleteWorkFiles() throws IgniteCheckedException {
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-    }
-
-    /**
-     *
-     */
-    protected static class Person implements Serializable {
-        /** */
-        private static final long serialVersionUID = 0L;
-
-        /** */
-        @SuppressWarnings("unused")
-        private Person() {
-            // No-op.
-        }
-
-        /** */
-        public Person(int id) {
-            this.id = id;
-        }
-
-        /** */
-        @QuerySqlField
-        protected int id;
-
-        /** */
-        @QuerySqlField
-        protected String name;
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object o) {
-            if (this == o)
-                return true;
-
-            if (o == null || getClass() != o.getClass())
-                return false;
-
-            IgnitePersistentStoreSchemaLoadTest.Person person = (IgnitePersistentStoreSchemaLoadTest.Person)o;
-
-            if (id != person.id)
-                return false;
-
-            return name != null ? name.equals(person.name) : person.name == null;
-        }
-
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            int result = id;
-
-            result = 31 * result + (name != null ? name.hashCode() : 0);
-
-            return result;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/6bf5ce46/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsMultiNodePutGetRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsMultiNodePutGetRestartTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsMultiNodePutGetRestartTest.java
deleted file mode 100644
index 41b1b29..0000000
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsMultiNodePutGetRestartTest.java
+++ /dev/null
@@ -1,242 +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.cache.database.db;
-
-import java.io.File;
-import java.io.Serializable;
-import java.util.List;
-import java.util.UUID;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteDataStreamer;
-import org.apache.ignite.cache.CacheRebalanceMode;
-import org.apache.ignite.cache.CacheWriteSynchronizationMode;
-import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
-import org.apache.ignite.cache.query.SqlFieldsQuery;
-import org.apache.ignite.cache.query.annotations.QuerySqlField;
-import org.apache.ignite.configuration.BinaryConfiguration;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
-import org.apache.ignite.configuration.PersistentStoreConfiguration;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-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 org.apache.ignite.configuration.MemoryConfiguration;
-
-/**
- *
- */
-public class IgnitePdsMultiNodePutGetRestartTest extends GridCommonAbstractTest {
-    /** */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** */
-    private static final int GRID_CNT = 3;
-
-    /** */
-    private static final String CACHE_NAME = "cache";
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        MemoryConfiguration dbCfg = new MemoryConfiguration();
-
-        MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
-
-        memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setInitialSize(100 * 1024 * 1024);
-        memPlcCfg.setMaxSize(100 * 1024 * 1024);
-
-        dbCfg.setDefaultMemoryPolicyName("dfltMemPlc");
-        dbCfg.setMemoryPolicies(memPlcCfg);
-
-        cfg.setMemoryConfiguration(dbCfg);
-
-        CacheConfiguration ccfg = new CacheConfiguration(CACHE_NAME);
-
-        ccfg.setIndexedTypes(Integer.class, DbValue.class);
-
-        ccfg.setRebalanceMode(CacheRebalanceMode.NONE);
-
-        ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
-
-        ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-
-        cfg.setCacheConfiguration(ccfg);
-
-        cfg.setPersistentStoreConfiguration(new PersistentStoreConfiguration());
-        cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(IP_FINDER));
-
-        cfg.setMarshaller(null);
-
-        BinaryConfiguration bCfg = new BinaryConfiguration();
-
-        bCfg.setCompactFooter(false);
-
-        cfg.setBinaryConfiguration(bCfg);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-
-        super.beforeTest();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        super.afterTest();
-
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-    }
-
-    /**
-     * @throws Exception if failed.
-     */
-    public void testPutGetSimple() throws Exception {
-        String home = U.getIgniteHome();
-
-        File allocPath = new File(home, "work/db/" + UUID.randomUUID());
-
-        allocPath.mkdirs();
-
-        info(">>> Will use path: " + allocPath);
-
-        startGrids(GRID_CNT);
-
-        try {
-            IgniteEx ig = grid(0);
-
-            checkPutGetSql(ig, true);
-        }
-        finally {
-            stopAllGrids();
-        }
-
-        info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
-        info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
-        info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
-
-        startGrids(GRID_CNT);
-
-        try {
-            IgniteEx ig = grid(0);
-
-            checkPutGetSql(ig, false);
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @param ig Ig.
-     * @param write Write.
-     */
-    private void checkPutGetSql(IgniteEx ig, boolean write) {
-        IgniteCache<Integer, DbValue> cache = ig.cache(CACHE_NAME);
-
-        if (write) {
-            try (IgniteDataStreamer<Object, Object> streamer = ig.dataStreamer(CACHE_NAME)) {
-                for (int i = 0; i < 10_000; i++)
-                    streamer.addData(i, new DbValue(i, "value-" + i, i));
-            }
-        }
-
-        List<List<?>> res = cache.query(new SqlFieldsQuery("select ival from dbvalue where ival < ? order by ival asc")
-                .setArgs(10_000)).getAll();
-
-        assertEquals(10_000, res.size());
-
-        for (int i = 0; i < 10_000; i++) {
-            assertEquals(1, res.get(i).size());
-            assertEquals(i, res.get(i).get(0));
-        }
-
-        assertEquals(1, cache.query(new SqlFieldsQuery("select lval from dbvalue where ival = 7899")).getAll().size());
-        assertEquals(5000, cache.query(new SqlFieldsQuery("select lval from dbvalue where ival >= 5000 and ival < 10000"))
-                .getAll().size());
-
-        for (int i = 0; i < 10_000; i++)
-            assertEquals(new DbValue(i, "value-" + i, i), cache.get(i));
-    }
-
-    /**
-     *
-     */
-    private static class DbValue implements Serializable {
-        /** */
-        @QuerySqlField(index = true)
-        private int iVal;
-
-        /** */
-        @QuerySqlField(index = true)
-        private String sVal;
-
-        /** */
-        @QuerySqlField
-        private long lVal;
-
-        /**
-         * @param iVal Integer value.
-         * @param sVal String value.
-         * @param lVal Long value.
-         */
-        public DbValue(int iVal, String sVal, long lVal) {
-            this.iVal = iVal;
-            this.sVal = sVal;
-            this.lVal = lVal;
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object o) {
-            if (this == o)
-                return true;
-
-            if (o == null || getClass() != o.getClass())
-                return false;
-
-            DbValue dbVal = (DbValue)o;
-
-            return iVal == dbVal.iVal && lVal == dbVal.lVal &&
-                !(sVal != null ? !sVal.equals(dbVal.sVal) : dbVal.sVal != null);
-        }
-
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            int res = iVal;
-
-            res = 31 * res + (sVal != null ? sVal.hashCode() : 0);
-            res = 31 * res + (int)(lVal ^ (lVal >>> 32));
-
-            return res;
-        }
-
-        /** {@inheritDoc} */
-        @Override public String toString() {
-            return S.toString(DbValue.class, this);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/6bf5ce46/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsPageEvictionDuringPartitionClearTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsPageEvictionDuringPartitionClearTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsPageEvictionDuringPartitionClearTest.java
deleted file mode 100644
index b4ffde8..0000000
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsPageEvictionDuringPartitionClearTest.java
+++ /dev/null
@@ -1,174 +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.cache.database.db;
-
-import java.util.concurrent.Callable;
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteDataStreamer;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheRebalanceMode;
-import org.apache.ignite.cache.CacheWriteSynchronizationMode;
-import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.MemoryConfiguration;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
-import org.apache.ignite.configuration.PersistentStoreConfiguration;
-import org.apache.ignite.configuration.WALMode;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.IgniteInternalFuture;
-import org.apache.ignite.internal.processors.cache.database.GridCacheDatabaseSharedManager;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-/**
- *
- */
-public class IgnitePdsPageEvictionDuringPartitionClearTest extends GridCommonAbstractTest {
-    /** */
-    public static final String CACHE_NAME = "cache";
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        CacheConfiguration ccfg = new CacheConfiguration(CACHE_NAME)
-            .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL)
-            .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC)
-            .setAffinity(new RendezvousAffinityFunction(false, 128))
-            .setRebalanceMode(CacheRebalanceMode.SYNC)
-            .setBackups(1);
-
-        cfg.setCacheConfiguration(ccfg);
-
-        // Intentionally set small page cache size.
-
-        MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
-
-        memPlcCfg.setInitialSize(70 * 1024 * 1024);
-        memPlcCfg.setMaxSize(70 * 1024 * 1024);
-
-        memPlcCfg.setName("dfltMemPlc");
-
-        MemoryConfiguration memCfg = new MemoryConfiguration();
-
-        memCfg.setMemoryPolicies(memPlcCfg);
-
-        memCfg.setDefaultMemoryPolicyName(memPlcCfg.getName());
-
-        cfg.setMemoryConfiguration(memCfg);
-
-        cfg.setPersistentStoreConfiguration(
-            new PersistentStoreConfiguration()
-                .setWalMode(WALMode.LOG_ONLY)
-        );
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected long getTestTimeout() {
-        return 20 * 60 * 1000;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTestsStarted() throws Exception {
-        System.setProperty(GridCacheDatabaseSharedManager.IGNITE_PDS_CHECKPOINT_TEST_SKIP_SYNC, "true");
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTestsStopped() throws Exception {
-        System.clearProperty(GridCacheDatabaseSharedManager.IGNITE_PDS_CHECKPOINT_TEST_SKIP_SYNC);
-    }
-
-    /**
-     * @throws Exception if failed.
-     */
-    public void testPageEvictionOnNodeStart() throws Exception {
-        for (int r = 0; r < 3; r++) {
-            deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-
-            startGrids(2);
-
-            try {
-                Ignite ig = ignite(0);
-
-                IgniteDataStreamer<Object, Object> streamer = ig.dataStreamer(CACHE_NAME);
-
-                for (int i = 0; i < 300_000; i++) {
-                    streamer.addData(i, new TestValue(i));
-
-                    if (i > 0 && i % 10_000 == 0)
-                        info("Done: " + i);
-                }
-
-                streamer.flush();
-
-                IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
-                    @Override public Object call() throws Exception {
-                        IgniteEx ig = startGrid(2);
-
-                        info(">>>>>>>>>>>");
-                        info(">>>>>>>>>>>");
-                        info(">>>>>>>>>>>");
-
-                        return ig;
-                    }
-                });
-
-                for (int i = 500_000; i < 1_000_000; i++) {
-                    streamer.addData(i, new TestValue(i));
-
-                    if (i > 0 && i % 10_000 == 0) {
-                        info("Done: " + i);
-
-                        U.sleep(1000);
-                    }
-                }
-
-                streamer.close();
-
-                fut.get();
-            }
-            finally {
-                stopAllGrids();
-
-                deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-            }
-        }
-    }
-
-    /**
-     *
-     */
-    private static class TestValue {
-        /** */
-        private int id;
-
-        /** */
-        private byte[] payload = new byte[512];
-
-        /**
-         * @param id ID.
-         */
-        private TestValue(int id) {
-            this.id = id;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/6bf5ce46/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsPageEvictionTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsPageEvictionTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsPageEvictionTest.java
deleted file mode 100644
index d48617d..0000000
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsPageEvictionTest.java
+++ /dev/null
@@ -1,239 +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.cache.database.db;
-
-import java.io.Serializable;
-import java.util.List;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteDataStreamer;
-import org.apache.ignite.cache.CacheRebalanceMode;
-import org.apache.ignite.cache.CacheWriteSynchronizationMode;
-import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
-import org.apache.ignite.cache.query.SqlFieldsQuery;
-import org.apache.ignite.cache.query.annotations.QuerySqlField;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.MemoryConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
-import org.apache.ignite.configuration.PersistentStoreConfiguration;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-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;
-
-/**
- *
- */
-public class IgnitePdsPageEvictionTest extends GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** Test entry count. */
-    public static final int ENTRY_CNT = 1_000_000;
-
-    /** Cache name. */
-    private static final String CACHE_NAME = "cache";
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        MemoryConfiguration memCfg = new MemoryConfiguration();
-
-        memCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
-
-        memCfg.setPageSize(1024);
-
-        MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
-
-        memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setInitialSize(50 * 1024 * 1024);
-        memPlcCfg.setMaxSize(50 * 1024 * 1024);
-
-        memCfg.setMemoryPolicies(memPlcCfg);
-        memCfg.setDefaultMemoryPolicyName("dfltMemPlc");
-
-        cfg.setMemoryConfiguration(memCfg);
-
-        CacheConfiguration<DbKey, DbValue> ccfg = new CacheConfiguration<>(CACHE_NAME);
-
-        ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        ccfg.setRebalanceMode(CacheRebalanceMode.NONE);
-        ccfg.setIndexedTypes(DbKey.class, DbValue.class);
-        ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
-
-        cfg.setCacheConfiguration(ccfg);
-
-        cfg.setPersistentStoreConfiguration(new PersistentStoreConfiguration());
-
-        cfg.setDiscoverySpi(
-            new TcpDiscoverySpi()
-                .setIpFinder(IP_FINDER)
-        );
-
-        cfg.setMarshaller(null);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-
-        stopAllGrids();
-
-        startGrids(1);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        stopAllGrids();
-
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-    }
-
-    /**
-     * @throws Exception if failed.
-     */
-    public void testPageEvictionSql() throws Exception {
-        IgniteEx ig = grid(0);
-
-        try (IgniteDataStreamer<DbKey, DbValue> streamer = ig.dataStreamer(CACHE_NAME)) {
-            for (int i = 0; i < ENTRY_CNT; i++) {
-                streamer.addData(new DbKey(i), new DbValue(i, "value-" + i, Long.MAX_VALUE - i));
-
-                if (i > 0 && i % 10_000 == 0)
-                    info("Done put: " + i);
-            }
-        }
-
-        IgniteCache<DbKey, DbValue> cache = ignite(0).cache(CACHE_NAME);
-
-        for (int i = 0; i < ENTRY_CNT; i++) {
-            assertEquals(Long.MAX_VALUE - i, cache.get(new DbKey(i)).lVal);
-
-            if (i > 0 && i % 10_000 == 0)
-                info("Done get: " + i);
-        }
-
-        for (int i = 0; i < ENTRY_CNT; i++) {
-            List<List<?>> rows = cache.query(
-                new SqlFieldsQuery("select lVal from DbValue where iVal=?").setArgs(i)
-            ).getAll();
-
-            assertEquals(1, rows.size());
-            assertEquals(Long.MAX_VALUE - i, rows.get(0).get(0));
-
-            if (i > 0 && i % 10_000 == 0)
-                info("Done SQL query: " + i);
-        }
-    }
-
-    /**
-     *
-     */
-    private static class DbKey implements Serializable {
-        /** */
-        private int val;
-
-        /**
-         * @param val Value.
-         */
-        private DbKey(int val) {
-            this.val = val;
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object o) {
-            if (this == o)
-                return true;
-
-            if (o == null || !(o instanceof DbKey))
-                return false;
-
-            DbKey key = (DbKey)o;
-
-            return val == key.val;
-        }
-
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            return val;
-        }
-    }
-
-    /**
-     *
-     */
-    private static class DbValue implements Serializable {
-        /** */
-        @QuerySqlField(index = true)
-        private int iVal;
-
-        /** */
-        @QuerySqlField(index = true)
-        private String sVal;
-
-        /** */
-        @QuerySqlField
-        private long lVal;
-
-        /**
-         * @param iVal Integer value.
-         * @param sVal String value.
-         * @param lVal Long value.
-         */
-        private DbValue(int iVal, String sVal, long lVal) {
-            this.iVal = iVal;
-            this.sVal = sVal;
-            this.lVal = lVal;
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object o) {
-            if (this == o)
-                return true;
-
-            if (o == null || getClass() != o.getClass())
-                return false;
-
-            DbValue dbVal = (DbValue)o;
-
-            return iVal == dbVal.iVal && lVal == dbVal.lVal &&
-                !(sVal != null ? !sVal.equals(dbVal.sVal) : dbVal.sVal != null);
-        }
-
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            int res = iVal;
-
-            res = 31 * res + (sVal != null ? sVal.hashCode() : 0);
-            res = 31 * res + (int)(lVal ^ (lVal >>> 32));
-
-            return res;
-        }
-
-        /** {@inheritDoc} */
-        @Override public String toString() {
-            return S.toString(DbValue.class, this);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/6bf5ce46/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsRebalancingOnNotStableTopologyTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsRebalancingOnNotStableTopologyTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsRebalancingOnNotStableTopologyTest.java
deleted file mode 100644
index dfe174a..0000000
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsRebalancingOnNotStableTopologyTest.java
+++ /dev/null
@@ -1,215 +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.cache.database.db;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.cache.CacheWriteSynchronizationMode;
-import org.apache.ignite.cache.PartitionLossPolicy;
-import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.MemoryConfiguration;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
-import org.apache.ignite.configuration.PersistentStoreConfiguration;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.apache.ignite.testframework.junits.multijvm.IgniteProcessProxy;
-
-/**
- * We start writing to unstable cluster.
- * After that we start killing node.
- * There will be entries in WAL which belongs to evicted partitions.
- * We should ignore them (not throw exceptions). This point is tested.
- */
-public class IgnitePdsRebalancingOnNotStableTopologyTest extends GridCommonAbstractTest {
-    /** Checkpoint frequency. */
-    private static final long CHECKPOINT_FREQUENCY = 2_000_000;
-
-    /** Cluster size. */
-    private static final int CLUSTER_SIZE = 5;
-
-    /** */
-    private static final String CACHE_NAME = "cache1";
-
-    /**
-     * @throws Exception When fails.
-     */
-    public void test() throws Exception {
-        Ignite ex = startGrid(0);
-
-        startGrid(1);
-
-        final CountDownLatch startLatch = new CountDownLatch(1);
-        final CountDownLatch doneLatch = new CountDownLatch(1);
-
-        final Ignite ex1 = ex;
-
-        final AtomicBoolean stop = new AtomicBoolean();
-        final AtomicInteger keyCnt = new AtomicInteger();
-
-        Thread thread = new Thread(new Runnable() {
-            @Override public void run() {
-                ex1.active(true);
-
-                try {
-                    checkTopology(2);
-
-                    startLatch.countDown();
-
-                    IgniteCache<Object, Object> cache1 = ex1.cache(CACHE_NAME);
-
-                    int key = keyCnt.get();
-
-                    while (!stop.get()) {
-                        if (key > 0 && (key % 500 == 0)) {
-                            U.sleep(5);
-
-                            System.out.println("key = " + key);
-                        }
-
-                        cache1.put(key, -key);
-
-                        key = keyCnt.incrementAndGet();
-                    }
-                }
-                catch (Throwable th) {
-                    th.printStackTrace();
-                }
-
-                doneLatch.countDown();
-            }
-        });
-
-        thread.setName("Data-Loader");
-        thread.start();
-
-        startLatch.await(60, TimeUnit.SECONDS);
-
-        for (int i = 2; i < CLUSTER_SIZE; i++) {
-            startGrid(i);
-
-            U.sleep(5000);
-        }
-
-        U.sleep(10000);
-
-        IgniteProcessProxy.kill("db.RebalancingOnNotStableTopologyTest2");
-
-        Thread.sleep(5000);
-
-        IgniteProcessProxy.kill("db.RebalancingOnNotStableTopologyTest1");
-
-        assert doneLatch.getCount() > 0;
-
-        stop.set(true);
-
-        doneLatch.await(600, TimeUnit.SECONDS);
-
-        IgniteProcessProxy.killAll();
-
-        stopAllGrids();
-
-        //start cluster. it will cause memory restoration and reading WAL.
-        ex = startGrids(CLUSTER_SIZE);
-
-        ex.active(true);
-
-        checkTopology(CLUSTER_SIZE);
-
-        IgniteCache<Object, Object> cache1 = ex.cache(CACHE_NAME);
-
-        assert keyCnt.get() > 0;
-
-        for (int i = 0; i < keyCnt.get(); i++)
-            assertEquals(-i, cache1.get(i));
-
-        System.out.println("Test finished with total keys count = " + keyCnt.get());
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        cfg.setActiveOnStart(false);
-
-        CacheConfiguration<Integer, Integer> ccfg = new CacheConfiguration<>(CACHE_NAME);
-
-        ccfg.setPartitionLossPolicy(PartitionLossPolicy.READ_ONLY_SAFE);
-        ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        ccfg.setCacheMode(CacheMode.PARTITIONED);
-        ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
-        ccfg.setBackups(2);
-
-        cfg.setCacheConfiguration(ccfg);
-
-        cfg.setPersistentStoreConfiguration(
-            new PersistentStoreConfiguration()
-                .setCheckpointingFrequency(CHECKPOINT_FREQUENCY)
-        );
-
-        MemoryConfiguration memCfg = new MemoryConfiguration();
-
-        MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
-
-        memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setInitialSize(200 * 1024 * 1024);
-        memPlcCfg.setMaxSize(200 * 1024 * 1024);
-
-        memCfg.setMemoryPolicies(memPlcCfg);
-        memCfg.setDefaultMemoryPolicyName("dfltMemPlc");
-
-        cfg.setMemoryConfiguration(memCfg);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected boolean isMultiJvm() {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected boolean checkTopology() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        stopAllGrids();
-
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        stopAllGrids();
-
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-    }
-
-    /** {@inheritDoc} */
-    @Override protected long getTestTimeout() {
-        return TimeUnit.MINUTES.toMillis(10);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/6bf5ce46/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsTransactionsHangTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsTransactionsHangTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsTransactionsHangTest.java
deleted file mode 100644
index 0007a3b..0000000
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsTransactionsHangTest.java
+++ /dev/null
@@ -1,304 +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.cache.database.db;
-
-import java.util.Random;
-import java.util.concurrent.CyclicBarrier;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadLocalRandom;
-import java.util.concurrent.TimeUnit;
-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.CacheMode;
-import org.apache.ignite.cache.CacheWriteSynchronizationMode;
-import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
-import org.apache.ignite.configuration.BinaryConfiguration;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.MemoryConfiguration;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
-import org.apache.ignite.configuration.PersistentStoreConfiguration;
-import org.apache.ignite.configuration.TransactionConfiguration;
-import org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
-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 org.apache.ignite.transactions.Transaction;
-import org.apache.ignite.transactions.TransactionIsolation;
-import org.jsr166.LongAdder8;
-
-import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
-import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
-
-/**
- * Checks that transactions don't hang during checkpoint creation.
- */
-public class IgnitePdsTransactionsHangTest extends GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** Page cache size. */
-    private static final int PAGE_CACHE_SIZE = 512;
-
-    /** Page size. */
-    private static final Integer PAGE_SIZE = 16;
-
-    /** Cache name. */
-    private static final String CACHE_NAME = "IgnitePdsTransactionsHangTest";
-
-    /** Number of insert threads. */
-    public static final int THREADS_CNT = 32;
-
-    /** Warm up period, seconds. */
-    public static final int WARM_UP_PERIOD = 20;
-
-    /** Duration. */
-    public static final int DURATION = 180;
-
-    /** Maximum count of inserted keys. */
-    public static final int MAX_KEY_COUNT = 500_000;
-
-    /** Checkpoint frequency. */
-    public static final long CHECKPOINT_FREQUENCY = 20_000;
-
-    /** {@inheritDoc} */
-    @Override protected long getTestTimeout() {
-        return Long.MAX_VALUE;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
-        discoSpi.setIpFinder(IP_FINDER);
-        cfg.setDiscoverySpi(discoSpi);
-
-        BinaryConfiguration binaryCfg = new BinaryConfiguration();
-        binaryCfg.setCompactFooter(false);
-        cfg.setBinaryConfiguration(binaryCfg);
-
-        cfg.setPeerClassLoadingEnabled(true);
-
-        TcpCommunicationSpi tcpCommSpi = new TcpCommunicationSpi();
-
-        tcpCommSpi.setSharedMemoryPort(-1);
-        cfg.setCommunicationSpi(tcpCommSpi);
-
-        TransactionConfiguration txCfg = new TransactionConfiguration();
-
-        txCfg.setDefaultTxIsolation(TransactionIsolation.READ_COMMITTED);
-
-        cfg.setTransactionConfiguration(txCfg);
-
-        cfg.setPersistentStoreConfiguration(
-            new PersistentStoreConfiguration()
-                .setWalHistorySize(1)
-                .setCheckpointingFrequency(CHECKPOINT_FREQUENCY)
-        );
-
-        MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
-
-        memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setInitialSize(PAGE_CACHE_SIZE * 1024 * 1024);
-        memPlcCfg.setMaxSize(PAGE_CACHE_SIZE * 1024 * 1024);
-
-        MemoryConfiguration memCfg = new MemoryConfiguration();
-
-        memCfg.setMemoryPolicies(memPlcCfg);
-        memCfg.setDefaultMemoryPolicyName("dfltMemPlc");
-
-        memCfg.setPageSize(PAGE_SIZE * 1024);
-
-        cfg.setMemoryConfiguration(memCfg);
-
-        return cfg;
-    }
-
-    /**
-     * Creates cache configuration.
-     *
-     * @return Cache configuration.
-     * */
-    private CacheConfiguration getCacheConfiguration() {
-        CacheConfiguration ccfg = new CacheConfiguration();
-
-        ccfg.setName(CACHE_NAME);
-        ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-        ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        ccfg.setAffinity(new RendezvousAffinityFunction(false, 64 * 4));
-        ccfg.setReadFromBackup(true);
-
-        ccfg.setCacheMode(CacheMode.PARTITIONED);
-
-        return ccfg;
-    }
-
-    /**
-     * Copied from customers benchmark.
-     *
-     * @throws Exception If failed.
-     * */
-    public void testTransactionsDontHang() throws Exception {
-        try {
-            final Ignite g = startGrids(2);
-
-            g.getOrCreateCache(getCacheConfiguration());
-
-            ExecutorService threadPool = Executors.newFixedThreadPool(THREADS_CNT);
-            final CyclicBarrier cyclicBarrier = new CyclicBarrier(THREADS_CNT);
-
-            final AtomicBoolean interrupt = new AtomicBoolean(false);
-            final LongAdder8 operationCnt = new LongAdder8();
-
-            final IgniteCache<Long, TestEntity> cache = g.cache(CACHE_NAME);
-
-            for (int i = 0; i < THREADS_CNT; i++) {
-                threadPool.submit(new Runnable() {
-                    @Override public void run() {
-                        try {
-                            ThreadLocalRandom locRandom = ThreadLocalRandom.current();
-
-                            cyclicBarrier.await();
-
-                            while (!interrupt.get()) {
-                                long randomKey = locRandom.nextLong(MAX_KEY_COUNT);
-
-                                TestEntity entity = TestEntity.newTestEntity(locRandom);
-
-                                try (Transaction tx = g.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
-                                    cache.put(randomKey, entity);
-
-                                    tx.commit();
-                                }
-
-                                operationCnt.increment();
-                            }
-                        }
-                        catch (Throwable e) {
-                            System.out.println(e.toString());
-
-                            throw new RuntimeException(e);
-                        }
-                    }
-                });
-            }
-
-            long stopTime = System.currentTimeMillis() + DURATION * 1000;
-            long totalOperations = 0;
-            int periods = 0;
-            long max = Long.MIN_VALUE, min = Long.MAX_VALUE;
-
-            while (System.currentTimeMillis() < stopTime) {
-                U.sleep(1000);
-
-                long sum = operationCnt.sumThenReset();
-                periods++;
-
-                if (periods > WARM_UP_PERIOD) {
-                    totalOperations += sum;
-
-                    max = Math.max(max, sum);
-                    min = Math.min(min, sum);
-
-                    System.out.println("Operation count: " + sum + " min=" + min + " max=" + max + " avg=" + totalOperations / (periods - WARM_UP_PERIOD));
-                }
-            }
-
-            interrupt.set(true);
-
-            threadPool.shutdown();
-            System.out.println("Test complete");
-
-            threadPool.awaitTermination(getTestTimeout(), TimeUnit.MILLISECONDS);
-
-            IgniteTxManager tm = internalCache(cache).context().tm();
-
-            assertEquals("There are still active transactions", 0, tm.activeTransactions().size());
-        } finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * Entity for test.
-     * */
-    public static class TestEntity {
-        /** String value. */
-        private String strVal;
-
-        /** Long value. */
-        private Long longVal;
-
-        /** Int value. */
-        private int intVal;
-
-        /**
-         * @param strVal String value.
-         */
-        public void setStrVal(String strVal) {
-            this.strVal = strVal;
-        }
-
-        /**
-         * @param longVal Long value.
-         */
-        public void setLongVal(Long longVal) {
-            this.longVal = longVal;
-        }
-
-        /**
-         * @param intVal Integer value.
-         */
-        public void setIntVal(int intVal) {
-            this.intVal = intVal;
-        }
-
-        /**
-         * Creates test entity with random values.
-         *
-         * @param random Random seq generator.
-         * @return new test entity
-         * */
-        private static TestEntity newTestEntity(Random random) {
-            TestEntity entity = new TestEntity();
-
-            entity.setLongVal((long) random.nextInt(1_000));
-            entity.setIntVal(random.nextInt(1_000));
-            entity.setStrVal("test" + random.nextInt(1_000));
-
-            return entity;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/6bf5ce46/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsWholeClusterRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsWholeClusterRestartTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsWholeClusterRestartTest.java
deleted file mode 100644
index 576b40e..0000000
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgnitePdsWholeClusterRestartTest.java
+++ /dev/null
@@ -1,165 +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.cache.database.db;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.IgniteDataStreamer;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheRebalanceMode;
-import org.apache.ignite.cache.CacheWriteSynchronizationMode;
-import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.MemoryConfiguration;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
-import org.apache.ignite.configuration.PersistentStoreConfiguration;
-import org.apache.ignite.configuration.WALMode;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.spi.checkpoint.noop.NoopCheckpointSpi;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-/**
- *
- */
-public class IgnitePdsWholeClusterRestartTest extends GridCommonAbstractTest {
-    /** */
-    private static final int GRID_CNT = 5;
-
-    /** */
-    private static final int ENTRIES_COUNT = 1_000;
-
-    /** */
-    public static final String CACHE_NAME = "cache1";
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        MemoryConfiguration dbCfg = new MemoryConfiguration();
-
-        MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
-
-        memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setInitialSize(100 * 1024 * 1024);
-        memPlcCfg.setMaxSize(100 * 1024 * 1024);
-
-        dbCfg.setMemoryPolicies(memPlcCfg);
-        dbCfg.setDefaultMemoryPolicyName("dfltMemPlc");
-
-        cfg.setMemoryConfiguration(dbCfg);
-
-        CacheConfiguration ccfg1 = new CacheConfiguration();
-
-        ccfg1.setName(CACHE_NAME);
-        ccfg1.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-        ccfg1.setRebalanceMode(CacheRebalanceMode.SYNC);
-        ccfg1.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        ccfg1.setAffinity(new RendezvousAffinityFunction(false, 32));
-        ccfg1.setBackups(2);
-
-        cfg.setLateAffinityAssignment(false);
-        cfg.setActiveOnStart(false);
-
-        // To avoid hostname lookup on start.
-        cfg.setCheckpointSpi(new NoopCheckpointSpi());
-
-        cfg.setCacheConfiguration(ccfg1);
-
-        cfg.setPersistentStoreConfiguration(
-            new PersistentStoreConfiguration()
-                .setWalMode(WALMode.LOG_ONLY)
-        );
-
-        cfg.setConsistentId(gridName);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTestsStarted() throws Exception {
-        stopAllGrids();
-
-        deleteWorkFiles();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        stopAllGrids();
-
-        deleteWorkFiles();
-    }
-
-    /**
-     * @throws IgniteCheckedException If failed.
-     */
-    private void deleteWorkFiles() throws IgniteCheckedException {
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-    }
-
-    /**
-     * @throws Exception if failed.
-     */
-    public void testRestarts() throws Exception {
-        startGrids(GRID_CNT);
-
-        ignite(0).active(true);
-
-        awaitPartitionMapExchange();
-
-        try (IgniteDataStreamer<Object, Object> ds = ignite(0).dataStreamer(CACHE_NAME)) {
-            for (int i = 0; i < ENTRIES_COUNT; i++)
-                ds.addData(i, i);
-        }
-
-        stopAllGrids();
-
-        List<Integer> idxs = new ArrayList<>();
-
-        for (int i = 0; i < GRID_CNT; i++)
-            idxs.add(i);
-
-        for (int r = 0; r < 10; r++) {
-            Collections.shuffle(idxs);
-
-            info("Will start in the following order: " + idxs);
-
-            for (Integer idx : idxs)
-                startGrid(idx);
-
-            try {
-                ignite(0).active(true);
-
-                for (int g = 0; g < GRID_CNT; g++) {
-                    Ignite ig = ignite(g);
-
-                    for (int k = 0; k < ENTRIES_COUNT; k++)
-                        assertEquals("Failed to read [g=" + g + ", part=" + ig.affinity(CACHE_NAME).partition(k) +
-                            ", nodes=" + ig.affinity(CACHE_NAME).mapKeyToPrimaryAndBackups(k) + ']',
-                            k, ig.cache(CACHE_NAME).get(k));
-                }
-            }
-            finally {
-                stopAllGrids();
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/6bf5ce46/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgnitePdsCacheIntegrationTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgnitePdsCacheIntegrationTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgnitePdsCacheIntegrationTest.java
deleted file mode 100644
index 97bb05e..0000000
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgnitePdsCacheIntegrationTest.java
+++ /dev/null
@@ -1,285 +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.cache.database.db.file;
-
-import java.io.Serializable;
-import java.util.List;
-import java.util.concurrent.Callable;
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteDataStreamer;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheRebalanceMode;
-import org.apache.ignite.cache.CacheWriteSynchronizationMode;
-import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
-import org.apache.ignite.cache.query.SqlFieldsQuery;
-import org.apache.ignite.cache.query.annotations.QuerySqlField;
-import org.apache.ignite.configuration.BinaryConfiguration;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.MemoryConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
-import org.apache.ignite.configuration.PersistentStoreConfiguration;
-import org.apache.ignite.configuration.WALMode;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-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.GridTestUtils;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-/**
- *
- */
-public class IgnitePdsCacheIntegrationTest extends GridCommonAbstractTest {
-    /** */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** */
-    private static final int GRID_CNT = 3;
-
-    /** */
-    private static final String CACHE_NAME = "cache";
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        MemoryConfiguration dbCfg = new MemoryConfiguration();
-
-        dbCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
-
-        MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
-
-        memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setInitialSize(100 * 1024 * 1024);
-        memPlcCfg.setMaxSize(100 * 1024 * 1024);
-
-        dbCfg.setMemoryPolicies(memPlcCfg);
-        dbCfg.setDefaultMemoryPolicyName("dfltMemPlc");
-
-        cfg.setPersistentStoreConfiguration(
-            new PersistentStoreConfiguration()
-                .setWalMode(WALMode.LOG_ONLY)
-        );
-
-        cfg.setMemoryConfiguration(dbCfg);
-
-        CacheConfiguration ccfg = new CacheConfiguration(CACHE_NAME);
-
-        ccfg.setIndexedTypes(Integer.class, DbValue.class);
-
-        ccfg.setRebalanceMode(CacheRebalanceMode.NONE);
-
-        ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-
-        ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-
-        ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
-
-        cfg.setCacheConfiguration(ccfg);
-
-        cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(IP_FINDER));
-
-        cfg.setMarshaller(null);
-
-        BinaryConfiguration bCfg = new BinaryConfiguration();
-
-        bCfg.setCompactFooter(false);
-
-        cfg.setBinaryConfiguration(bCfg);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        super.afterTest();
-
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-    }
-
-    /**
-     * @throws Exception if failed.
-     */
-    public void testPutGetSimple() throws Exception {
-        startGrids(GRID_CNT);
-
-        try {
-            IgniteEx ig = grid(0);
-
-            checkPutGetSql(ig, true);
-        }
-        finally {
-            stopAllGrids();
-        }
-
-        info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
-        info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
-        info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
-
-        startGrids(GRID_CNT);
-
-        try {
-            IgniteEx ig = grid(0);
-
-            checkPutGetSql(ig, false);
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @throws Exception if failed.
-     */
-    public void testPutMultithreaded() throws Exception {
-        startGrids(4);
-
-        try {
-            final IgniteEx grid = grid(0);
-
-            GridTestUtils.runMultiThreaded(new Callable<Object>() {
-                @Override public Object call() throws Exception {
-                    for (int i = 0; i < 1000; i++)
-                        grid.cache(CACHE_NAME).put(i, i);
-
-                    return null;
-                }
-            }, 8, "updater");
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @param ig Ignite instance.
-     * @param write Write flag.
-     */
-    private void checkPutGetSql(Ignite ig, boolean write) {
-        IgniteCache<Integer, DbValue> cache = ig.cache(CACHE_NAME);
-
-        int entryCnt = 50_000;
-
-        if (write) {
-            try (IgniteDataStreamer<Object, Object> streamer = ig.dataStreamer(CACHE_NAME)) {
-                streamer.allowOverwrite(true);
-
-                for (int i = 0; i < entryCnt; i++)
-                    streamer.addData(i, new DbValue(i, "value-" + i, i));
-            }
-        }
-
-        for (int i = 0; i < GRID_CNT; i++) {
-            IgniteEx ignite = grid(i);
-
-            GridCacheAdapter<Object, Object> cache0 = ignite.context().cache().internalCache(CACHE_NAME);
-
-            for (int k = 0; k < entryCnt; k++)
-                assertNull(cache0.peekEx(i));
-
-            assertEquals(entryCnt, ignite.cache(CACHE_NAME).size());
-        }
-
-        for (int i = 0; i < entryCnt; i++)
-            assertEquals("i = " + i, new DbValue(i, "value-" + i, i), cache.get(i));
-
-        List<List<?>> res = cache.query(new SqlFieldsQuery("select ival from dbvalue where ival < ? order by ival asc")
-            .setArgs(10_000)).getAll();
-
-        assertEquals(10_000, res.size());
-
-        for (int i = 0; i < 10_000; i++) {
-            assertEquals(1, res.get(i).size());
-            assertEquals(i, res.get(i).get(0));
-        }
-
-        assertEquals(1, cache.query(new SqlFieldsQuery("select lval from dbvalue where ival = 7899")).getAll().size());
-        assertEquals(5000, cache.query(new SqlFieldsQuery("select lval from dbvalue where ival >= 5000 and ival < 10000"))
-            .getAll().size());
-
-        for (int i = 0; i < 10_000; i++)
-            assertEquals(new DbValue(i, "value-" + i, i), cache.get(i));
-    }
-
-    /**
-     *
-     */
-    private static class DbValue implements Serializable {
-        /** */
-        @QuerySqlField(index = true)
-        private int iVal;
-
-        /** */
-        @QuerySqlField(index = true)
-        private String sVal;
-
-        /** */
-        @QuerySqlField
-        private long lVal;
-
-        /**
-         * @param iVal Integer value.
-         * @param sVal String value.
-         * @param lVal Long value.
-         */
-        private DbValue(int iVal, String sVal, long lVal) {
-            this.iVal = iVal;
-            this.sVal = sVal;
-            this.lVal = lVal;
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object o) {
-            if (this == o)
-                return true;
-
-            if (o == null || getClass() != o.getClass())
-                return false;
-
-            DbValue dbVal = (DbValue)o;
-
-            return iVal == dbVal.iVal && lVal == dbVal.lVal &&
-                !(sVal != null ? !sVal.equals(dbVal.sVal) : dbVal.sVal != null);
-        }
-
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            int res = iVal;
-
-            res = 31 * res + (sVal != null ? sVal.hashCode() : 0);
-            res = 31 * res + (int)(lVal ^ (lVal >>> 32));
-
-            return res;
-        }
-
-        /** {@inheritDoc} */
-        @Override public String toString() {
-            return S.toString(DbValue.class, this);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/6bf5ce46/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgnitePdsEvictionTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgnitePdsEvictionTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgnitePdsEvictionTest.java
deleted file mode 100644
index 45bcef6..0000000
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgnitePdsEvictionTest.java
+++ /dev/null
@@ -1,297 +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.cache.database.db.file;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.Callable;
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.MemoryConfiguration;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
-import org.apache.ignite.configuration.PersistentStoreConfiguration;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.IgniteInternalFuture;
-import org.apache.ignite.internal.pagemem.FullPageId;
-import org.apache.ignite.internal.pagemem.PageMemory;
-import org.apache.ignite.internal.pagemem.PageUtils;
-import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
-import org.apache.ignite.internal.processors.cache.database.IgniteCacheDatabaseSharedManager;
-import org.apache.ignite.internal.processors.cache.database.tree.io.PageIO;
-import org.apache.ignite.internal.util.typedef.internal.CU;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-/**
- * Test for page evictions.
- */
-public class IgnitePdsEvictionTest extends GridCommonAbstractTest {
-    /** */
-    private static final int NUMBER_OF_SEGMENTS = 64;
-
-    /** */
-    private static final int PAGE_SIZE = 1024;
-
-    /** */
-    private static final long CHUNK_SIZE = 1024 * 1024;
-
-    /** */
-    private static final long MEMORY_LIMIT = 10 * CHUNK_SIZE;
-
-    /** */
-    private static final int PAGES_NUM = 128_000;
-
-    /** Cache name. */
-    private final String cacheName = "cache";
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        final IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        cfg.setPersistentStoreConfiguration(new PersistentStoreConfiguration());
-
-        cfg.setMemoryConfiguration(createDbConfig());
-
-        cfg.setCacheConfiguration(new CacheConfiguration<>(cacheName));
-
-        return cfg;
-    }
-
-    /**
-     * @return DB config.
-     */
-    private MemoryConfiguration createDbConfig() {
-        final MemoryConfiguration memCfg = new MemoryConfiguration();
-
-        MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
-        memPlcCfg.setInitialSize(MEMORY_LIMIT);
-        memPlcCfg.setMaxSize(MEMORY_LIMIT);
-        memPlcCfg.setName("dfltMemPlc");
-
-        memCfg.setPageSize(PAGE_SIZE);
-        memCfg.setConcurrencyLevel(NUMBER_OF_SEGMENTS);
-        memCfg.setMemoryPolicies(memPlcCfg);
-        memCfg.setDefaultMemoryPolicyName("dfltMemPlc");
-
-        return memCfg;
-    }
-
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTestsStarted() throws Exception {
-        super.beforeTestsStarted();
-
-        deleteWorkFiles();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTestsStopped() throws Exception {
-        super.afterTestsStopped();
-
-        stopAllGrids();
-
-        deleteWorkFiles();
-    }
-
-    /**
-     * @throws Exception If fail.
-     */
-    public void testPageEviction() throws Exception {
-        final IgniteEx ig = startGrid(0);
-
-        final PageMemory memory = getMemory(ig);
-
-        writeData(ig, memory, CU.cacheId(cacheName));
-    }
-
-    /**
-     * @param memory Page memory.
-     * @param cacheId Cache id.
-     * @throws IgniteCheckedException If failed.
-     */
-    private void writeData(final IgniteEx ignite, final PageMemory memory, final int cacheId) throws Exception {
-        final int size = PAGES_NUM;
-
-        final List<FullPageId> pageIds = new ArrayList<>(size);
-
-        IgniteCacheDatabaseSharedManager db = ignite.context().cache().context().database();
-
-        // Allocate.
-        for (int i = 0; i < size; i++) {
-            db.checkpointReadLock();
-            try {
-                final FullPageId fullId = new FullPageId(memory.allocatePage(cacheId, i % 256, PageMemory.FLAG_DATA),
-                    cacheId);
-
-                pageIds.add(fullId);
-            }
-            finally {
-                db.checkpointReadUnlock();
-            }
-        }
-
-        System.out.println("Allocated pages: " + pageIds.size());
-
-        // Write data. (Causes evictions.)
-        final int part = PAGES_NUM / NUMBER_OF_SEGMENTS;
-
-        final Collection<IgniteInternalFuture> futs = new ArrayList<>();
-
-        for (int i = 0; i < PAGES_NUM; i += part)
-            futs.add(runWriteInThread(ignite, i, i + part, memory, pageIds));
-
-        for (final IgniteInternalFuture fut : futs)
-            fut.get();
-
-        System.out.println("Wrote pages: " + pageIds.size());
-
-        // Read data. (Causes evictions.)
-        futs.clear();
-
-        for (int i = 0; i < PAGES_NUM; i += part)
-            futs.add(runReadInThread(ignite, i, i + part, memory, pageIds));
-
-        for (final IgniteInternalFuture fut : futs)
-            fut.get();
-
-        System.out.println("Read pages: " + pageIds.size());
-    }
-
-    /**
-     * @param start Start index.
-     * @param end End index.
-     * @param memory PageMemory.
-     * @param pageIds Allocated pages.
-     * @return Future.
-     * @throws Exception If fail.
-     */
-    private IgniteInternalFuture runWriteInThread(
-        final IgniteEx ignite,
-        final int start,
-        final int end,
-        final PageMemory memory,
-        final List<FullPageId> pageIds
-    ) throws Exception {
-
-        return GridTestUtils.runAsync(new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                IgniteCacheDatabaseSharedManager db = ignite.context().cache().context().database();
-
-                for (int i = start; i < end; i++) {
-                    db.checkpointReadLock();
-
-                    try {
-                        FullPageId fullId = pageIds.get(i);
-
-                        long page = memory.acquirePage(fullId.cacheId(), fullId.pageId());
-
-                        try {
-                            final long pageAddr = memory.writeLock(fullId.cacheId(), fullId.pageId(), page);
-
-                            try {
-                                PageIO.setPageId(pageAddr, fullId.pageId());
-
-                                PageUtils.putLong(pageAddr, PageIO.COMMON_HEADER_END, i * 2);
-                            }
-                            finally {
-                                memory.writeUnlock(fullId.cacheId(), fullId.pageId(), page, null, true);
-                            }
-                        }
-                        finally {
-                            memory.releasePage(fullId.cacheId(), fullId.pageId(), page);
-                        }
-                    }
-                    finally {
-                        db.checkpointReadUnlock();
-                    }
-                }
-
-                return null;
-            }
-        });
-    }
-
-    /**
-     * @param start Start index.
-     * @param end End index.
-     * @param memory PageMemory.
-     * @param pageIds Allocated pages.
-     * @return Future.
-     * @throws Exception If fail.
-     */
-    private IgniteInternalFuture runReadInThread(final IgniteEx ignite, final int start, final int end,
-        final PageMemory memory,
-        final List<FullPageId> pageIds) throws Exception {
-        return GridTestUtils.runAsync(new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                IgniteCacheDatabaseSharedManager db = ignite.context().cache().context().database();
-
-                for (int i = start; i < end; i++) {
-                    db.checkpointReadLock();
-
-                    try {
-                        final FullPageId fullId = pageIds.get(i);
-
-                        long page = memory.acquirePage(fullId.cacheId(), fullId.pageId());
-                        try {
-                            final long pageAddr = memory.readLock(fullId.cacheId(), fullId.pageId(), page);
-
-                            try {
-                                assertEquals(i * 2, PageUtils.getLong(pageAddr, PageIO.COMMON_HEADER_END));
-                            }
-                            finally {
-                                memory.readUnlock(fullId.cacheId(), fullId.pageId(), page);
-                            }
-                        }
-                        finally {
-                            memory.releasePage(fullId.cacheId(), fullId.pageId(), page);
-                        }
-                    }
-                    finally {
-                        db.checkpointReadUnlock();
-                    }
-                }
-
-                return null;
-            }
-        });
-    }
-
-    /**
-     * @param ig Ignite instance.
-     * @return Memory and store.
-     * @throws Exception If failed to initialize the store.
-     */
-    private PageMemory getMemory(IgniteEx ig) throws Exception {
-        final GridCacheSharedContext<Object, Object> sharedCtx = ig.context().cache().context();
-
-        final IgniteCacheDatabaseSharedManager db = sharedCtx.database();
-
-        return db.memoryPolicy(null).pageMemory();
-    }
-
-    /**
-     * @throws IgniteCheckedException If fail.
-     */
-    private void deleteWorkFiles() throws IgniteCheckedException {
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-    }
-}


Mime
View raw message