You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/04/14 15:27:46 UTC

[21/44] ignite git commit: IGNITE-4915: Removed IgniteCluster "mapKeyToNode" and "mapKeysToNodes" methods.

IGNITE-4915: Removed IgniteCluster "mapKeyToNode" and "mapKeysToNodes" methods.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0f9eefb4
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0f9eefb4
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0f9eefb4

Branch: refs/heads/ignite-4986
Commit: 0f9eefb413af6783dd423babdfdb5c6646ed4f6e
Parents: 45b51b8
Author: tledkov-gridgain <tl...@gridgain.com>
Authored: Fri Apr 14 15:50:14 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Fri Apr 14 15:50:14 2017 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/IgniteCluster.java   | 52 --------------------
 .../cluster/IgniteClusterAsyncImpl.java         | 11 -----
 .../internal/cluster/IgniteClusterImpl.java     | 38 --------------
 .../cache/GridCacheDeploymentSelfTest.java      |  2 +-
 .../multijvm/IgniteClusterProcessProxy.java     | 11 -----
 5 files changed, 1 insertion(+), 113 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0f9eefb4/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java b/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
index dc7b687..0846066 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
@@ -22,8 +22,6 @@ import java.util.Collection;
 import java.util.Map;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentMap;
-import org.apache.ignite.cache.affinity.Affinity;
-import org.apache.ignite.cache.affinity.AffinityFunction;
 import org.apache.ignite.cluster.ClusterGroup;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.cluster.ClusterStartNodeResult;
