ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [01/29] incubator-ignite git commit: #ignite-571: Remove CacheDistributionMode.
Date Mon, 06 Apr 2015 15:43:41 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-593 b6c605c11 -> fe57a53c3


#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-593
Commit: 9d8566438d3b43d50feda54fa4339663c11faf14
Parents: b7659f3
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Thu Apr 2 19:27:55 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
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;
     }
 }


Mime
View raw message