http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedEvictionSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedEvictionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedEvictionSelfTest.java deleted file mode 100644 index 4233244..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedEvictionSelfTest.java +++ /dev/null @@ -1,135 +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.distributed.replicated; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.UUID; -import org.apache.ignite.cache.CacheMode; -import org.apache.ignite.configuration.CacheConfiguration; -import org.apache.ignite.configuration.NearCacheConfiguration; -import org.apache.ignite.events.Event; -import org.apache.ignite.internal.processors.cache.GridCacheAbstractSelfTest; -import org.apache.ignite.internal.util.typedef.P1; -import org.apache.ignite.internal.util.typedef.PA; -import org.apache.ignite.lang.IgniteFuture; -import org.apache.ignite.lang.IgnitePredicate; -import org.apache.ignite.testframework.GridTestUtils; - -import static org.apache.ignite.cache.CacheMode.REPLICATED; -import static org.apache.ignite.events.EventType.EVT_CACHE_ENTRY_EVICTED; - -/** - * Tests synchronous eviction for replicated cache. - */ -public class GridCacheReplicatedEvictionSelfTest extends GridCacheAbstractSelfTest { - /** {@inheritDoc} */ - @Override protected int gridCount() { - return 4; - } - - /** {@inheritDoc} */ - @Override protected CacheMode cacheMode() { - return REPLICATED; - } - - /** {@inheritDoc} */ - @Override protected CacheConfiguration cacheConfiguration(String igniteInstanceName) throws Exception { - CacheConfiguration ccfg = super.cacheConfiguration(igniteInstanceName); - - ccfg.setEvictSynchronized(true); - ccfg.setEvictSynchronizedKeyBufferSize(1); - - return ccfg; - } - - /** {@inheritDoc} */ - @Override protected NearCacheConfiguration nearConfiguration() { - return null; - } - - /** {@inheritDoc} */ - @Override protected boolean swapEnabled() { - return false; - } - - /** - * @throws Exception If failed. - */ - public void testEvictSynchronized() throws Exception { - final int KEYS = 10; - - for (int i = 0; i < KEYS; i++) - jcache(0).put(String.valueOf(i), i); - - for (int g = 0 ; g < gridCount(); g++) { - for (int i = 0; i < KEYS; i++) - assertNotNull(jcache(g).localPeek(String.valueOf(i))); - } - - Collection<IgniteFuture<Event>> futs = new ArrayList<>(); - - for (int g = 0 ; g < gridCount(); g++) - futs.add(waitForLocalEvent(grid(g).events(), nodeEvent(grid(g).localNode().id()), EVT_CACHE_ENTRY_EVICTED)); - - for (int g = 0; g < gridCount(); g++) { - for (int i = 0; i < KEYS; i++) { - if (grid(g).affinity(null).isPrimary(grid(g).localNode(), String.valueOf(i))) - jcache(g).localEvict(Collections.singleton(String.valueOf(i))); - } - } - - for (IgniteFuture<Event> fut : futs) - fut.get(3000); - - boolean evicted = GridTestUtils.waitForCondition(new PA() { - @Override public boolean apply() { - for (int g = 0 ; g < gridCount(); g++) { - for (int i = 0; i < KEYS; i++) { - if (jcache(g).localPeek(String.valueOf(i)) != null) { - log.info("Non-null value, will wait [grid=" + g + ", key=" + i + ']'); - - return false; - } - } - } - - return true; - } - }, 3000); - - assertTrue(evicted); - } - - /** - * @param nodeId Node id. - * @return Predicate for events belonging to specified node. - */ - private IgnitePredicate<Event> nodeEvent(final UUID nodeId) { - assert nodeId != null; - - return new P1<Event>() { - @Override public boolean apply(Event e) { - info("Predicate called [e.nodeId()=" + e.node().id() + ", nodeId=" + nodeId + ']'); - - return e.node().id().equals(nodeId); - } - }; - } -} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java deleted file mode 100644 index 9a6703b..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java +++ /dev/null @@ -1,32 +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.distributed.replicated; - -import org.apache.ignite.cache.CacheMemoryMode; - -import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_VALUES; - -/** - * Tests replicated cache with values being stored off-heap. - */ -public class GridCacheReplicatedOffHeapFullApiSelfTest extends GridCacheReplicatedFullApiSelfTest { - /** {@inheritDoc} */ - @Override protected CacheMemoryMode memoryMode() { - return OFFHEAP_VALUES; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java deleted file mode 100644 index 237e5f5..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java +++ /dev/null @@ -1,32 +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.distributed.replicated; - -import org.apache.ignite.cache.CacheMemoryMode; - -import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_VALUES; - -/** - * Tests replicated cache with values being stored off-heap. - */ -public class GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest extends GridCacheReplicatedMultiNodeFullApiSelfTest { - /** {@inheritDoc} */ - @Override protected CacheMemoryMode memoryMode() { - return OFFHEAP_VALUES; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredFullApiSelfTest.java deleted file mode 100644 index 4f909e4..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredFullApiSelfTest.java +++ /dev/null @@ -1,33 +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.distributed.replicated; - -import org.apache.ignite.cache.CacheMemoryMode; - -import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_TIERED; - -/** - * Tests replicated cache with off-heap tiered mode. - */ -public class GridCacheReplicatedOffHeapTieredFullApiSelfTest extends - GridCacheReplicatedOffHeapFullApiSelfTest { - /** {@inheritDoc} */ - @Override protected CacheMemoryMode memoryMode() { - return OFFHEAP_TIERED; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest.java deleted file mode 100644 index babe1c4..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest.java +++ /dev/null @@ -1,33 +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.distributed.replicated; - -import org.apache.ignite.cache.CacheMemoryMode; - -import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_TIERED; - -/** - * Tests replicated cache with off-heap tiered mode. - */ -public class GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest extends - GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest{ - /** {@inheritDoc} */ - @Override protected CacheMemoryMode memoryMode() { - return OFFHEAP_TIERED; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOnheapFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOnheapFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOnheapFullApiSelfTest.java new file mode 100644 index 0000000..4280277 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOnheapFullApiSelfTest.java @@ -0,0 +1,26 @@ +/* + * 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.distributed.replicated; + +public class GridCacheReplicatedOnheapFullApiSelfTest extends GridCacheReplicatedFullApiSelfTest { + /** {@inheritDoc} */ + @Override protected boolean onheapCacheEnabled() { + return true; + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOnheapMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOnheapMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOnheapMultiNodeFullApiSelfTest.java new file mode 100644 index 0000000..cd04b58 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOnheapMultiNodeFullApiSelfTest.java @@ -0,0 +1,26 @@ +/* + * 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.distributed.replicated; + +public class GridCacheReplicatedOnheapMultiNodeFullApiSelfTest extends GridCacheReplicatedMultiNodeFullApiSelfTest { + /** {@inheritDoc} */ + @Override protected boolean onheapCacheEnabled() { + return true; + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadOffHeapSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadOffHeapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadOffHeapSelfTest.java deleted file mode 100644 index b4f9960..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadOffHeapSelfTest.java +++ /dev/null @@ -1,37 +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.distributed.replicated.preloader; - -import org.apache.ignite.configuration.CacheConfiguration; - -import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_VALUES; - -/** - * Tests for replicated cache preloader. - */ -public class GridCacheReplicatedPreloadOffHeapSelfTest extends GridCacheReplicatedPreloadSelfTest { - /** {@inheritDoc} */ - @Override CacheConfiguration cacheConfiguration(String igniteInstanceName) { - CacheConfiguration cacheCfg = super.cacheConfiguration(igniteInstanceName); - - cacheCfg.setMemoryMode(OFFHEAP_VALUES); - cacheCfg.setOffHeapMaxMemory(0); - - return cacheCfg; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/EvictionAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/EvictionAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/EvictionAbstractTest.java index 707bfba..b6fcebc 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/EvictionAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/EvictionAbstractTest.java @@ -75,12 +75,6 @@ public abstract class EvictionAbstractTest<T extends EvictionPolicy<?, ?>> /** Near enabled flag. */ protected boolean nearEnabled; - /** Evict backup sync. */ - protected boolean evictSync; - - /** Evict near sync. */ - protected boolean evictNearSync = true; - /** Policy max. */ protected int plcMax = 10; @@ -110,7 +104,7 @@ public abstract class EvictionAbstractTest<T extends EvictionPolicy<?, ?>> cc.setCacheMode(mode); cc.setEvictionPolicy(createPolicy(plcMax)); - cc.setEvictSynchronized(evictSync); + cc.setOnheapCacheEnabled(true); cc.setWriteSynchronizationMode(syncCommit ? FULL_SYNC : FULL_ASYNC); cc.setStartSize(plcMax); cc.setAtomicityMode(TRANSACTIONAL); @@ -705,7 +699,6 @@ public abstract class EvictionAbstractTest<T extends EvictionPolicy<?, ?>> nearEnabled = true; nearMax = 3; plcMax = 10; - evictNearSync = true; syncCommit = true; gridCnt = 2; @@ -718,19 +711,6 @@ public abstract class EvictionAbstractTest<T extends EvictionPolicy<?, ?>> mode = PARTITIONED; nearEnabled = false; plcMax = 100; - evictSync = false; - - gridCnt = 2; - - checkPartitionedMultiThreaded(); - } - - /** @throws Exception If failed. */ - public void testPartitionedNearDisabledBackupSyncMultiThreaded() throws Exception { - mode = PARTITIONED; - nearEnabled = false; - plcMax = 100; - evictSync = true; gridCnt = 2; @@ -742,19 +722,6 @@ public abstract class EvictionAbstractTest<T extends EvictionPolicy<?, ?>> mode = PARTITIONED; nearEnabled = true; plcMax = 10; - evictSync = false; - - gridCnt = 2; - - checkPartitionedMultiThreaded(); - } - - /** @throws Exception If failed. */ - public void testPartitionedNearEnabledBackupSyncMultiThreaded() throws Exception { - mode = PARTITIONED; - nearEnabled = true; - plcMax = 10; - evictSync = true; gridCnt = 2; @@ -814,7 +781,7 @@ public abstract class EvictionAbstractTest<T extends EvictionPolicy<?, ?>> if (plcMax > 0) { for (int i = 0; i < gridCnt; i++) { - int actual = colocated(i).size(); + int actual = colocated(i).map().keySet().size(); assertTrue("Cache size is greater then policy size [expected=" + endSize + ", actual=" + actual + ']', actual <= endSize + (plcMaxMemSize > 0 ? 1 : plcBatchSize)); http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheBatchEvictUnswapSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheBatchEvictUnswapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheBatchEvictUnswapSelfTest.java deleted file mode 100644 index 67700b6..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheBatchEvictUnswapSelfTest.java +++ /dev/null @@ -1,199 +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.eviction; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.concurrent.atomic.AtomicInteger; -import org.apache.ignite.Ignite; -import org.apache.ignite.IgniteCache; -import org.apache.ignite.IgniteException; -import org.apache.ignite.cache.CacheMode; -import org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy; -import org.apache.ignite.cache.store.CacheStore; -import org.apache.ignite.cache.store.CacheStoreAdapter; -import org.apache.ignite.configuration.CacheConfiguration; -import org.apache.ignite.internal.IgniteInternalFuture; -import org.apache.ignite.internal.processors.cache.GridCacheAbstractSelfTest; -import org.apache.ignite.lang.IgniteBiInClosure; -import org.jetbrains.annotations.Nullable; - -/** - * Swap benchmark. - */ -@SuppressWarnings("BusyWait") -public class GridCacheBatchEvictUnswapSelfTest extends GridCacheAbstractSelfTest { - /** Eviction policy size. */ - public static final int EVICT_PLC_SIZE = 100000; - - /** Keys count. */ - public static final int KEYS_CNT = 100000; - - /** Batch size. */ - private static final int BATCH_SIZE = 200; - - /** Number of threads for concurrent benchmark + concurrency level. */ - private static final int N_THREADS = 8; - - /** {@inheritDoc} */ - @Override protected int gridCount() { - return 1; - } - - /** {@inheritDoc} */ - @Override protected long getTestTimeout() { - // Let this test run 2 minutes as it runs for 20 seconds locally. - return 2 * 60 * 1000; - } - - /** {@inheritDoc} */ - @SuppressWarnings("unchecked") - @Override protected CacheConfiguration cacheConfiguration(String igniteInstanceName) throws Exception { - CacheConfiguration cacheCfg = super.cacheConfiguration(igniteInstanceName); - - cacheCfg.setCacheMode(CacheMode.PARTITIONED); - - CacheStore store = new CacheStoreAdapter<Long, String>() { - @Nullable @Override public String load(Long key) { - return null; - } - - @Override public void loadCache(final IgniteBiInClosure<Long, String> c, - @Nullable Object... args) { - for (int i = 0; i < KEYS_CNT; i++) - c.apply((long)i, String.valueOf(i)); - } - - @Override public void write(javax.cache.Cache.Entry<? extends Long, ? extends String> val) { - // No-op. - } - - @Override public void delete(Object key) { - // No-op. - } - }; - - cacheCfg.setCacheStoreFactory(singletonFactory(store)); - cacheCfg.setReadThrough(true); - cacheCfg.setWriteThrough(true); - cacheCfg.setLoadPreviousValue(true); - - FifoEvictionPolicy plc = new FifoEvictionPolicy(); - plc.setMaxSize(EVICT_PLC_SIZE); - - cacheCfg.setEvictionPolicy(plc); - cacheCfg.setEvictSynchronized(false); - cacheCfg.setNearConfiguration(null); - - return cacheCfg; - } - - /** - * @throws Exception If failed. - */ - public void testConcurrentEvictions() throws Exception { - runConcurrentTest(grid(0), KEYS_CNT, BATCH_SIZE); - } - - /** - * @param g Grid instance. - * @param keysCnt Number of keys to swap and promote. - * @param batchSize Size of batch to swap/promote. - * @throws Exception If failed. - */ - private void runConcurrentTest(Ignite g, final int keysCnt, final int batchSize) throws Exception { - assert keysCnt % batchSize == 0; - - final AtomicInteger evictedKeysCnt = new AtomicInteger(); - - final IgniteCache<Object, Object> cache = g.cache(null); - - cache.loadCache(null, 0); - - info("Finished load cache."); - - IgniteInternalFuture<?> evictFut = multithreadedAsync(new Runnable() { - @Override public void run() { - Collection<Long> keys = new ArrayList<>(batchSize); - - int evictedBatches = 0; - - for (long i = 0; i < keysCnt; i++) { - keys.add(i); - - if (keys.size() == batchSize) { - for (Long key : keys) - cache.localEvict(Collections.<Object>singleton(key)); - - evictedKeysCnt.addAndGet(batchSize); - - keys.clear(); - - evictedBatches++; - - if (evictedBatches % 100 == 0 && evictedBatches > 0) - info("Evicted " + (evictedBatches * batchSize) + " entries."); - } - } - } - }, N_THREADS, "evict"); - - final AtomicInteger unswappedKeys = new AtomicInteger(); - - IgniteInternalFuture<?> unswapFut = multithreadedAsync(new Runnable() { - @Override public void run() { - try { - Collection<Long> keys = new ArrayList<>(batchSize); - - int unswappedBatches = 0; - - for (long i = 0; i < keysCnt; i++) { - keys.add(i); - - if (keys.size() == batchSize) { - for (Long key : keys) - cache.localPromote(Collections.singleton(key)); - - unswappedKeys.addAndGet(batchSize); - - keys.clear(); - - unswappedBatches++; - - if (unswappedBatches % 100 == 0 && unswappedBatches > 0) - info("Unswapped " + (unswappedBatches * batchSize) + " entries."); - } - } - } - catch (IgniteException e) { - e.printStackTrace(); - } - } - }, N_THREADS, "promote"); - - evictFut.get(); - - unswapFut.get(); - - info("Clearing cache."); - - for (long i = 0; i < KEYS_CNT; i++) - cache.remove(i); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionConsistencySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionConsistencySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionConsistencySelfTest.java index f7ef897..e61bef6 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionConsistencySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionConsistencySelfTest.java @@ -24,6 +24,7 @@ import java.util.concurrent.Callable; import javax.cache.Cache; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cache.CachePeekMode; import org.apache.ignite.cache.eviction.EvictableEntry; import org.apache.ignite.cache.eviction.EvictionPolicy; import org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy; @@ -83,6 +84,7 @@ public class GridCacheConcurrentEvictionConsistencySelfTest extends GridCommonAb cc.setNearConfiguration(null); cc.setEvictionPolicy(plc); + cc.setOnheapCacheEnabled(true); c.setCacheConfiguration(cc); @@ -295,10 +297,10 @@ public class GridCacheConcurrentEvictionConsistencySelfTest extends GridCommonAb if (detached) fail("Eviction policy contains keys that are not present in cache"); - if (!(cache.localSize() == 0)) { + if (!(cache.localSize(CachePeekMode.ONHEAP) == 0)) { boolean zombies = false; - for (Cache.Entry<Integer, Integer> e : cache) { + for (Cache.Entry<Integer, Integer> e : cache.localEntries(CachePeekMode.ONHEAP)) { U.warn(log, "Zombie entry: " + e); zombies = true; http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionsSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionsSelfTest.java index 8eb029e..31d7c26 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionsSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionsSelfTest.java @@ -75,6 +75,7 @@ public class GridCacheConcurrentEvictionsSelfTest extends GridCommonAbstractTest cc.setNearConfiguration(null); cc.setEvictionPolicy(plc); + cc.setOnheapCacheEnabled(true); c.setCacheConfiguration(cc); http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheDistributedEvictionsSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheDistributedEvictionsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheDistributedEvictionsSelfTest.java deleted file mode 100644 index 7621897..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheDistributedEvictionsSelfTest.java +++ /dev/null @@ -1,235 +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.eviction; - -import java.util.TreeSet; -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.eviction.fifo.FifoEvictionPolicy; -import org.apache.ignite.configuration.CacheConfiguration; -import org.apache.ignite.configuration.IgniteConfiguration; -import org.apache.ignite.configuration.NearCacheConfiguration; -import org.apache.ignite.configuration.TransactionConfiguration; -import org.apache.ignite.internal.processors.cache.distributed.GridCacheModuloAffinityFunction; -import org.apache.ignite.internal.util.typedef.F; -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 static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; -import static org.apache.ignite.cache.CacheMode.LOCAL; -import static org.apache.ignite.cache.CacheMode.PARTITIONED; -import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC; -import static org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED; - -/** - * - */ -public class GridCacheDistributedEvictionsSelfTest extends GridCommonAbstractTest { - /** IP finder. */ - private static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true); - - /** */ - private int gridCnt = 2; - - /** */ - private CacheMode mode; - - /** */ - private boolean nearEnabled; - - /** */ - private boolean evictSync; - - /** */ - private final AtomicInteger idxGen = new AtomicInteger(); - - /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { - IgniteConfiguration c = super.getConfiguration(igniteInstanceName); - - TransactionConfiguration tCfg = new TransactionConfiguration(); - - tCfg.setDefaultTxConcurrency(PESSIMISTIC); - tCfg.setDefaultTxIsolation(READ_COMMITTED); - - c.setTransactionConfiguration(tCfg); - - CacheConfiguration cc = defaultCacheConfiguration(); - - cc.setCacheMode(mode); - cc.setAtomicityMode(TRANSACTIONAL); - - if (nearEnabled) { - NearCacheConfiguration nearCfg = new NearCacheConfiguration(); - - cc.setNearConfiguration(nearCfg); - } - - cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); - - // Set only DHT policy, leave default near policy. - FifoEvictionPolicy plc = new FifoEvictionPolicy(); - plc.setMaxSize(10); - - cc.setEvictionPolicy(plc); - cc.setEvictSynchronized(evictSync); - cc.setEvictSynchronizedKeyBufferSize(1); - - cc.setAffinity(new GridCacheModuloAffinityFunction(gridCnt, 1)); - - c.setCacheConfiguration(cc); - - TcpDiscoverySpi disco = new TcpDiscoverySpi(); - - disco.setIpFinder(ipFinder); - - c.setDiscoverySpi(disco); - - c.setUserAttributes(F.asMap(GridCacheModuloAffinityFunction.IDX_ATTR, idxGen.getAndIncrement())); - - return c; - } - - /** {@inheritDoc} */ - @Override protected void afterTest() throws Exception { - stopAllGrids(); - - super.afterTest(); - } - - /** @throws Throwable If failed. */ - public void testNearSyncBackupSync() throws Throwable { - gridCnt = 3; - mode = PARTITIONED; - evictSync = true; - nearEnabled = true; - - checkEvictions(); - } - - /** - * @throws Throwable If failed. - */ - public void testLocalSync() throws Throwable { - gridCnt = 1; - mode = LOCAL; - evictSync = true; - nearEnabled = true; - - Ignite g = startGrid(0); - - final IgniteCache<Integer, Integer> cache = g.cache(null); - - for (int i = 1; i < 20; i++) { - cache.put(i * gridCnt, i * gridCnt); - - info("Put to cache: " + i * gridCnt); - } - } - - /** @throws Throwable If failed. */ - private void checkEvictions() throws Throwable { - try { - startGrids(gridCnt); - - Ignite ignite = grid(0); - - final IgniteCache<Integer, Integer> cache = ignite.cache(null); - - // Put 1 entry to primary node. - cache.put(0, 0); - - Integer nearVal = this.<Integer, Integer>jcache(2).get(0); - - assert nearVal == 0 : "Unexpected near value: " + nearVal; - - // Put several vals to primary node. - for (int i = 1; i < 20; i++) { - cache.put(i * gridCnt, i * gridCnt); - - info("Put to cache: " + i * gridCnt); - } - - for (int i = 0; i < 3; i++) { - try { - assert jcache(2).get(0) == null : "Entry has not been evicted from near node for key: " + 0; - assert jcache(1).get(0) == null : "Entry has not been evicted from backup node for key: " + 0; - assert cache.get(0) == null : "Entry has not been evicted from primary node for key: " + 0; - } - catch (Throwable e) { - if (i == 2) - // No attempts left. - throw e; - - U.warn(log, "Check failed (will retry in 2000 ms): " + e); - - // Unwind evicts? - cache.get(0); - - U.sleep(2000); - } - } - - for (int i = 0; i < 3; i++) { - info("Primary key set: " + new TreeSet<>(this.<Integer, Integer>dht(0).keySet())); - info("Primary near key set: " + new TreeSet<>(this.<Integer, Integer>near(0).keySet())); - - info("Backup key set: " + new TreeSet<>(this.<Integer, Integer>dht(1).keySet())); - info("Backup near key set: " + new TreeSet<>(this.<Integer, Integer>near(1).keySet())); - - info("Near key set: " + new TreeSet<>(this.<Integer, Integer>dht(2).keySet())); - info("Near node near key set: " + new TreeSet<>(this.<Integer, Integer>near(2).keySet())); - - try { - assert cache.localSize() == 10 : "Invalid cache size [size=" + cache.localSize() + ']'; - assert cache.localSize() == 10 : "Invalid key size [size=" + cache.localSize() + ']'; - - assert jcache(2).localSize() == 0; - - break; - } - catch (Throwable e) { - if (i == 2) - // No attempts left. - throw e; - - U.warn(log, "Check failed (will retry in 2000 ms): " + e); - - // Unwind evicts? - cache.get(0); - - U.sleep(2000); - } - } - } - catch (Throwable t) { - error("Test failed.", t); - - throw t; - } - finally { - stopAllGrids(); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEmptyEntriesAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEmptyEntriesAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEmptyEntriesAbstractSelfTest.java index 0c4ac3f..c97f2ca 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEmptyEntriesAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEmptyEntriesAbstractSelfTest.java @@ -83,9 +83,7 @@ public abstract class GridCacheEmptyEntriesAbstractSelfTest extends GridCommonAb cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); cc.setEvictionPolicy(plc); - cc.setEvictSynchronizedKeyBufferSize(1); - - cc.setEvictSynchronized(true); + cc.setOnheapCacheEnabled(true); if (testStore != null) { cc.setCacheStoreFactory(singletonFactory(testStore)); http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictableEntryEqualsSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictableEntryEqualsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictableEntryEqualsSelfTest.java index 2b40365..98c8b77 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictableEntryEqualsSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictableEntryEqualsSelfTest.java @@ -39,6 +39,7 @@ public class GridCacheEvictableEntryEqualsSelfTest extends GridCommonAbstractTes CacheConfiguration<TestKey, String> cfg = new CacheConfiguration<>("test"); cfg.setEvictionPolicy(new TestEvictionPolicy()); + cfg.setOnheapCacheEnabled(true); IgniteCache<TestKey, String> cache = ignite.createCache(cfg); http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java index db23661..eb675ad 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java @@ -74,7 +74,7 @@ public class GridCacheEvictionFilterSelfTest extends GridCommonAbstractTest { cc.setCacheMode(mode); cc.setEvictionPolicy(notSerializableProxy(plc, EvictionPolicy.class)); - cc.setEvictSynchronized(false); + cc.setOnheapCacheEnabled(true); cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); cc.setEvictionFilter(notSerializableProxy(filter, org.apache.ignite.cache.eviction.EvictionFilter.class)); cc.setRebalanceMode(SYNC); http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionLockUnlockSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionLockUnlockSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionLockUnlockSelfTest.java index ba9b2d7..55b7b63 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionLockUnlockSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionLockUnlockSelfTest.java @@ -73,6 +73,7 @@ public class GridCacheEvictionLockUnlockSelfTest extends GridCommonAbstractTest cc.setCacheMode(mode); cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); cc.setEvictionPolicy(new EvictionPolicy()); + cc.setOnheapCacheEnabled(true); cc.setAtomicityMode(TRANSACTIONAL); NearCacheConfiguration nearCfg = new NearCacheConfiguration(); http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionTouchSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionTouchSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionTouchSelfTest.java index d8746c8..396083e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionTouchSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionTouchSelfTest.java @@ -28,6 +28,7 @@ import java.util.TreeSet; import javax.cache.Cache; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cache.CachePeekMode; import org.apache.ignite.cache.eviction.EvictionPolicy; import org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy; import org.apache.ignite.cache.store.CacheStore; @@ -74,6 +75,7 @@ public class GridCacheEvictionTouchSelfTest extends GridCommonAbstractTest { cc.setWriteSynchronizationMode(FULL_SYNC); cc.setEvictionPolicy(plc); + cc.setOnheapCacheEnabled(true); CacheStore store = new GridCacheGenericTestStore<Object, Object>() { @Override public Object load(Object key) { @@ -191,7 +193,7 @@ public class GridCacheEvictionTouchSelfTest extends GridCommonAbstractTest { cache.localEvict(Collections.singleton(i)); assertEquals(0, ((FifoEvictionPolicy)plc).queue().size()); - assertEquals(0, cache.size()); + assertEquals(0, cache.size(CachePeekMode.ONHEAP)); } finally { stopAllGrids(); @@ -226,7 +228,7 @@ public class GridCacheEvictionTouchSelfTest extends GridCommonAbstractTest { cache.localEvict(Collections.singleton(key)); assertEquals(0, ((FifoEvictionPolicy)plc).queue().size()); - assertEquals(0, cache.size()); + assertEquals(0, cache.size(CachePeekMode.ONHEAP)); } finally { stopAllGrids(); @@ -250,8 +252,7 @@ public class GridCacheEvictionTouchSelfTest extends GridCommonAbstractTest { for (int i = 0; i < 10000; i++) load(cache, i, true); - assertEquals(100, cache.size()); - assertEquals(100, cache.size()); + assertEquals(100, cache.size(CachePeekMode.ONHEAP)); assertEquals(100, ((FifoEvictionPolicy)plc).queue().size()); Set<Integer> keys = new TreeSet<>(); @@ -261,8 +262,7 @@ public class GridCacheEvictionTouchSelfTest extends GridCommonAbstractTest { loadAll(cache, keys, true); - assertEquals(100, cache.size()); - assertEquals(100, cache.size()); + assertEquals(100, cache.size(CachePeekMode.ONHEAP)); assertEquals(100, ((FifoEvictionPolicy)plc).queue().size()); } finally { http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java deleted file mode 100644 index 377afa0..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java +++ /dev/null @@ -1,166 +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.eviction; - -import java.util.HashMap; -import java.util.Map; -import java.util.Random; -import java.util.concurrent.Callable; -import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.ignite.IgniteCache; -import org.apache.ignite.IgniteException; -import org.apache.ignite.cache.CacheMode; -import org.apache.ignite.cache.affinity.Affinity; -import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; -import org.apache.ignite.cluster.ClusterNode; -import org.apache.ignite.configuration.CacheConfiguration; -import org.apache.ignite.configuration.NearCacheConfiguration; -import org.apache.ignite.internal.IgniteInternalFuture; -import org.apache.ignite.internal.processors.cache.GridCacheAbstractSelfTest; -import org.apache.ignite.internal.util.typedef.internal.U; -import org.apache.ignite.testframework.GridTestUtils; - -import static org.apache.ignite.cache.CacheMode.PARTITIONED; - -/** - * - */ -public class GridCacheSynchronousEvictionsFailoverSelfTest extends GridCacheAbstractSelfTest { - /** {@inheritDoc} */ - @Override protected void beforeTest() throws Exception { - fail("https://issues.apache.org/jira/browse/IGNITE-804"); - } - - /** {@inheritDoc} */ - @Override protected int gridCount() { - return 3; - } - - /** {@inheritDoc} */ - @Override protected CacheMode cacheMode() { - return PARTITIONED; - } - - /** {@inheritDoc} */ - @Override protected NearCacheConfiguration nearConfiguration() { - return null; - } - - /** {@inheritDoc} */ - @Override protected CacheConfiguration cacheConfiguration(String igniteInstanceName) throws Exception { - CacheConfiguration ccfg = super.cacheConfiguration(igniteInstanceName); - - ccfg.setEvictSynchronized(true); - ccfg.setEvictSynchronizedKeyBufferSize(10); - - ccfg.setBackups(2); - - ccfg.setAffinity(new RendezvousAffinityFunction(false, 500)); - - return ccfg; - } - - /** {@inheritDoc} */ - @Override protected long getTestTimeout() { - return 60_000; - } - - /** - * @throws Exception If failed. - */ - public void testSynchronousEvictions() throws Exception { - IgniteCache<String, Integer> cache = jcache(0); - - final AtomicBoolean stop = new AtomicBoolean(); - - IgniteInternalFuture<?> fut = null; - - try { - Map<String, Integer> data = new HashMap<>(); - - addKeysForNode(affinity(cache), grid(0).localNode(), data); - addKeysForNode(affinity(cache), grid(1).localNode(), data); - addKeysForNode(affinity(cache), grid(2).localNode(), data); - - fut = GridTestUtils.runAsync(new Callable<Void>() { - @Override public Void call() throws Exception { - Random rnd = new Random(); - - while (!stop.get()) { - int idx = rnd.nextBoolean() ? 1 : 2; - - log.info("Stopping grid: " + idx); - - stopGrid(idx); - - U.sleep(100); - - log.info("Starting grid: " + idx); - - startGrid(idx); - } - - return null; - } - }); - - for (int i = 0 ; i < 100; i++) { - log.info("Iteration: " + i); - - try { - cache.putAll(data); - } - catch (IgniteException ignore) { - continue; - } - - cache.localEvict(data.keySet()); - } - } - finally { - stop.set(true); - - if (fut != null) - fut.get(); - } - } - - /** - * @param aff Cache affinity. - * @param node Primary node for keys. - * @param data Map where keys/values should be put to. - */ - private void addKeysForNode(Affinity<String> aff, ClusterNode node, Map<String, Integer> data) { - int cntr = 0; - - for (int i = 0; i < 100_000; i++) { - String key = String.valueOf(i); - - if (aff.isPrimary(node, key)) { - data.put(key, i); - - cntr++; - - if (cntr == 500) - break; - } - } - - assertEquals(500, cntr); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/lru/LruNearEvictionPolicySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/lru/LruNearEvictionPolicySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/lru/LruNearEvictionPolicySelfTest.java index ed7f918..0eb7a42 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/lru/LruNearEvictionPolicySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/lru/LruNearEvictionPolicySelfTest.java @@ -21,7 +21,6 @@ import java.util.Random; 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.eviction.lru.LruEvictionPolicy; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; @@ -33,7 +32,6 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC; import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL; -import static org.apache.ignite.cache.CacheMemoryMode.ONHEAP_TIERED; import static org.apache.ignite.cache.CacheMode.PARTITIONED; import static org.apache.ignite.cache.CacheRebalanceMode.SYNC; import static org.apache.ignite.cache.CacheWriteSynchronizationMode.PRIMARY_SYNC; @@ -54,9 +52,6 @@ public class LruNearEvictionPolicySelfTest extends GridCommonAbstractTest { /** Cache atomicity mode specified by test. */ private CacheAtomicityMode atomicityMode; - /** Memory mode. */ - private CacheMemoryMode memMode; - /** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration c = super.getConfiguration(igniteInstanceName); @@ -65,7 +60,6 @@ public class LruNearEvictionPolicySelfTest extends GridCommonAbstractTest { cc.setCacheMode(PARTITIONED); cc.setAtomicityMode(atomicityMode); - cc.setMemoryMode(memMode); cc.setWriteSynchronizationMode(PRIMARY_SYNC); cc.setRebalanceMode(SYNC); cc.setStartSize(100); @@ -95,17 +89,6 @@ public class LruNearEvictionPolicySelfTest extends GridCommonAbstractTest { */ public void testAtomicNearEvictionMaxSize() throws Exception { atomicityMode = ATOMIC; - memMode = ONHEAP_TIERED; - - checkNearEvictionMaxSize(); - } - - /** - * @throws Exception If failed. - */ - public void testAtomicOffHeapNearEvictionMaxSize() throws Exception { - atomicityMode = ATOMIC; - memMode = CacheMemoryMode.OFFHEAP_TIERED; checkNearEvictionMaxSize(); } @@ -115,17 +98,6 @@ public class LruNearEvictionPolicySelfTest extends GridCommonAbstractTest { */ public void testTransactionalNearEvictionMaxSize() throws Exception { atomicityMode = TRANSACTIONAL; - memMode = ONHEAP_TIERED; - - checkNearEvictionMaxSize(); - } - - /** - * @throws Exception If failed. - */ - public void testTransactionalOffHeapNearEvictionMaxSize() throws Exception { - atomicityMode = TRANSACTIONAL; - memMode = CacheMemoryMode.OFFHEAP_TIERED; checkNearEvictionMaxSize(); } http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/lru/LruNearOnlyNearEvictionPolicySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/lru/LruNearOnlyNearEvictionPolicySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/lru/LruNearOnlyNearEvictionPolicySelfTest.java index 1f6ce65..5b0a12c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/lru/LruNearOnlyNearEvictionPolicySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/lru/LruNearOnlyNearEvictionPolicySelfTest.java @@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.eviction.lru; 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.configuration.CacheConfiguration; @@ -33,8 +32,6 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; 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.CacheMode.REPLICATED; import static org.apache.ignite.cache.CacheRebalanceMode.SYNC; @@ -62,9 +59,6 @@ public class LruNearOnlyNearEvictionPolicySelfTest extends GridCommonAbstractTes /** Cache atomicity mode specified by test. */ private CacheAtomicityMode atomicityMode; - /** Memory mode. */ - private CacheMemoryMode memMode; - /** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { super.beforeTest(); @@ -83,7 +77,6 @@ public class LruNearOnlyNearEvictionPolicySelfTest extends GridCommonAbstractTes cc.setCacheMode(cacheMode); cc.setAtomicityMode(atomicityMode); - cc.setMemoryMode(memMode); cc.setWriteSynchronizationMode(PRIMARY_SYNC); cc.setRebalanceMode(SYNC); cc.setStartSize(100); @@ -105,18 +98,6 @@ public class LruNearOnlyNearEvictionPolicySelfTest extends GridCommonAbstractTes public void testPartitionedAtomicNearEvictionMaxSize() throws Exception { atomicityMode = ATOMIC; cacheMode = PARTITIONED; - memMode = ONHEAP_TIERED; - - checkNearEvictionMaxSize(); - } - - /** - * @throws Exception If failed. - */ - public void testPartitionedAtomicOffHeapNearEvictionMaxSize() throws Exception { - atomicityMode = ATOMIC; - cacheMode = PARTITIONED; - memMode = OFFHEAP_TIERED; checkNearEvictionMaxSize(); } @@ -127,18 +108,6 @@ public class LruNearOnlyNearEvictionPolicySelfTest extends GridCommonAbstractTes public void testPartitionedTransactionalNearEvictionMaxSize() throws Exception { atomicityMode = TRANSACTIONAL; cacheMode = PARTITIONED; - memMode = ONHEAP_TIERED; - - checkNearEvictionMaxSize(); - } - - /** - * @throws Exception If failed. - */ - public void testPartitionedTransactionalOffHeapNearEvictionMaxSize() throws Exception { - atomicityMode = TRANSACTIONAL; - cacheMode = PARTITIONED; - memMode = OFFHEAP_TIERED; checkNearEvictionMaxSize(); } @@ -149,18 +118,6 @@ public class LruNearOnlyNearEvictionPolicySelfTest extends GridCommonAbstractTes public void testReplicatedAtomicNearEvictionMaxSize() throws Exception { atomicityMode = ATOMIC; cacheMode = REPLICATED; - memMode = ONHEAP_TIERED; - - checkNearEvictionMaxSize(); - } - - /** - * @throws Exception If failed. - */ - public void testReplicatedAtomicOffHeapNearEvictionMaxSize() throws Exception { - atomicityMode = ATOMIC; - cacheMode = REPLICATED; - memMode = OFFHEAP_TIERED; checkNearEvictionMaxSize(); } @@ -171,18 +128,6 @@ public class LruNearOnlyNearEvictionPolicySelfTest extends GridCommonAbstractTes public void testReplicatedTransactionalNearEvictionMaxSize() throws Exception { atomicityMode = TRANSACTIONAL; cacheMode = REPLICATED; - memMode = ONHEAP_TIERED; - - checkNearEvictionMaxSize(); - } - - /** - * @throws Exception If failed. - */ - public void testReplicatedTransactionalOffHeapNearEvictionMaxSize() throws Exception { - atomicityMode = TRANSACTIONAL; - cacheMode = REPLICATED; - memMode = OFFHEAP_TIERED; checkNearEvictionMaxSize(); } http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/sorted/SortedEvictionPolicyPerformanceTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/sorted/SortedEvictionPolicyPerformanceTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/sorted/SortedEvictionPolicyPerformanceTest.java index de41691..a3a61a2 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/sorted/SortedEvictionPolicyPerformanceTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/sorted/SortedEvictionPolicyPerformanceTest.java @@ -80,7 +80,7 @@ public class SortedEvictionPolicyPerformanceTest extends GridCommonAbstractTest plc.setMaxSize(MAX_SIZE); ccfg.setEvictionPolicy(plc); - ccfg.setEvictSynchronized(false); + ccfg.setOnheapCacheEnabled(true); cfg.setPeerClassLoadingEnabled(false); http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicLocalOffheapExpiryPolicyTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicLocalOffheapExpiryPolicyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicLocalOffheapExpiryPolicyTest.java deleted file mode 100644 index 24a7478..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicLocalOffheapExpiryPolicyTest.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.expiry; - -import org.apache.ignite.cache.CacheMemoryMode; - -/** - * - */ -public class IgniteCacheAtomicLocalOffheapExpiryPolicyTest extends IgniteCacheAtomicLocalExpiryPolicyTest { - /** {@inheritDoc} */ - @Override protected CacheMemoryMode memoryMode() { - return CacheMemoryMode.OFFHEAP_TIERED; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicLocalOnheapExpiryPolicyTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicLocalOnheapExpiryPolicyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicLocalOnheapExpiryPolicyTest.java new file mode 100644 index 0000000..af178e5 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicLocalOnheapExpiryPolicyTest.java @@ -0,0 +1,26 @@ +/* + * 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.expiry; + +public class IgniteCacheAtomicLocalOnheapExpiryPolicyTest extends IgniteCacheAtomicLocalExpiryPolicyTest { + /** {@inheritDoc} */ + @Override protected boolean onheapCacheEnabled() { + return true; + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicOffheapExpiryPolicyTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicOffheapExpiryPolicyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicOffheapExpiryPolicyTest.java deleted file mode 100644 index 45a0183..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicOffheapExpiryPolicyTest.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.expiry; - -import org.apache.ignite.cache.CacheMemoryMode; - -/** - * - */ -public class IgniteCacheAtomicOffheapExpiryPolicyTest extends IgniteCacheAtomicExpiryPolicyTest { - /** {@inheritDoc} */ - @Override protected CacheMemoryMode memoryMode() { - return CacheMemoryMode.OFFHEAP_TIERED; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicOnheapExpiryPolicyTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicOnheapExpiryPolicyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicOnheapExpiryPolicyTest.java new file mode 100644 index 0000000..f71a4e3 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicOnheapExpiryPolicyTest.java @@ -0,0 +1,26 @@ +/* + * 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.expiry; + +public class IgniteCacheAtomicOnheapExpiryPolicyTest extends IgniteCacheAtomicExpiryPolicyTest { + /** {@inheritDoc} */ + @Override protected boolean onheapCacheEnabled() { + return true; + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicPrimaryWriteOrderOffheapExpiryPolicyTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicPrimaryWriteOrderOffheapExpiryPolicyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicPrimaryWriteOrderOffheapExpiryPolicyTest.java deleted file mode 100644 index 594a6d9..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicPrimaryWriteOrderOffheapExpiryPolicyTest.java +++ /dev/null @@ -1,31 +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.expiry; - -import org.apache.ignite.cache.CacheMemoryMode; - -/** - * - */ -public class IgniteCacheAtomicPrimaryWriteOrderOffheapExpiryPolicyTest extends - IgniteCacheAtomicPrimaryWriteOrderExpiryPolicyTest { - /** {@inheritDoc} */ - @Override protected CacheMemoryMode memoryMode() { - return CacheMemoryMode.OFFHEAP_TIERED; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicPrimaryWriteOrderWithStoreOffheapExpiryPolicyTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicPrimaryWriteOrderWithStoreOffheapExpiryPolicyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicPrimaryWriteOrderWithStoreOffheapExpiryPolicyTest.java deleted file mode 100644 index 51d8ba2..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicPrimaryWriteOrderWithStoreOffheapExpiryPolicyTest.java +++ /dev/null @@ -1,31 +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.expiry; - -import org.apache.ignite.cache.CacheMemoryMode; - -/** - * - */ -public class IgniteCacheAtomicPrimaryWriteOrderWithStoreOffheapExpiryPolicyTest extends - IgniteCacheAtomicPrimaryWriteOrderWithStoreExpiryPolicyTest { - /** {@inheritDoc} */ - @Override protected CacheMemoryMode memoryMode() { - return CacheMemoryMode.OFFHEAP_TIERED; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicReplicatedOffheapExpiryPolicyTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicReplicatedOffheapExpiryPolicyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicReplicatedOffheapExpiryPolicyTest.java deleted file mode 100644 index a65e155..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicReplicatedOffheapExpiryPolicyTest.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.expiry; - -import org.apache.ignite.cache.CacheMemoryMode; - -/** - * - */ -public class IgniteCacheAtomicReplicatedOffheapExpiryPolicyTest extends IgniteCacheAtomicReplicatedExpiryPolicyTest { - /** {@inheritDoc} */ - @Override protected CacheMemoryMode memoryMode() { - return CacheMemoryMode.OFFHEAP_TIERED; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicWithStoreOffheapExpiryPolicyTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicWithStoreOffheapExpiryPolicyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicWithStoreOffheapExpiryPolicyTest.java deleted file mode 100644 index ffb170b..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheAtomicWithStoreOffheapExpiryPolicyTest.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.expiry; - -import org.apache.ignite.cache.CacheMemoryMode; - -/** - * - */ -public class IgniteCacheAtomicWithStoreOffheapExpiryPolicyTest extends IgniteCacheAtomicWithStoreExpiryPolicyTest { - /** {@inheritDoc} */ - @Override protected CacheMemoryMode memoryMode() { - return CacheMemoryMode.OFFHEAP_TIERED; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java index e7a76db..a40c555 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java @@ -38,7 +38,6 @@ import javax.cache.processor.EntryProcessor; import javax.cache.processor.MutableEntry; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; -import org.apache.ignite.cache.CacheMemoryMode; import org.apache.ignite.cache.CachePeekMode; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.configuration.CacheConfiguration; @@ -110,11 +109,6 @@ public abstract class IgniteCacheExpiryPolicyAbstractTest extends IgniteCacheAbs cfg.setExpiryPolicyFactory(factory); - cfg.setMemoryMode(memoryMode()); - - if (memoryMode() == CacheMemoryMode.OFFHEAP_TIERED) - cfg.setOffHeapMaxMemory(0); - if (disableEagerTtl) cfg.setEagerTtl(false); @@ -122,13 +116,6 @@ public abstract class IgniteCacheExpiryPolicyAbstractTest extends IgniteCacheAbs } /** - * @return Cache memory mode. - */ - protected CacheMemoryMode memoryMode() { - return CacheMemoryMode.ONHEAP_TIERED; - } - - /** * @throws Exception if failed. */ public void testCreateUpdate0() throws Exception { http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyTestSuite.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyTestSuite.java index faa0cd5..58a8fdd 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyTestSuite.java @@ -48,19 +48,6 @@ public class IgniteCacheExpiryPolicyTestSuite extends TestSuite { suite.addTestSuite(IgniteCacheTxWithStoreExpiryPolicyTest.class); suite.addTestSuite(IgniteCacheTxReplicatedExpiryPolicyTest.class); - // Offheap tests. - suite.addTestSuite(IgniteCacheAtomicLocalOffheapExpiryPolicyTest.class); - suite.addTestSuite(IgniteCacheAtomicOffheapExpiryPolicyTest.class); - suite.addTestSuite(IgniteCacheAtomicWithStoreOffheapExpiryPolicyTest.class); - suite.addTestSuite(IgniteCacheAtomicPrimaryWriteOrderOffheapExpiryPolicyTest.class); - suite.addTestSuite(IgniteCacheAtomicPrimaryWriteOrderWithStoreOffheapExpiryPolicyTest.class); - suite.addTestSuite(IgniteCacheAtomicReplicatedOffheapExpiryPolicyTest.class); - - suite.addTestSuite(IgniteCacheTxLocalOffheapExpiryPolicyTest.class); - suite.addTestSuite(IgniteCacheTxOffheapExpiryPolicyTest.class); - suite.addTestSuite(IgniteCacheTxWithStoreOffheapExpiryPolicyTest.class); - suite.addTestSuite(IgniteCacheTxReplicatedOffheapExpiryPolicyTest.class); - suite.addTestSuite(IgniteCacheAtomicExpiryPolicyWithStoreTest.class); suite.addTestSuite(IgniteCacheTxExpiryPolicyWithStoreTest.class); http://git-wip-us.apache.org/repos/asf/ignite/blob/c56c4b8c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheTxLocalOffheapExpiryPolicyTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheTxLocalOffheapExpiryPolicyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheTxLocalOffheapExpiryPolicyTest.java deleted file mode 100644 index 60fa556..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheTxLocalOffheapExpiryPolicyTest.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.expiry; - -import org.apache.ignite.cache.CacheMemoryMode; - -/** - * - */ -public class IgniteCacheTxLocalOffheapExpiryPolicyTest extends IgniteCacheTxLocalExpiryPolicyTest { - /** {@inheritDoc} */ - @Override protected CacheMemoryMode memoryMode() { - return CacheMemoryMode.OFFHEAP_TIERED; - } -}
