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 43E2718D59 for ; Fri, 8 May 2015 12:22:01 +0000 (UTC) Received: (qmail 85233 invoked by uid 500); 8 May 2015 12:22:01 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 85202 invoked by uid 500); 8 May 2015 12:22:01 -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 85193 invoked by uid 99); 8 May 2015 12:22:01 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 May 2015 12:22:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 7E5DEC2746 for ; Fri, 8 May 2015 12:22:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.23 X-Spam-Level: X-Spam-Status: No, score=-3.23 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id vy-9oUmcQR8P for ; Fri, 8 May 2015 12:21:57 +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 2394C21246 for ; Fri, 8 May 2015 12:21:57 +0000 (UTC) Received: (qmail 85060 invoked by uid 99); 8 May 2015 12:21:57 -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; Fri, 08 May 2015 12:21:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DA4E7E35CD; Fri, 8 May 2015 12:21: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: Fri, 08 May 2015 12:21:57 -0000 Message-Id: <4ed82207717f41c4bd9924861259a74e@git.apache.org> In-Reply-To: <8c982c91d34e4ac5aef7a0e8dd51aa44@git.apache.org> References: <8c982c91d34e4ac5aef7a0e8dd51aa44@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/9] incubator-ignite git commit: #ignite-286: Make cache full api test work in OFFHEAP_TIERED mode. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.java index 62e4452..216832c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.java @@ -17,13 +17,17 @@ package org.apache.ignite.internal.processors.cache.distributed.dht; +import org.apache.ignite.cache.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + /** * Tests colocated cache with values being stored off-heap. */ public class GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest extends GridCachePartitionedNearDisabledMultiNodeFullApiSelfTest { /** {@inheritDoc} */ - @Override protected boolean offHeapValues() { - return true; + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_VALUES; } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest.java new file mode 100644 index 0000000..875a913 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest.java @@ -0,0 +1,56 @@ +/* + * 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.dht; + +import org.apache.ignite.cache.*; +import org.apache.ignite.configuration.*; +import org.apache.ignite.internal.processors.cache.distributed.near.*; + +import static org.apache.ignite.cache.CacheAtomicityMode.*; +import static org.apache.ignite.cache.CacheMemoryMode.*; + +/** + * Tests colocated cache with off-heap tiered mode. + */ +public class GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest extends + GridCachePartitionedFullApiSelfTest { + /** {@inheritDoc} */ + @Override protected CacheAtomicityMode atomicityMode() { + return ATOMIC; + } + + /** {@inheritDoc} */ + @Override protected boolean txEnabled() { + return false; + } + + /** {@inheritDoc} */ + @Override protected boolean lockingEnabled() { + return false; + } + + /** {@inheritDoc} */ + @Override protected NearCacheConfiguration nearConfiguration() { + return null; + } + + /** {@inheritDoc} */ + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_TIERED; + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest.java new file mode 100644 index 0000000..bab26f7 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest.java @@ -0,0 +1,33 @@ +/* + * 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.dht; + +import org.apache.ignite.cache.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + +/** + * Tests colocated cache with off-heap tiered mode. + */ +public class GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest extends + GridCachePartitionedNearDisabledOffHeapFullApiSelfTest { + /** {@inheritDoc} */ + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_TIERED; + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest.java new file mode 100644 index 0000000..022f26b --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest.java @@ -0,0 +1,33 @@ +/* + * 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.dht; + +import org.apache.ignite.cache.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + +/** + * Tests colocated cache with off-heap tiered mode. + */ +public class GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest extends + GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest { + /** {@inheritDoc} */ + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_TIERED; + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredFullApiSelfTest.java new file mode 100644 index 0000000..b0d13e0 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredFullApiSelfTest.java @@ -0,0 +1,32 @@ +/* + * 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.near; + +import org.apache.ignite.cache.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + +/** + * Tests partitioned cache with off-heap tiered mode. + */ +public class GridCacheAtomicOffHeapTieredFullApiSelfTest extends GridCacheAtomicOffHeapFullApiSelfTest { + /** {@inheritDoc} */ + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_TIERED; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest.java new file mode 100644 index 0000000..b3adf14 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest.java @@ -0,0 +1,33 @@ +/* + * 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.near; + +import org.apache.ignite.cache.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + +/** + * Tests partitioned cache with off-heap tiered mode. + */ +public class GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest extends + GridCacheAtomicOffHeapMultiNodeFullApiSelfTest { + /** {@inheritDoc} */ + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_TIERED; + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest.java new file mode 100644 index 0000000..41e98b2 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest.java @@ -0,0 +1,33 @@ +/* + * 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.near; + +import org.apache.ignite.cache.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + +/** + * Tests partitioned cache with off-heap tiered mode. + */ +public class GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest extends + GridCacheAtomicPrimaryWriteOrderOffHeapFullApiSelfTest { + /** {@inheritDoc} */ + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_TIERED; + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest.java new file mode 100644 index 0000000..f29cdd0 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest.java @@ -0,0 +1,33 @@ +/* + * 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.near; + +import org.apache.ignite.cache.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + +/** + * Tests partitioned cache with off-heap tiered mode. + */ +public class GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest extends + GridCacheAtomicPrimaryWrityOrderOffHeapMultiNodeFullApiSelfTest { + /** {@inheritDoc} */ + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_TIERED; + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java index caacc2b..84594a2 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java @@ -27,7 +27,6 @@ import org.apache.ignite.internal.*; import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.lang.*; -import javax.cache.*; import java.util.*; import java.util.concurrent.atomic.*; @@ -138,12 +137,12 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti int size = 10; - IgniteCache prj0 = grid(0).cache(null); + IgniteCache chache0 = grid(0).cache(null); for (int i = 0; i < size; i++) { info("Putting value [i=" + i + ']'); - prj0.put(i, i); + chache0.put(i, i); info("Finished putting value [i=" + i + ']'); } @@ -156,26 +155,30 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti for (int k = 0; k < size; k++) { if (affinity(cache).isPrimaryOrBackup(node, k)) - assertEquals("Check failed for node: " + node.id(), k, cache.localPeek(k, ONHEAP)); + assertEquals("Check failed for node: " + node.id(), k, + cache.localPeek(k, CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP)); } } for (int i = 0; i < size; i++) { info("Putting value 2 [i=" + i + ']'); - assertEquals(i, prj0.getAndPutIfAbsent(i, i * i)); + assertEquals(i, chache0.getAndPutIfAbsent(i, i * i)); info("Finished putting value 2 [i=" + i + ']'); } for (int i = 0; i < size; i++) - assertEquals(i, prj0.get(i)); + assertEquals(i, chache0.get(i)); } /** * @throws Exception If failed. */ public void testUnswapShort() throws Exception { + if (memoryMode() == CacheMemoryMode.OFFHEAP_TIERED) + return; + final AtomicInteger swapEvts = new AtomicInteger(0); final AtomicInteger unswapEvts = new AtomicInteger(0); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapFullApiSelfTest.java index d77efcf..78c8ab7 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapFullApiSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapFullApiSelfTest.java @@ -17,12 +17,16 @@ package org.apache.ignite.internal.processors.cache.distributed.near; +import org.apache.ignite.cache.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + /** * Tests partitioned cache with values being stored off-heap. */ public class GridCachePartitionedOffHeapFullApiSelfTest extends GridCachePartitionedFullApiSelfTest { /** {@inheritDoc} */ - @Override protected boolean offHeapValues() { - return true; + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_VALUES; } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapMultiNodeFullApiSelfTest.java index c7a04fc..4724d9d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapMultiNodeFullApiSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapMultiNodeFullApiSelfTest.java @@ -17,12 +17,16 @@ package org.apache.ignite.internal.processors.cache.distributed.near; +import org.apache.ignite.cache.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + /** * Tests partitioned cache with values being stored off-heap. */ public class GridCachePartitionedOffHeapMultiNodeFullApiSelfTest extends GridCachePartitionedMultiNodeFullApiSelfTest { /** {@inheritDoc} */ - @Override protected boolean offHeapValues() { - return true; + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_VALUES; } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredFullApiSelfTest.java new file mode 100644 index 0000000..365e9aa --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredFullApiSelfTest.java @@ -0,0 +1,32 @@ +/* + * 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.near; + +import org.apache.ignite.cache.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + +/** + * Tests partitioned cache with off-heap tiered mode. + */ +public class GridCachePartitionedOffHeapTieredFullApiSelfTest extends GridCachePartitionedOffHeapFullApiSelfTest { + /** {@inheritDoc} */ + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_TIERED; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest.java new file mode 100644 index 0000000..4392365 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest.java @@ -0,0 +1,72 @@ +/* + * 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.near; + +import org.apache.ignite.*; +import org.apache.ignite.cache.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + +/** + * Tests partitioned cache with off-heap tiered mode. + */ +public class GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest extends GridCachePartitionedOffHeapMultiNodeFullApiSelfTest { + /** {@inheritDoc} */ + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_TIERED; + } + + /** + * @throws Exception If failed. + */ + public void testPut() throws Exception { + IgniteCache cache = grid(0).cache(null); + + assert gridCount() > 3; + String key = null; + + for (int i = 0; i < 250; ++i) { + String testKey = "key_" + i; + + if (!grid(0).affinity(null).isPrimaryOrBackup(grid(0).localNode(), testKey)) { + key = testKey; + + break; + } + } + + assert key != null; + + IgniteCache primaryCache = primaryCache(key); + + assertFalse(grid(0).affinity(null).isPrimary(grid(0).localNode(), key)); + assertFalse(grid(0).affinity(null).isBackup(grid(0).localNode(), key)); + + primaryCache.put(key, 4); // Put from primary. + + assertNull(primaryCache.localPeek(key, CachePeekMode.ONHEAP)); + assertEquals(4, primaryCache.localPeek(key, CachePeekMode.OFFHEAP).intValue()); + + cache.put(key, 5); // Put from near to add reader on primary. + + assertEquals(5, primaryCache.localPeek(key, CachePeekMode.ONHEAP).intValue()); + assertEquals(5, primaryCache.localPeek(key, CachePeekMode.OFFHEAP).intValue()); + assertEquals(5, cache.get(key).intValue()); + assertEquals(5, map.get(key)); + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/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 index c9b9072..1cb5df5 100644 --- 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 @@ -17,12 +17,16 @@ package org.apache.ignite.internal.processors.cache.distributed.replicated; +import org.apache.ignite.cache.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + /** * Tests replicated cache with values being stored off-heap. */ public class GridCacheReplicatedOffHeapFullApiSelfTest extends GridCacheReplicatedFullApiSelfTest { /** {@inheritDoc} */ - @Override protected boolean offHeapValues() { - return true; + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_VALUES; } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/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 index 382b0f9..f79f898 100644 --- 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 @@ -17,12 +17,16 @@ package org.apache.ignite.internal.processors.cache.distributed.replicated; +import org.apache.ignite.cache.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + /** * Tests replicated cache with values being stored off-heap. */ public class GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest extends GridCacheReplicatedMultiNodeFullApiSelfTest { /** {@inheritDoc} */ - @Override protected boolean offHeapValues() { - return true; + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_VALUES; } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/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 new file mode 100644 index 0000000..8162c8e --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredFullApiSelfTest.java @@ -0,0 +1,33 @@ +/* + * 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.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + +/** + * Tests replicated cache with off-heap tiered mode. + */ +public class GridCacheReplicatedOffHeapTieredFullApiSelfTest extends + GridCacheReplicatedOffHeapFullApiSelfTest { + /** {@inheritDoc} */ + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_TIERED; + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/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 new file mode 100644 index 0000000..0e2bf90 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest.java @@ -0,0 +1,33 @@ +/* + * 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.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + +/** + * Tests replicated cache with off-heap tiered mode. + */ +public class GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest extends + GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest{ + /** {@inheritDoc} */ + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_TIERED; + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalAtomicOffHeapTieredFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalAtomicOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalAtomicOffHeapTieredFullApiSelfTest.java new file mode 100644 index 0000000..b4e8cf1 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalAtomicOffHeapTieredFullApiSelfTest.java @@ -0,0 +1,32 @@ +/* + * 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.local; + +import org.apache.ignite.cache.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + +/** + * Tests local cache in atomic mode with off-heap tiered mode. + */ +public class GridCacheLocalAtomicOffHeapTieredFullApiSelfTest extends GridCacheLocalAtomicOffHeapFullApiSelfTest{ + /** {@inheritDoc} */ + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_TIERED; + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapFullApiSelfTest.java index 31b8bee..e2621ce 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapFullApiSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapFullApiSelfTest.java @@ -17,12 +17,14 @@ package org.apache.ignite.internal.processors.cache.local; +import org.apache.ignite.cache.*; + /** * Tests local cache with values being stored offheap. */ public class GridCacheLocalOffHeapFullApiSelfTest extends GridCacheLocalFullApiSelfTest { /** {@inheritDoc} */ - @Override protected boolean offHeapValues() { - return true; + @Override protected CacheMemoryMode memoryMode() { + return CacheMemoryMode.OFFHEAP_VALUES; } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapTieredFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapTieredFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapTieredFullApiSelfTest.java new file mode 100644 index 0000000..c6ce9da --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalOffHeapTieredFullApiSelfTest.java @@ -0,0 +1,32 @@ +/* + * 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.local; + +import org.apache.ignite.cache.*; + +import static org.apache.ignite.cache.CacheMemoryMode.*; + +/** + * Tests local cache with off-heap tired memory mode. + */ +public class GridCacheLocalOffHeapTieredFullApiSelfTest extends GridCacheLocalOffHeapFullApiSelfTest { + /** {@inheritDoc} */ + @Override protected CacheMemoryMode memoryMode() { + return OFFHEAP_TIERED; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java index d5760ee..56ff951 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java @@ -73,6 +73,7 @@ public class IgniteBasicTestSuite extends TestSuite { suite.addTestSuite(GridLifecycleAwareSelfTest.class); suite.addTestSuite(GridMessageListenSelfTest.class); suite.addTestSuite(GridFailFastNodeFailureDetectionSelfTest.class); + suite.addTestSuite(OffHeapTieredTransactionSelfTest.class); return suite; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java index acf6c64..369e041 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java @@ -60,6 +60,16 @@ public class IgniteCacheFullApiSelfTestSuite extends TestSuite { suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderOffHeapFullApiSelfTest.class); suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapFullApiSelfTest.class); + // One node with off-heap tiered mode. + suite.addTestSuite(GridCacheLocalOffHeapTieredFullApiSelfTest.class); + suite.addTestSuite(GridCacheLocalAtomicOffHeapTieredFullApiSelfTest.class); + suite.addTestSuite(GridCacheReplicatedOffHeapTieredFullApiSelfTest.class); + suite.addTestSuite(GridCachePartitionedOffHeapTieredFullApiSelfTest.class); + suite.addTestSuite(GridCacheAtomicOffHeapTieredFullApiSelfTest.class); + suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderOffHeapTieredFullApiSelfTest.class); + suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapTieredFullApiSelfTest.class); + suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapTieredAtomicFullApiSelfTest.class); + // Multi-node. suite.addTestSuite(GridCacheReplicatedMultiNodeFullApiSelfTest.class); suite.addTestSuite(GridCacheReplicatedMultiNodeP2PDisabledFullApiSelfTest.class); @@ -112,6 +122,14 @@ public class IgniteCacheFullApiSelfTestSuite extends TestSuite { suite.addTestSuite(GridCacheAtomicPrimaryWrityOrderOffHeapMultiNodeFullApiSelfTest.class); suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest.class); + // Multi-node with off-heap tiered mode. + suite.addTestSuite(GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest.class); + suite.addTestSuite(GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest.class); + suite.addTestSuite(GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest.class); + suite.addTestSuite(GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest.class); + suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest.class); + suite.addTestSuite(GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiNodeFullApiSelfTest.class); + // Private cache API. suite.addTestSuite(GridCacheExLocalFullApiSelfTest.class); suite.addTestSuite(GridCacheExReplicatedFullApiSelfTest.class); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest.java new file mode 100644 index 0000000..8b09d0f --- /dev/null +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.cache; + +import org.apache.ignite.cache.*; +import org.apache.ignite.configuration.*; + +/** + * Test queries in off-heap tired mode. + */ +public class IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest extends IgniteCacheQueryMultiThreadedSelfTest { + /** {@inheritDoc} */ + @Override protected CacheConfiguration cacheConfiguration() { + CacheConfiguration ccfg = super.cacheConfiguration(); + + ccfg.setCacheMode(CacheMode.REPLICATED); + ccfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED); + ccfg.setOffHeapMaxMemory(0); + + return ccfg; + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java index daca7dc..54bc814 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java @@ -86,6 +86,17 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes cfg.setSwapSpaceSpi(new FileSwapSpaceSpi()); cfg.setMarshaller(new OptimizedMarshaller(false)); + cfg.setCacheConfiguration(cacheConfiguration()); + + GridQueryProcessor.idxCls = FakeIndexing.class; + + return cfg; + } + + /** + * @return Cache configuration. + */ + protected CacheConfiguration cacheConfiguration() { CacheConfiguration cacheCfg = defaultCacheConfiguration(); cacheCfg.setCacheMode(PARTITIONED); @@ -106,11 +117,7 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes if (offheapEnabled()) cacheCfg.setOffHeapMaxMemory(evictsEnabled() ? 1000 : 0); // Small offheap for evictions. - cfg.setCacheConfiguration(cacheCfg); - - GridQueryProcessor.idxCls = FakeIndexing.class; - - return cfg; + return cacheCfg; } /** @@ -235,6 +242,9 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes final IgniteCache c = g.cache(null); final IgniteCache cl = g.cache(null); + if (c.getConfiguration(CacheConfiguration.class).getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED) + return; + assertEquals(0, g.cache(null).localSize()); assertEquals(0, c.query(new SqlQuery(String.class, "1 = 1")).getAll().size()); assertEquals(0, cl.query(new SqlQuery(Long.class, "1 = 1")).getAll().size()); @@ -307,6 +317,9 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes final IgniteCache c = g.cache(null); final IgniteCache c1 = g.cache(null); + if (c.getConfiguration(CacheConfiguration.class).getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED) + return; + assertEquals(0, g.cache(null).localSize()); assertEquals(0, c1.query(new SqlQuery(String.class, "1 = 1")).getAll().size()); assertEquals(0, c.query(new SqlQuery(Long.class, "1 = 1")).getAll().size()); @@ -379,6 +392,9 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes // Put test values into cache. final IgniteCache c = g.cache(null); + if (c.getConfiguration(CacheConfiguration.class).getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED) + return; + assertEquals(0, g.cache(null).size()); assertEquals(0, c.query(new SqlQuery(Object.class, "1 = 1")).getAll().size()); @@ -450,6 +466,9 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes // Put test values into cache. final IgniteCache c = g.cache(null); + if (c.getConfiguration(CacheConfiguration.class).getMemoryMode() == CacheMemoryMode.OFFHEAP_TIERED) + return; + assertEquals(0, g.cache(null).localSize()); assertEquals(0, c.query(new SqlQuery(TestValue.class, "1 = 1")).getAll().size()); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/745cf7f9/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java index 69d7548..f42963a 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java +++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java @@ -59,6 +59,7 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite { suite.addTestSuite(IgniteCacheLargeResultSelfTest.class); suite.addTestSuite(GridCacheQueryInternalKeysSelfTest.class); suite.addTestSuite(IgniteCacheQueryMultiThreadedSelfTest.class); + suite.addTestSuite(IgniteCacheQueryMultiThreadedOffHeapTiredSelfTest.class); suite.addTestSuite(IgniteCacheQueryEvictsMultiThreadedSelfTest.class); suite.addTestSuite(IgniteCacheQueryOffheapMultiThreadedSelfTest.class); suite.addTestSuite(IgniteCacheQueryOffheapEvictsMultiThreadedSelfTest.class);