Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3E8EA17784 for ; Tue, 12 May 2015 13:48:32 +0000 (UTC) Received: (qmail 43991 invoked by uid 500); 12 May 2015 13:48:32 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 43965 invoked by uid 500); 12 May 2015 13:48:32 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 43955 invoked by uid 99); 12 May 2015 13:48:32 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 May 2015 13:48:32 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id A8CC81A2A37 for ; Tue, 12 May 2015 13:48:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.771 X-Spam-Level: * X-Spam-Status: No, score=1.771 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id oJJD1rToX43u for ; Tue, 12 May 2015 13:48:24 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id 01745286C4 for ; Tue, 12 May 2015 13:48:11 +0000 (UTC) Received: (qmail 40970 invoked by uid 99); 12 May 2015 13:46:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 May 2015 13:46:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D60CBE05DD; Tue, 12 May 2015 13:46:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Tue, 12 May 2015 13:47:21 -0000 Message-Id: <31eeb70b40bc48429aeae46c014c4ba5@git.apache.org> In-Reply-To: <2836d97513fc4c9c84150ded41832577@git.apache.org> References: <2836d97513fc4c9c84150ded41832577@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [26/28] incubator-ignite git commit: # ignite-sprint-5 added test # ignite-sprint-5 added test Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6395b434 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6395b434 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6395b434 Branch: refs/heads/ignite-709_2 Commit: 6395b434e37b93f025c7b81802a77aa4f1aebf4c Parents: f6012f1 Author: sboikov Authored: Tue May 12 16:02:45 2015 +0300 Committer: sboikov Committed: Tue May 12 16:02:45 2015 +0300 ---------------------------------------------------------------------- .../cache/GridCacheOffheapIndexGetSelfTest.java | 111 +++++++++++++++++++ .../IgniteCacheWithIndexingTestSuite.java | 2 + 2 files changed, 113 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6395b434/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexGetSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexGetSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexGetSelfTest.java new file mode 100644 index 0000000..4e40040 --- /dev/null +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapIndexGetSelfTest.java @@ -0,0 +1,111 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.cache; + +import org.apache.ignite.*; +import org.apache.ignite.configuration.*; +import org.apache.ignite.spi.discovery.tcp.*; +import org.apache.ignite.spi.discovery.tcp.ipfinder.*; +import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*; +import org.apache.ignite.spi.swapspace.file.*; +import org.apache.ignite.testframework.junits.common.*; + +import static org.apache.ignite.cache.CacheAtomicityMode.*; +import static org.apache.ignite.cache.CacheMemoryMode.*; +import static org.apache.ignite.cache.CacheMode.*; +import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*; +import static org.apache.ignite.configuration.DeploymentMode.*; + +/** + * Tests off heap storage when both offheaped and swapped entries exists. + */ +public class GridCacheOffheapIndexGetSelfTest extends GridCommonAbstractTest { + /** */ + private static final long OFFHEAP_MEM = 10L * 1024L; + + /** */ + private final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true); + + /** {@inheritDoc} */ + @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { + IgniteConfiguration cfg = super.getConfiguration(gridName); + + TcpDiscoverySpi disco = new TcpDiscoverySpi(); + + disco.setIpFinder(ipFinder); + + cfg.setDiscoverySpi(disco); + + cfg.setNetworkTimeout(2000); + + cfg.setSwapSpaceSpi(new FileSwapSpaceSpi()); + + CacheConfiguration cacheCfg = defaultCacheConfiguration(); + + cacheCfg.setWriteSynchronizationMode(FULL_SYNC); + cacheCfg.setSwapEnabled(true); + cacheCfg.setCacheMode(PARTITIONED); + cacheCfg.setBackups(1); + cacheCfg.setOffHeapMaxMemory(OFFHEAP_MEM); + cacheCfg.setEvictSynchronized(true); + cacheCfg.setEvictSynchronizedKeyBufferSize(1); + cacheCfg.setAtomicityMode(TRANSACTIONAL); + cacheCfg.setMemoryMode(OFFHEAP_TIERED); + cacheCfg.setEvictionPolicy(null); + cacheCfg.setOffHeapMaxMemory(OFFHEAP_MEM); + cacheCfg.setIndexedTypes(Long.class, Long.class); + + cfg.setCacheConfiguration(cacheCfg); + + cfg.setDeploymentMode(SHARED); + + return cfg; + } + + /** {@inheritDoc} */ + @Override protected void beforeTestsStarted() throws Exception { + startGrids(2); + } + + /** {@inheritDoc} */ + @Override protected void afterTestsStopped() throws Exception { + stopAllGrids(); + } + + /** {@inheritDoc} */ + @Override protected void afterTest() throws Exception { + grid(0).cache(null).clear(); + } + + /** + * Tests behavior on offheaped entries. + * + * @throws Exception If failed. + */ + public void testGet() throws Exception { + fail("https://issues.apache.org/jira/browse/IGNITE-873"); + + IgniteCache cache = grid(0).cache(null); + + for (long i = 0; i < 100; i++) + cache.put(i, i); + + for (long i = 0; i < 100; i++) + assertEquals((Long)i, cache.get(i)); + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6395b434/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java index a2ccc82..ae45120 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java +++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java @@ -46,6 +46,8 @@ public class IgniteCacheWithIndexingTestSuite extends TestSuite { suite.addTestSuite(CacheTtlOnheapAtomicLocalSelfTest.class); suite.addTestSuite(CacheTtlOnheapAtomicPartitionedSelfTest.class); + suite.addTestSuite(GridCacheOffheapIndexGetSelfTest.class); + suite.addTestSuite(CacheConfigurationP2PTest.class); return suite;