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 54B7017DC0 for ; Mon, 6 Apr 2015 17:37:16 +0000 (UTC) Received: (qmail 68787 invoked by uid 500); 6 Apr 2015 17:37:16 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 68758 invoked by uid 500); 6 Apr 2015 17:37:16 -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 68749 invoked by uid 99); 6 Apr 2015 17:37:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Apr 2015 17:37:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 06 Apr 2015 17:36:43 +0000 Received: (qmail 65589 invoked by uid 99); 6 Apr 2015 17:36:40 -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; Mon, 06 Apr 2015 17:36:40 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 097A8E1121; Mon, 6 Apr 2015 17:36:40 +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: Mon, 06 Apr 2015 17:36:41 -0000 Message-Id: <9f2d7917bee54d6b9e3e5918325b1430@git.apache.org> In-Reply-To: <6db7be5b87b349f4bb7e0d97c0449452@git.apache.org> References: <6db7be5b87b349f4bb7e0d97c0449452@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/46] incubator-ignite git commit: #ignite-571: Remove CacheDistributionMode. X-Virus-Checked: Checked by ClamAV on apache.org #ignite-571: Remove CacheDistributionMode. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9d856643 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9d856643 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9d856643 Branch: refs/heads/ignite-366 Commit: 9d8566438d3b43d50feda54fa4339663c11faf14 Parents: b7659f3 Author: ivasilinets Authored: Thu Apr 2 19:27:55 2015 +0300 Committer: ivasilinets Committed: Thu Apr 2 19:27:55 2015 +0300 ---------------------------------------------------------------------- modules/clients/readme.md | 2 - .../processors/cache/CacheDistributionMode.java | 67 -------------------- .../IgniteCollectionAbstractTest.java | 23 ------- ...ePartitionedBasicStoreMultiNodeSelfTest.java | 7 +- ...NearDisabledBasicStoreMultiNodeSelfTest.java | 8 +-- .../cache/IgniteCacheAbstractQuerySelfTest.java | 6 +- ...niteCacheAtomicNearEnabledQuerySelfTest.java | 7 +- .../near/IgniteCacheAtomicQuerySelfTest.java | 7 +- 8 files changed, 16 insertions(+), 111 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9d856643/modules/clients/readme.md ---------------------------------------------------------------------- diff --git a/modules/clients/readme.md b/modules/clients/readme.md index 4b0d365..007daf4 100644 --- a/modules/clients/readme.md +++ b/modules/clients/readme.md @@ -30,5 +30,3 @@ could not (*or should not*) be started. ## Client vs Grid Node Note that for performance and ease-of-use reasons, you should always prefer to start grid node in your cluster instead of remote client. Grid node will generally perform a lot faster and can easily exhibit client-only functionality by excluding it from task/job execution and from caching data. -For example, you can prevent a grid node from participating in caching by setting `CacheConfiguration.setDistributionMode(...)` value to either `CLIENT_ONLY` or `NEAR_ONLY`. - http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9d856643/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDistributionMode.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDistributionMode.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDistributionMode.java deleted file mode 100644 index c392164..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDistributionMode.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.cache; - -import org.apache.ignite.configuration.*; -import org.jetbrains.annotations.*; - -/** - * This enum defines mode in which partitioned cache operates. - */ -public enum CacheDistributionMode { - /** - * Mode in which local node does not cache any data and communicates with other cache nodes - * via remote calls. - */ - CLIENT_ONLY, - - /** - * Mode in which local node will not be either primary or backup node for any keys, but will cache - * recently accessed keys in a smaller near cache. Amount of recently accessed keys to cache is - * controlled by near eviction policy. - * - * @see NearCacheConfiguration#getNearEvictionPolicy() - */ - NEAR_ONLY, - - /** - * Mode in which local node may store primary and/or backup keys, and also will cache recently accessed keys. - * Amount of recently accessed keys to cache is controlled by near eviction policy. - * @see NearCacheConfiguration#getNearEvictionPolicy() - */ - NEAR_PARTITIONED, - - /** - * Mode in which local node may store primary or backup keys, but does not cache recently accessed keys - * in near cache. - */ - PARTITIONED_ONLY; - - /** Enumerated values. */ - private static final CacheDistributionMode[] VALS = values(); - - /** - * Efficiently gets enumerated value from its ordinal. - * - * @param ord Ordinal value. - * @return Enumerated value or {@code null} if ordinal out of range. - */ - @Nullable public static CacheDistributionMode fromOrdinal(int ord) { - return ord >= 0 && ord < VALS.length ? VALS[ord] : null; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9d856643/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteCollectionAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteCollectionAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteCollectionAbstractTest.java index d82618e..1d4642b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteCollectionAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteCollectionAbstractTest.java @@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache.datastructures; import org.apache.ignite.cache.*; import org.apache.ignite.configuration.*; -import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.spi.discovery.tcp.*; import org.apache.ignite.spi.discovery.tcp.ipfinder.*; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*; @@ -27,7 +26,6 @@ import org.apache.ignite.testframework.junits.common.*; import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.*; import static org.apache.ignite.cache.CacheAtomicityMode.*; -import static org.apache.ignite.internal.processors.cache.CacheDistributionMode.*; import static org.apache.ignite.cache.CacheMemoryMode.*; import static org.apache.ignite.cache.CacheMode.*; import static org.apache.ignite.cache.CacheRebalanceMode.*; @@ -95,7 +93,6 @@ public abstract class IgniteCollectionAbstractTest extends GridCommonAbstractTes colCfg.setCacheMode(collectionCacheMode()); colCfg.setAtomicityMode(collectionCacheAtomicityMode()); - colCfg.setDistributionMode(PARTITIONED_ONLY); if (colCfg.getCacheMode() == PARTITIONED) colCfg.setBackups(1); @@ -144,9 +141,6 @@ public abstract class IgniteCollectionAbstractTest extends GridCommonAbstractTes /** Default memory mode. */ public static final CacheMemoryMode DFLT_MEMORY_MODE = ONHEAP_TIERED; - /** Default distribution mode. */ - public static final CacheDistributionMode DFLT_DISTRIBUTION_MODE = PARTITIONED_ONLY; - /** Default off-heap storage size is {@code -1} which means that off-heap storage is disabled. */ public static final long DFLT_OFFHEAP_MEMORY = -1; @@ -156,9 +150,6 @@ public abstract class IgniteCollectionAbstractTest extends GridCommonAbstractTes /** Cache mode. */ private CacheMode cacheMode = DFLT_CACHE_MODE; - /** Cache distribution mode. */ - private CacheDistributionMode distro = DFLT_DISTRIBUTION_MODE; - /** Number of backups. */ private int backups = DFLT_BACKUPS; @@ -225,20 +216,6 @@ public abstract class IgniteCollectionAbstractTest extends GridCommonAbstractTes } /** - * @return Cache distribution mode. - */ - public CacheDistributionMode getDistributionMode() { - return distro; - } - - /** - * @param distro Cache distribution mode. - */ - public void setDistributionMode(CacheDistributionMode distro) { - this.distro = distro; - } - - /** * @param offHeapMaxMem Maximum memory in bytes available to off-heap memory space. */ public void setOffHeapMaxMemory(long offHeapMaxMem) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9d856643/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java index d4ea95f..43f886d 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java @@ -31,7 +31,6 @@ import org.apache.ignite.transactions.*; import java.util.*; import static org.apache.ignite.cache.CacheAtomicityMode.*; -import static org.apache.ignite.internal.processors.cache.CacheDistributionMode.*; import static org.apache.ignite.cache.CacheMode.*; import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*; import static org.apache.ignite.transactions.TransactionConcurrency.*; @@ -109,14 +108,16 @@ public class GridCachePartitionedBasicStoreMultiNodeSelfTest extends GridCommonA c.setCacheConfiguration(cc); + c.setNearCacheConfiguration(mode()); + return c; } /** * @return Distribution mode. */ - protected CacheDistributionMode mode() { - return NEAR_PARTITIONED; + protected NearCacheConfiguration mode() { + return new NearCacheConfiguration(); } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9d856643/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNearDisabledBasicStoreMultiNodeSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNearDisabledBasicStoreMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNearDisabledBasicStoreMultiNodeSelfTest.java index 5338c4d..00cb260 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNearDisabledBasicStoreMultiNodeSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedNearDisabledBasicStoreMultiNodeSelfTest.java @@ -17,9 +17,7 @@ package org.apache.ignite.internal.processors.cache.distributed.near; -import org.apache.ignite.internal.processors.cache.*; - -import static org.apache.ignite.internal.processors.cache.CacheDistributionMode.*; +import org.apache.ignite.configuration.*; /** * @@ -27,7 +25,7 @@ import static org.apache.ignite.internal.processors.cache.CacheDistributionMode. public class GridCachePartitionedNearDisabledBasicStoreMultiNodeSelfTest extends GridCachePartitionedBasicStoreMultiNodeSelfTest { /** {@inheritDoc} */ - @Override protected CacheDistributionMode mode() { - return PARTITIONED_ONLY; + @Override protected NearCacheConfiguration mode() { + return null; } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9d856643/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java index 88effe1..cbefec4 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java @@ -50,7 +50,6 @@ import java.util.concurrent.*; import static java.util.concurrent.TimeUnit.*; import static org.apache.ignite.cache.CacheAtomicityMode.*; -import static org.apache.ignite.internal.processors.cache.CacheDistributionMode.*; import static org.apache.ignite.cache.CacheMode.*; import static org.apache.ignite.cache.CacheRebalanceMode.*; import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*; @@ -91,8 +90,8 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac /** * @return Distribution. */ - protected CacheDistributionMode distributionMode() { - return NEAR_PARTITIONED; + protected NearCacheConfiguration nearCacheConfiguration() { + return new NearCacheConfiguration(); } /** {@inheritDoc} */ @@ -122,6 +121,7 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac cc.setCacheMode(cacheMode()); cc.setAtomicityMode(atomicityMode()); + cc.setNearConfiguration(nearCacheConfiguration()); cc.setWriteSynchronizationMode(FULL_SYNC); cc.setCacheStoreFactory(new StoreFactory()); cc.setReadThrough(true); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9d856643/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheAtomicNearEnabledQuerySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheAtomicNearEnabledQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheAtomicNearEnabledQuerySelfTest.java index 14bf39b..ea10cbd 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheAtomicNearEnabledQuerySelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheAtomicNearEnabledQuerySelfTest.java @@ -18,10 +18,9 @@ package org.apache.ignite.internal.processors.cache.distributed.near; import org.apache.ignite.cache.*; -import org.apache.ignite.internal.processors.cache.*; +import org.apache.ignite.configuration.*; import static org.apache.ignite.cache.CacheAtomicityMode.*; -import static org.apache.ignite.internal.processors.cache.CacheDistributionMode.*; /** * Tests for atomic cache with near cache enabled. @@ -33,7 +32,7 @@ public class IgniteCacheAtomicNearEnabledQuerySelfTest extends IgniteCachePartit } /** {@inheritDoc} */ - @Override protected CacheDistributionMode distributionMode() { - return NEAR_PARTITIONED; + @Override protected NearCacheConfiguration nearCacheConfiguration() { + return new NearCacheConfiguration(); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9d856643/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheAtomicQuerySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheAtomicQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheAtomicQuerySelfTest.java index a2fcb8f..c773c3c 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheAtomicQuerySelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheAtomicQuerySelfTest.java @@ -18,10 +18,9 @@ package org.apache.ignite.internal.processors.cache.distributed.near; import org.apache.ignite.cache.*; -import org.apache.ignite.internal.processors.cache.*; +import org.apache.ignite.configuration.*; import static org.apache.ignite.cache.CacheAtomicityMode.*; -import static org.apache.ignite.internal.processors.cache.CacheDistributionMode.*; /** * Tests for partitioned cache queries. @@ -33,7 +32,7 @@ public class IgniteCacheAtomicQuerySelfTest extends IgniteCachePartitionedQueryS } /** {@inheritDoc} */ - @Override protected CacheDistributionMode distributionMode() { - return PARTITIONED_ONLY; + @Override protected NearCacheConfiguration nearCacheConfiguration() { + return null; } }