ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [04/21] incubator-ignite git commit: ignite-890: fixes
Date Thu, 16 Jul 2015 14:09:19 GMT
ignite-890: fixes


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

Branch: refs/heads/ignite-1124
Commit: 226b44ff2034a6a55022bc7d8c5819d2c193b948
Parents: 97ab409
Author: Denis Magda <dmagda@gridgain.com>
Authored: Thu Jul 9 17:10:18 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Thu Jul 9 17:10:18 2015 +0300

----------------------------------------------------------------------
 .../ignite/spi/discovery/tcp/ClientImpl.java    | 14 +++---
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 47 ++++----------------
 .../spi/discovery/tcp/TcpDiscoveryImpl.java     | 22 ++++-----
 .../tcp/TcpDiscoveryMultiThreadedTest.java      |  2 +-
 4 files changed, 27 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/226b44ff/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
index 68017a2..d138a6a 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
@@ -595,11 +595,11 @@ class ClientImpl extends TcpDiscoveryImpl {
         NavigableSet<ClusterNode> allNodes = allVisibleNodes();
 
         if (!topHist.containsKey(topVer)) {
-//            assert topHist.isEmpty() || topHist.lastKey() == topVer - 1 :
-//                "lastVer=" + (topHist.isEmpty() ? null : topHist.lastKey()) +
-//                ", newVer=" + topVer +
-//                ", locNode=" + locNode +
-//                ", msg=" + msg;
+            assert topHist.isEmpty() || topHist.lastKey() == topVer - 1 :
+                "lastVer=" + (topHist.isEmpty() ? null : topHist.lastKey()) +
+                ", newVer=" + topVer +
+                ", locNode=" + locNode +
+                ", msg=" + msg;
 
             topHist.put(topVer, allNodes);
 
@@ -782,8 +782,8 @@ class ClientImpl extends TcpDiscoveryImpl {
 
                         msg.senderNodeId(rmtNodeId);
 
-//                        if (log.isDebugEnabled())
-                            log.info("Message has been received: " + msg);
+                        if (log.isDebugEnabled())
+                            log.debug("Message has been received: " + msg);
 
                         spi.stats.onMessageReceived(msg);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/226b44ff/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index e398885..4d4b2a7 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -2000,7 +2000,7 @@ class ServerImpl extends TcpDiscoveryImpl {
 
                         if (debugMode)
                             debugLog("New next node [newNext=" + newNext + ", formerNext="
+ next +
-                                ", ring=" + ring + ", failedNodes=" + failedNodes + ", coord=
" + resolveCoordinator() + ']');
+                                ", ring=" + ring + ", failedNodes=" + failedNodes + ']');
 
                         U.closeQuiet(sock);
 
@@ -2071,22 +2071,9 @@ class ServerImpl extends TcpDiscoveryImpl {
 
                                 if (!next.id().equals(nextId)) {
                                     // Node with different ID has bounded to the same port.
-                                    //if (log.isDebugEnabled())
-                                    log.info("Failed to restore ring because next node ID
received is not as " +
-                                                 "expected [expectedId=" + next.id() + ",
rcvdId=" + nextId + ", " +
-                                                 "locNode " + locNodeId + ", ring = " + ring
+ ']');
-
-//                                    if (!dumping) {
-//                                        synchronized (TcpDiscoverySpi.allSpis) {
-//                                            dumping = true;
-//                                            System.out.println("------------ Start dump
------ ");
-//                                            for (TcpDiscoverySpi spi : TcpDiscoverySpi.allSpis)
-//                                                spi.dumpDebugInfo();
-//                                        }
-//                                    System.out.println("------------- End dump -----------");
-//
-//                                        System.exit(1);
-//                                    }
+                                    if (log.isDebugEnabled())
+                                        log.debug("Failed to restore ring because next node
ID received is not as " +
+                                            "expected [expectedId=" + next.id() + ", rcvdId="
+ nextId + ']');
 
                                     if (debugMode)
                                         debugLog("Failed to restore ring because next node
ID received is not as " +
@@ -3304,11 +3291,8 @@ class ServerImpl extends TcpDiscoveryImpl {
             }
 
             if (ring.node(msg.senderNodeId()) == null) {
-//                if (log.isDebugEnabled())
-                    log.info("Discarding node left message since sender node is not in topology:
" + msg);
-
-                if (debugMode)
-                    debugLog("Discarding node left message since sender node is not in topology:
" + msg);
+                if (log.isDebugEnabled())
+                    log.debug("Discarding node left message since sender node is not in topology:
" + msg);
 
                 return;
             }
@@ -3321,11 +3305,8 @@ class ServerImpl extends TcpDiscoveryImpl {
                 }
             }
             else {
-//                if (log.isDebugEnabled())
-                    log.info("Discarding node left message since node was not found: " +
msg);
-
-                if (debugMode)
-                    debugLog("Discarding node left message since node was not found: " +
msg);
+                if (log.isDebugEnabled())
+                    log.debug("Discarding node left message since node was not found: " +
msg);
 
                 return;
             }
@@ -3334,9 +3315,6 @@ class ServerImpl extends TcpDiscoveryImpl {
 
             if (locNodeCoord) {
                 if (msg.verified()) {
-                    if (!locNode.id().equals(msg.verifierNodeId()))
-                        System.out.println("Fuck!!: [loc=" + locNode + ", verifier=" + msg.verifierNodeId());
-
                     spi.stats.onRingMessageReceived(msg);
 
                     addMessage(new TcpDiscoveryDiscardMessage(locNodeId, msg.id()));
@@ -3355,9 +3333,6 @@ class ServerImpl extends TcpDiscoveryImpl {
                 if (log.isDebugEnabled())
                     log.debug("Removed node from topology: " + leftNode);
 
-                if (debugMode)
-                    debugLog("Removed node from topology: " + leftNode);
-
                 long topVer;
 
                 if (locNodeCoord) {
@@ -3393,9 +3368,6 @@ class ServerImpl extends TcpDiscoveryImpl {
 
                         if (log.isDebugEnabled())
                             log.debug("Sent verified node left message to leaving node: "
+ msg);
-
-                        if (debugMode)
-                            debugLog("Sent verified node left message to leaving node: "
+ msg);
                     }
                     catch (IgniteCheckedException | IOException e) {
                         if (log.isDebugEnabled())
@@ -3439,9 +3411,6 @@ class ServerImpl extends TcpDiscoveryImpl {
                 if (log.isDebugEnabled())
                     log.debug("Unable to send message across the ring (topology has no remote
nodes): " + msg);
 
-                if (debugMode)
-                    debugLog("Unable to send message across the ring (topology has no remote
nodes): " + msg);
-
                 U.closeQuiet(sock);
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/226b44ff/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
index 8fedce1..ace917f 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
@@ -95,17 +95,17 @@ abstract class TcpDiscoveryImpl {
     protected void debugLog(String msg) {
         assert debugMode;
 
-//        String msg0 = new SimpleDateFormat("[HH:mm:ss,SSS]").format(new Date(System.currentTimeMillis()))
+
-//            '[' + Thread.currentThread().getName() + "][" + getLocalNodeId() +
-//            "-" + locNode.internalOrder() + "] " +
-//            msg;
-//
-//        debugLog.add(msg0);
-//
-//        int delta = debugLog.size() - debugMsgHist;
-//
-//        for (int i = 0; i < delta && debugLog.size() > debugMsgHist; i++)
-//            debugLog.poll();
+        String msg0 = new SimpleDateFormat("[HH:mm:ss,SSS]").format(new Date(System.currentTimeMillis()))
+
+            '[' + Thread.currentThread().getName() + "][" + getLocalNodeId() +
+            "-" + locNode.internalOrder() + "] " +
+            msg;
+
+        debugLog.add(msg0);
+
+        int delta = debugLog.size() - debugMsgHist;
+
+        for (int i = 0; i < delta && debugLog.size() > debugMsgHist; i++)
+            debugLog.poll();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/226b44ff/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
index 87d9304..2aca2fb 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
@@ -217,7 +217,7 @@ public class TcpDiscoveryMultiThreadedTest extends GridCommonAbstractTest
{
                     return null;
                 }
             },
-            1
+            GRID_CNT - 1
         );
 
         Thread.sleep(getTestTimeout() - 60 * 1000);


Mime
View raw message