ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [17/50] [abbrv] ignite git commit: Revert: pushing unnecessary changes to the master
Date Mon, 24 Apr 2017 15:03:40 GMT
Revert: pushing unnecessary changes to the master


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

Branch: refs/heads/ignite-3054
Commit: ed794ca815f6bb1471af15779279d287576b39cc
Parents: 6e1f2df
Author: Alexandr Kuramshin <akuramshin@gridgain.com>
Authored: Mon Nov 21 12:08:00 2016 +0300
Committer: Alexandr Kuramshin <akuramshin@gridgain.com>
Committed: Mon Nov 21 12:08:00 2016 +0300

----------------------------------------------------------------------
 .../IgniteTcpCommunicationBigClusterTest.java   | 185 -------------------
 1 file changed, 185 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ed794ca8/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/IgniteTcpCommunicationBigClusterTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/IgniteTcpCommunicationBigClusterTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/IgniteTcpCommunicationBigClusterTest.java
deleted file mode 100755
index a97c858..0000000
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/IgniteTcpCommunicationBigClusterTest.java
+++ /dev/null
@@ -1,185 +0,0 @@
-package org.apache.ignite.spi.communication.tcp;
-
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteInterruptedException;
-import org.apache.ignite.Ignition;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder;
-import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryAbstractMessage;
-import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeAddFinishedMessage;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-import java.text.MessageFormat;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Testing {@link TcpCommunicationSpi} under big cluster conditions (long DiscoverySpi delivery)
- *
- * @author Alexandr Kuramshin <ein.nsk.ru@gmail.com>
- */
-public class IgniteTcpCommunicationBigClusterTest extends GridCommonAbstractTest {
-
-    /** */
-    private static final int IGNITE_NODES_NUMBER = 10;
-
-    /** */
-    private static final long RUNNING_TIMESPAN = 1_000L;
-
-    /** */
-    private static final long COMMUNICATION_TIMEOUT = 1_000L;
-
-    /** Should be about of the COMMUNICATION_TIMEOUT value to get the error */
-    private static final long ADDED_MESSAGE_DELAY = COMMUNICATION_TIMEOUT;
-
-    /** */
-    private static final long BROADCAST_PERIOD = 100L;
-
-    /** */
-    private static final String CONTROL_ANSWER = "ignite";
-
-    /** */
-    private static final Logger LOGGER = Logger.getLogger(IgniteTcpCommunicationBigClusterTest.class.getName());
-
-    /** */
-    private static final Level LOG_LEVEL = Level.SEVERE;
-
-    /** */
-    private CountDownLatch startLatch;
-
-    /** */
-    private static IgniteConfiguration config(String gridName) {
-        IgniteConfiguration cfg = new IgniteConfiguration();
-        cfg.setGridName(gridName);
-        cfg.setPeerClassLoadingEnabled(false);
-
-        TcpDiscoverySpi discovery = new SlowTcpDiscoverySpi();
-        TcpDiscoveryMulticastIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder();
-        ipFinder.setAddresses(Arrays.asList("127.0.0.1:47500..47510"));
-        discovery.setIpFinder(ipFinder);
-        cfg.setDiscoverySpi(discovery);
-
-        TcpCommunicationSpi communication = new TcpCommunicationSpi();
-        communication.setConnectTimeout(COMMUNICATION_TIMEOUT);
-        communication.setMaxConnectTimeout(COMMUNICATION_TIMEOUT);
-        communication.setReconnectCount(1);
-        cfg.setCommunicationSpi(communication);
-
-        return cfg;
-    }
-
-    /** */
-    private static void println(String str) {
-        LOGGER.log(LOG_LEVEL, str);
-        logFirstMessageCount();
-    }
-
-    /** */
-    private static void println(String str, Throwable ex) {
-        LOGGER.log(LOG_LEVEL, str, ex);
-        logFirstMessageCount();
-    }
-
-    /** */
-    private static void printf(String format, Object... args) {
-        LOGGER.log(LOG_LEVEL, MessageFormat.format(format, args));
-        logFirstMessageCount();
-    }
-
-    /** */
-    private static void printf(String format, Throwable ex, Object... args) {
-        LOGGER.log(LOG_LEVEL, MessageFormat.format(format, args), ex);
-        logFirstMessageCount();
-    }
-
-    /** */
-    private static void logFirstMessageCount() {
-        LOGGER.log(LOG_LEVEL, MessageFormat.format("onFirstMessage: started = {0}, active
= {1}",
-            TcpCommunicationSpi.FIRST_MESSAGE_STARTED_COUNT.get(),
-            TcpCommunicationSpi.FIRST_MESSAGE_ACTIVE_COUNT.get()));
-    }
-
-    /** */
-    public synchronized void testBigCluster() throws Exception {
-        startLatch = new CountDownLatch(IGNITE_NODES_NUMBER);
-        final ExecutorService execSvc = Executors.newCachedThreadPool();
-        for (int i = 0; i < IGNITE_NODES_NUMBER; ++i) {
-            final String name = "testBigClusterNode-" + i;
-            execSvc.submit(() -> {
-                startNode(name);
-            });
-        }
-        startLatch.await();
-        println("All nodes running");
-        Thread.sleep(RUNNING_TIMESPAN);
-        println("Stopping all nodes");
-        execSvc.shutdownNow();
-        execSvc.awaitTermination(1, TimeUnit.MINUTES);
-        println("Stopped all nodes");
-    }
-
-    /** */
-    private void startNode(String name) {
-        printf("Starting node = {0}", name);
-        try (final Ignite ignite = Ignition.start(config(name))) {
-            printf("Started node = {0}", name);
-            startLatch.countDown();
-            nodeWork(ignite);
-            printf("Stopping node = {0}", name);
-        }
-        printf("Stopped node = {0}", name);
-    }
-
-    /** */
-    private void nodeWork(final Ignite ignite) {
-        try {
-            int count = 0;
-            for (; ; ) {
-                Thread.sleep(BROADCAST_PERIOD);
-                Collection<String> results = ignite.compute().broadcast(() -> {
-                    return CONTROL_ANSWER;
-                });
-                for (String result : results)
-                    if (!CONTROL_ANSWER.equals(result))
-                        throw new IllegalArgumentException("Wrong answer from node: " + result);
-                if (count != results.size())
-                    printf("Computed results: node = {0}, count = {1}", ignite.name(), count
= results.size());
-            }
-        }
-        catch (InterruptedException | IgniteInterruptedException ex) {
-            printf("Node thread interrupted: node = {0}", ignite.name());
-        }
-        catch (Throwable ex) {
-            printf("Node thread exit on error: node = {0}", ex, ignite.name());
-        }
-    }
-
-    /** */
-    private static class SlowTcpDiscoverySpi extends TcpDiscoverySpi {
-
-        /** */
-        @Override protected boolean ensured(TcpDiscoveryAbstractMessage msg) {
-            if (ADDED_MESSAGE_DELAY > 0 && msg instanceof TcpDiscoveryNodeAddFinishedMessage)
-                try {
-                    Thread.sleep(ADDED_MESSAGE_DELAY);
-                }
-                catch (InterruptedException | IgniteInterruptedException ex) {
-                    println("Long delivery of TcpDiscoveryNodeAddFinishedMessage interrupted");
-                    throw ex instanceof IgniteInterruptedException ? (IgniteInterruptedException)ex
-                        : new IgniteInterruptedException((InterruptedException)ex);
-                }
-                catch (Throwable ex) {
-                    println("Long delivery of TcpDiscoveryNodeAddFinishedMessage error",
ex);
-                    throw ex instanceof RuntimeException ? (RuntimeException)ex : new RuntimeException(ex);
-                }
-            return super.ensured(msg);
-        }
-    }
-}


Mime
View raw message