@@ -107,56 +105,6 @@ public interface IgniteCluster extends ClusterGroup, IgniteAsyncSupport {
     public Collection<ClusterNode> topology(long topVer) throws UnsupportedOperationException;
 
     /**
-     * This method provides ability to detect which cache keys are mapped to which nodes
-     * on cache instance with given name. Use it to determine which nodes are storing which
-     * keys prior to sending jobs that access these keys.
-     * <p>
-     * This method works as following:
-     * <ul>
-     * <li>For local caches it returns only local node mapped to all keys.</li>
-     * <li>
-     *      For fully replicated caches, {@link AffinityFunction} is
-     *      used to determine which keys are mapped to which groups of nodes.
-     * </li>
-     * <li>For partitioned caches, the returned map represents node-to-key affinity.</li>
-     * </ul>
-     *
-     * @param cacheName Cache name, if {@code null}, then default cache instance is used.
-     * @param keys Cache keys to map to nodes.
-     * @return Map of nodes to cache keys or empty map if there are no alive nodes for this cache.
-     * @throws IgniteException If failed to map cache keys.
-     * @deprecated Use {@link Affinity#mapKeysToNodes(Collection)} instead.
-     */
-    @Deprecated
-    public <K> Map<ClusterNode, Collection<K>> mapKeysToNodes(@Nullable String cacheName,
-        @Nullable Collection<? extends K> keys) throws IgniteException;
-
-    /**
-     * This method provides ability to detect which cache keys are mapped to which nodes
-     * on cache instance with given name. Use it to determine which nodes are storing which
-     * keys prior to sending jobs that access these keys.
-     * <p>
-     * This method works as following:
-     * <ul>
-     * <li>For local caches it returns only local node ID.</li>
-     * <li>
-     *      For fully replicated caches first node ID returned by {@link AffinityFunction}
-     *      is returned.
-     * </li>
-     * <li>For partitioned caches, the returned node ID is the primary node for the key.</li>
-     * </ul>
-     *
-     * @param cacheName Cache name, if {@code null}, then default cache instance is used.
-     * @param key Cache key to map to a node.
-     * @return Primary node for the key or {@code null} if cache with given name
-     *      is not present in the grid.
-     * @throws IgniteException If failed to map key.
-     * @deprecated Use {@link Affinity#mapKeyToNode(Object)} instead.
-     */
-    @Deprecated
-    public <K> ClusterNode mapKeyToNode(@Nullable String cacheName, K key) throws IgniteException;
-
-    /**
      * Starts one or more nodes on remote host(s).
      * <p>
      * This method takes INI file which defines all startup parameters. It can contain one or

http://git-wip-us.apache.org/repos/asf/ignite/blob/0f9eefb4/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterAsyncImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterAsyncImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterAsyncImpl.java
index d392813..c7554cb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterAsyncImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterAsyncImpl.java
@@ -98,17 +98,6 @@ public class IgniteClusterAsyncImpl extends AsyncSupportAdapter<IgniteCluster>
     }
 
     /** {@inheritDoc} */
-    @Override public <K> Map<ClusterNode, Collection<K>> mapKeysToNodes(@Nullable String cacheName,
-        @Nullable Collection<? extends K> keys) {
-        return cluster.mapKeysToNodes(cacheName, keys);
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public <K> ClusterNode mapKeyToNode(@Nullable String cacheName, K key) {
-        return cluster.mapKeyToNode(cacheName, key);
-    }
-
-    /** {@inheritDoc} */
     @Override public Collection<ClusterStartNodeResult> startNodes(File file,
         boolean restart,
         int timeout,

http://git-wip-us.apache.org/repos/asf/ignite/blob/0f9eefb4/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
index e429547..ba4aac3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
@@ -178,44 +178,6 @@ public class IgniteClusterImpl extends ClusterGroupAdapter implements IgniteClus
     }
 
     /** {@inheritDoc} */
-    @Override public <K> Map<ClusterNode, Collection<K>> mapKeysToNodes(@Nullable String cacheName,
-        @Nullable Collection<? extends K> keys)
-        throws IgniteException
-    {
-        if (F.isEmpty(keys))
-            return Collections.emptyMap();
-
-        guard();
-
-        try {
-            return ctx.affinity().mapKeysToNodes(cacheName, keys);
-        }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
-        finally {
-            unguard();
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public <K> ClusterNode mapKeyToNode(@Nullable String cacheName, K key) throws IgniteException {
-        A.notNull(key, "key");
-
-        guard();
-
-        try {
-            return ctx.affinity().mapKeyToNode(cacheName, key);
-        }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
-        finally {
-            unguard();
-        }
-    }
-
-    /** {@inheritDoc} */
     @Override public Collection<ClusterStartNodeResult> startNodes(File file,
         boolean restart,
         int timeout,

http://git-wip-us.apache.org/repos/asf/ignite/blob/0f9eefb4/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
index 0e0d0f7..933165b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
@@ -268,7 +268,7 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
             for (int i = 0; i < 1000; i++) {
                 key = "1" + i;
 
-                if (g1.cluster().mapKeyToNode(null, key).id().equals(g2.cluster().localNode().id()) &&
+                if (g1.affinity(null).mapKeyToNode(key).id().equals(g2.cluster().localNode().id()) &&
                     g1.affinity(null).isBackup((backupLeavesGrid ? g0 : g1).cluster().localNode(), key))
                     break;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/0f9eefb4/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
index a0d10c4..969d02b 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
@@ -104,17 +104,6 @@ public class IgniteClusterProcessProxy implements IgniteClusterEx {
     }
 
     /** {@inheritDoc} */
-    @Override public <K> Map<ClusterNode, Collection<K>> mapKeysToNodes(@Nullable String cacheName,
-        @Nullable Collection<? extends K> keys) throws IgniteException {
-        throw new UnsupportedOperationException("Operation is not supported yet.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public <K> ClusterNode mapKeyToNode(@Nullable String cacheName, K key) throws IgniteException {
-        throw new UnsupportedOperationException("Operation is not supported yet.");
-    }
-
-    /** {@inheritDoc} */
     @Override public Collection<ClusterStartNodeResult> startNodes(File file, boolean restart, int timeout,
         int maxConn) throws IgniteException {
         throw new UnsupportedOperationException("Operation is not supported yet.");