Repository: incubator-ignite Updated Branches: refs/heads/ignite-45 8eb79a74d -> 21e1f16ea
#ignite-45: merge ignite-45-client-tests Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/21e1f16e Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/21e1f16e Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/21e1f16e Branch: refs/heads/ignite-45 Commit: 21e1f16ea372a7c4356a73857b5fb7329a9ef8ce Parents: 8eb79a7 Author: ivasilinets <ivasilin...@gridgain.com> Authored: Thu Mar 19 18:24:31 2015 +0300 Committer: ivasilinets <ivasilin...@gridgain.com> Committed: Thu Mar 19 18:24:31 2015 +0300 ---------------------------------------------------------------------- .../loadtests/client/ClientTcpSslLoadTest.java | 110 ------------------- 1 file changed, 110 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/21e1f16e/modules/clients/src/test/java/org/apache/ignite/loadtests/client/ClientTcpSslLoadTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/loadtests/client/ClientTcpSslLoadTest.java b/modules/clients/src/test/java/org/apache/ignite/loadtests/client/ClientTcpSslLoadTest.java index 17e0a8d..63fd232 100644 --- a/modules/clients/src/test/java/org/apache/ignite/loadtests/client/ClientTcpSslLoadTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/loadtests/client/ClientTcpSslLoadTest.java @@ -18,18 +18,9 @@ package org.apache.ignite.loadtests.client; import org.apache.ignite.*; -import org.apache.ignite.cache.*; -import org.apache.ignite.cluster.*; -import org.apache.ignite.internal.*; import org.apache.ignite.internal.client.*; -import org.apache.ignite.internal.client.impl.*; -import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.internal.util.typedef.internal.*; -import java.util.*; -import java.util.concurrent.*; -import java.util.concurrent.atomic.*; - /** * Makes a long run to ensure stability and absence of memory leaks. */ @@ -43,9 +34,6 @@ public class ClientTcpSslLoadTest extends ClientTcpSslMultiThreadedSelfTest { /** Time to let connections closed by idle. */ private static final long RELAX_INTERVAL = 60 * 1000; - /** Thread count to run tests. */ - private static final int THREAD_CNT = 20; - /** * @throws Exception If failed. */ @@ -59,8 +47,6 @@ public class ClientTcpSslLoadTest extends ClientTcpSslMultiThreadedSelfTest { testMultithreadedTaskRun(); - testMultithreadedCachePut(); - long now = System.currentTimeMillis(); if (now - lastPrint > STATISTICS_PRINT_INTERVAL) { @@ -97,100 +83,4 @@ public class ClientTcpSslLoadTest extends ClientTcpSslMultiThreadedSelfTest { log.error("Cache clear failed.", e); } } - - /** - * @throws Exception If failed. - */ - public void test6Affinity() throws Exception { - GridClientData cache = client.data(PARTITIONED_CACHE_NAME); - UUID nodeId = cache.affinity("6"); - - info("Affinity node: " + nodeId); - } - - /** - * @throws Exception If failed. - */ - public void testMultithreadedCachePut() throws Exception { - final AtomicLong keyCnt = new AtomicLong(); - - final AtomicReference<Exception> err = new AtomicReference<>(); - - final ConcurrentMap<String, T2<UUID, String>> puts = new ConcurrentHashMap<>(); - - final Map<UUID, Ignite> gridMap = new HashMap<>(); - - for (int i = 0; i < NODES_CNT; i++) { - Ignite g = grid(i); - - gridMap.put(g.cluster().localNode().id(), g); - } - - final Ignite ignite = F.first(gridMap.values()); - - assertEquals(NODES_CNT, client.compute().refreshTopology(false, false).size()); - - IgniteInternalFuture<?> fut = multithreadedAsync(new Runnable() { - @SuppressWarnings("OverlyStrongTypeCast") - @Override public void run() { - try { - GridClientData cache = client.data(PARTITIONED_CACHE_NAME); - - assertEquals(NODES_CNT, ((GridClientDataImpl)cache).projectionNodes().size()); - - long rawKey; - - while ((rawKey = keyCnt.getAndIncrement()) < cachePutCount()) { - String key = String.valueOf(rawKey); - - UUID nodeId = cache.affinity(key); - - String val = "val" + rawKey; - - if (cache.put(key, val)) { - T2<UUID, String> old = puts.putIfAbsent(key, new T2<>(nodeId, val)); - - assert old == null : "Map contained entry [key=" + rawKey + ", entry=" + old + ']'; - } - } - } - catch (Exception e) { - err.compareAndSet(null, e); - } - } - }, THREAD_CNT, "client-cache-put"); - - fut.get(); - - if (err.get() != null) - throw new Exception(err.get()); - - assertEquals(cachePutCount(), puts.size()); - - // Now check that all puts went to primary nodes. - for (long i = 0; i < cachePutCount(); i++) { - String key = String.valueOf(i); - - ClusterNode node = ignite.cluster().mapKeyToNode(PARTITIONED_CACHE_NAME, key); - - if (!puts.get(key).get2().equals(gridMap.get(node.id()).jcache(PARTITIONED_CACHE_NAME).localPeek(key, CachePeekMode.ONHEAP))) { - // printAffinityState(gridMap.values()); - - failNotEquals("Node don't have value for key [nodeId=" + node.id() + ", key=" + key + "]", - puts.get(key).get2(), gridMap.get(node.id()).jcache(PARTITIONED_CACHE_NAME).localPeek(key, CachePeekMode.ONHEAP)); - } - - - UUID curAffNode = client.data(PARTITIONED_CACHE_NAME).affinity(key); - - // Check that no other nodes see this key. - for (UUID id : gridMap.keySet()) { - if (!id.equals(curAffNode) && !id.equals(node.id())) - assertNull("Got value in near cache.", gridMap.get(id).jcache(PARTITIONED_CACHE_NAME).localPeek(key, CachePeekMode.ONHEAP)); - } - } - - for (Ignite g : gridMap.values()) - g.jcache(PARTITIONED_CACHE_NAME).clear(); - } }