#ignite-237: remove tests for consistent hash.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5692d7e3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5692d7e3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5692d7e3 Branch: refs/heads/sprint-2 Commit: 5692d7e39a4600b17dd9fafb2003a96a2fb51489 Parents: e378264 Author: ivasilinets <ivasilin...@gridgain.com> Authored: Fri Feb 27 19:44:08 2015 +0300 Committer: ivasilinets <ivasilin...@gridgain.com> Committed: Fri Feb 27 19:44:08 2015 +0300 ---------------------------------------------------------------------- .../GridCachePartitionedAffinitySelfTest.java | 181 ------------------- 1 file changed, 181 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5692d7e3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinitySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinitySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinitySelfTest.java index 1559a24..069ffb6 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinitySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinitySelfTest.java @@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.distributed.near; import org.apache.ignite.*; import org.apache.ignite.cache.*; import org.apache.ignite.cache.affinity.*; -import org.apache.ignite.cache.affinity.rendezvous.*; import org.apache.ignite.cluster.*; import org.apache.ignite.configuration.*; import org.apache.ignite.events.*; @@ -110,186 +109,6 @@ public class GridCachePartitionedAffinitySelfTest extends GridCommonAbstractTest return aff.mapKeyToPrimaryAndBackups(key); } - /** Test predefined affinity - must be ported to all clients. */ - @SuppressWarnings("UnaryPlus") - public void testPredefined() throws IgniteCheckedException { - CacheRendezvousAffinityFunction aff = new CacheRendezvousAffinityFunction(); - - getTestResources().inject(aff); - - aff.setHashIdResolver(new CacheAffinityNodeIdHashResolver()); - - List<ClusterNode> nodes = new ArrayList<>(); - - nodes.add(createNode("000ea4cd-f449-4dcb-869a-5317c63bd619", 50)); - nodes.add(createNode("010ea4cd-f449-4dcb-869a-5317c63bd62a", 60)); - nodes.add(createNode("0209ec54-ff53-4fdb-8239-5a3ac1fb31bd", 70)); - nodes.add(createNode("0309ec54-ff53-4fdb-8239-5a3ac1fb31ef", 80)); - nodes.add(createNode("040c9b94-02ae-45a6-9d5c-a066dbdf2636", 90)); - nodes.add(createNode("050c9b94-02ae-45a6-9d5c-a066dbdf2747", 100)); - nodes.add(createNode("0601f916-4357-4cfe-a7df-49d4721690bf", 110)); - nodes.add(createNode("0702f916-4357-4cfe-a7df-49d4721691c0", 120)); - - Map<Object, Integer> data = new LinkedHashMap<>(); - - data.put("", 4); - data.put("asdf", 4); - data.put("224ea4cd-f449-4dcb-869a-5317c63bd619", 5); - data.put("fdc9ec54-ff53-4fdb-8239-5a3ac1fb31bd", 2); - data.put("0f9c9b94-02ae-45a6-9d5c-a066dbdf2636", 2); - data.put("d8f1f916-4357-4cfe-a7df-49d4721690bf", 7); - data.put("c77ffeae-78a1-4ee6-a0fd-8d197a794412", 3); - data.put("35de9f21-3c9b-4f4a-a7d5-3e2c6cb01564", 1); - data.put("d67eb652-4e76-47fb-ad4e-cd902d9b868a", 7); - - data.put(0, 4); - data.put(1, 7); - data.put(12, 5); - data.put(123, 6); - data.put(1234, 4); - data.put(12345, 6); - data.put(123456, 6); - data.put(1234567, 6); - data.put(12345678, 0); - data.put(123456789, 7); - data.put(1234567890, 7); - data.put(1234567890L, 7); - data.put(12345678901L, 2); - data.put(123456789012L, 1); - data.put(1234567890123L, 0); - data.put(12345678901234L, 1); - data.put(123456789012345L, 6); - data.put(1234567890123456L, 7); - data.put(-23456789012345L, 4); - data.put(-2345678901234L, 1); - data.put(-234567890123L, 5); - data.put(-23456789012L, 5); - data.put(-2345678901L, 7); - data.put(-234567890L, 4); - data.put(-234567890, 7); - data.put(-23456789, 7); - data.put(-2345678, 0); - data.put(-234567, 6); - data.put(-23456, 6); - data.put(-2345, 6); - data.put(-234, 7); - data.put(-23, 5); - data.put(-2, 4); - - data.put(0x80000000, 4); - data.put(0x7fffffff, 7); - data.put(0x8000000000000000L, 4); - data.put(0x7fffffffffffffffL, 4); - - data.put(+1.1, 3); - data.put(-10.01, 4); - data.put(+100.001, 4); - data.put(-1000.0001, 4); - data.put(+1.7976931348623157E+308, 6); - data.put(-1.7976931348623157E+308, 6); - data.put(+4.9E-324, 7); - data.put(-4.9E-324, 7); - } - - /** Test predefined affinity - must be ported to other clients. */ - @SuppressWarnings("UnaryPlus") - public void testPredefinedHashIdResolver() throws IgniteCheckedException { - // Use Md5 hasher for this test. - CacheRendezvousAffinityFunction aff = new CacheRendezvousAffinityFunction(); - - getTestResources().inject(aff); - - aff.setHashIdResolver(new CacheAffinityNodeHashResolver() { - @Override public Object resolve(ClusterNode node) { - return null; - } - }); - - List<ClusterNode> nodes = new ArrayList<>(); - - nodes.add(createNode("000ea4cd-f449-4dcb-869a-5317c63bd619", 50)); - nodes.add(createNode("010ea4cd-f449-4dcb-869a-5317c63bd62a", 60)); - nodes.add(createNode("0209ec54-ff53-4fdb-8239-5a3ac1fb31bd", 70)); - nodes.add(createNode("0309ec54-ff53-4fdb-8239-5a3ac1fb31ef", 80)); - nodes.add(createNode("040c9b94-02ae-45a6-9d5c-a066dbdf2636", 90)); - nodes.add(createNode("050c9b94-02ae-45a6-9d5c-a066dbdf2747", 100)); - nodes.add(createNode("0601f916-4357-4cfe-a7df-49d4721690bf", 110)); - nodes.add(createNode("0702f916-4357-4cfe-a7df-49d4721691c0", 120)); - - Map<Object, Integer> data = new LinkedHashMap<>(); - - data.put("", 4); - data.put("asdf", 3); - data.put("224ea4cd-f449-4dcb-869a-5317c63bd619", 5); - data.put("fdc9ec54-ff53-4fdb-8239-5a3ac1fb31bd", 2); - data.put("0f9c9b94-02ae-45a6-9d5c-a066dbdf2636", 2); - data.put("d8f1f916-4357-4cfe-a7df-49d4721690bf", 4); - data.put("c77ffeae-78a1-4ee6-a0fd-8d197a794412", 3); - data.put("35de9f21-3c9b-4f4a-a7d5-3e2c6cb01564", 4); - data.put("d67eb652-4e76-47fb-ad4e-cd902d9b868a", 2); - - data.put(0, 4); - data.put(1, 1); - data.put(12, 7); - data.put(123, 1); - data.put(1234, 6); - data.put(12345, 2); - data.put(123456, 5); - data.put(1234567, 4); - data.put(12345678, 6); - data.put(123456789, 3); - data.put(1234567890, 3); - data.put(1234567890L, 3); - data.put(12345678901L, 0); - data.put(123456789012L, 1); - data.put(1234567890123L, 3); - data.put(12345678901234L, 5); - data.put(123456789012345L, 5); - data.put(1234567890123456L, 7); - data.put(-23456789012345L, 6); - data.put(-2345678901234L, 4); - data.put(-234567890123L, 3); - data.put(-23456789012L, 0); - data.put(-2345678901L, 4); - data.put(-234567890L, 5); - data.put(-234567890, 3); - data.put(-23456789, 3); - data.put(-2345678, 6); - data.put(-234567, 4); - data.put(-23456, 5); - data.put(-2345, 2); - data.put(-234, 7); - data.put(-23, 6); - data.put(-2, 6); - - data.put(0x80000000, 7); - data.put(0x7fffffff, 1); - data.put(0x8000000000000000L, 7); - data.put(0x7fffffffffffffffL, 7); - - data.put(+1.1, 2); - data.put(-10.01, 0); - data.put(+100.001, 2); - data.put(-1000.0001, 0); - data.put(+1.7976931348623157E+308, 6); - data.put(-1.7976931348623157E+308, 1); - data.put(+4.9E-324, 1); - data.put(-4.9E-324, 1); - } - - /** - * Create node with specified node id and replica count. - * - * @param nodeId Node id. - * @param replicaCnt Node partitioned affinity replica count. - * @return New node with specified node id and replica count. - */ - private ClusterNode createNode(String nodeId, int replicaCnt) { - GridTestNode node = new GridTestNode(UUID.fromString(nodeId)); - - return node; - } - /** @throws Exception If failed. */ public void testAffinity() throws Exception { waitTopologyUpdate();