Repository: ignite Updated Branches: refs/heads/ignite-1758 9b0cb9ddb -> 7f150cc7f
ignite-1758 debug Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7f150cc7 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7f150cc7 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7f150cc7 Branch: refs/heads/ignite-1758 Commit: 7f150cc7fc324c78c66137305070bfa605c3b3a7 Parents: 9b0cb9d Author: sboikov <sboi...@gridgain.com> Authored: Thu Nov 5 10:26:42 2015 +0300 Committer: sboikov <sboi...@gridgain.com> Committed: Thu Nov 5 10:26:42 2015 +0300 ---------------------------------------------------------------------- .../ignite/spi/discovery/tcp/ServerImpl.java | 30 ++++++++++---------- .../spi/discovery/tcp/TcpDiscoveryImpl.java | 7 ++++- 2 files changed, 21 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/7f150cc7/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 6f22d5b..49d14d5 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 @@ -1102,7 +1102,7 @@ class ServerImpl extends TcpDiscoveryImpl { spi.stats.onMessageSent(msg, U.currentTimeMillis() - tstamp); if (debugMode) - debugLog("Message has been sent directly to address [msg=" + msg + ", addr=" + addr + + debugLog(msg, "Message has been sent directly to address [msg=" + msg + ", addr=" + addr + ", rmtNodeId=" + res.creatorNodeId() + ']'); if (log.isDebugEnabled()) @@ -2130,7 +2130,7 @@ class ServerImpl extends TcpDiscoveryImpl { log.debug("Processing message [cls=" + msg.getClass().getSimpleName() + ", id=" + msg.id() + ']'); if (debugMode) - debugLog("Processing message [cls=" + msg.getClass().getSimpleName() + ", id=" + msg.id() + ']'); + debugLog(msg, "Processing message [cls=" + msg.getClass().getSimpleName() + ", id=" + msg.id() + ']'); spi.stats.onMessageProcessingStarted(msg); @@ -2290,7 +2290,7 @@ class ServerImpl extends TcpDiscoveryImpl { log.debug("No next node in topology."); if (debugMode) - debugLog("No next node in topology."); + debugLog(null, "No next node in topology."); if (ring.hasRemoteNodes() && !(msg instanceof TcpDiscoveryConnectionCheckMessage) && !(msg instanceof TcpDiscoveryStatusCheckMessage && msg.creatorNodeId().equals(locNodeId))) { @@ -2308,7 +2308,7 @@ class ServerImpl extends TcpDiscoveryImpl { ", ring=" + ring + ", failedNodes=" + failedNodes + ']'); if (debugMode) - debugLog("New next node [newNext=" + newNext + ", formerNext=" + next + + debugLog(null, "New next node [newNext=" + newNext + ", formerNext=" + next + ", ring=" + ring + ", failedNodes=" + failedNodes + ']'); U.closeQuiet(sock); @@ -2394,7 +2394,7 @@ class ServerImpl extends TcpDiscoveryImpl { "expected [expectedId=" + next.id() + ", rcvdId=" + nextId + ']'); if (debugMode) - debugLog("Failed to restore ring because next node ID received is not as " + + debugLog(null, "Failed to restore ring because next node ID received is not as " + "expected [expectedId=" + next.id() + ", rcvdId=" + nextId + ']'); break; @@ -2416,7 +2416,7 @@ class ServerImpl extends TcpDiscoveryImpl { ", rcvd=" + nextOrder + ", id=" + next.id() + ']'); if (debugMode) - debugLog("Failed to restore ring because next node order received " + + debugLog(null, "Failed to restore ring because next node order received " + "is not as expected [expected=" + next.internalOrder() + ", rcvd=" + nextOrder + ", id=" + next.id() + ']'); @@ -2428,7 +2428,7 @@ class ServerImpl extends TcpDiscoveryImpl { log.debug("Initialized connection with next node: " + next.id()); if (debugMode) - debugLog("Initialized connection with next node: " + next.id()); + debugLog(null, "Initialized connection with next node: " + next.id()); errs = null; @@ -2498,7 +2498,7 @@ class ServerImpl extends TcpDiscoveryImpl { ", forceSndPending=" + forceSndPending + ']'); if (debugMode) - debugLog("Pending messages will be sent [failure=" + failure + + debugLog(null, "Pending messages will be sent [failure=" + failure + ", forceSndPending=" + forceSndPending + ']'); for (TcpDiscoveryAbstractMessage pendingMsg : pendingMsgs) { @@ -2528,7 +2528,7 @@ class ServerImpl extends TcpDiscoveryImpl { ", res=" + res + ']'); if (debugMode) - debugLog("Pending message has been sent to next node [msgId=" + msg.id() + + debugLog(null, "Pending message has been sent to next node [msgId=" + msg.id() + ", pendingMsgId=" + pendingMsg.id() + ", next=" + next.id() + ", res=" + res + ']'); @@ -2569,7 +2569,7 @@ class ServerImpl extends TcpDiscoveryImpl { ", res=" + res + ']'); if (debugMode) - debugLog("Message has been sent to next node [msg=" + msg + + debugLog(msg, "Message has been sent to next node [msg=" + msg + ", next=" + next.id() + ", res=" + res + ']'); } @@ -2697,7 +2697,7 @@ class ServerImpl extends TcpDiscoveryImpl { ", pendingMsgId=" + pendingMsg + ", next=" + (next != null ? next.id() : null) + ']'); if (debugMode) - debugLog("Pending message has been sent to local node [msg=" + msg.id() + + debugLog(null, "Pending message has been sent to local node [msg=" + msg.id() + ", pendingMsgId=" + pendingMsg + ", next=" + (next != null ? next.id() : null) + ']'); } } @@ -3338,7 +3338,7 @@ class ServerImpl extends TcpDiscoveryImpl { + locNode + ", msg=" + msg + ']'); if (debugMode) - debugLog("Local node already has node being added. Passing TcpDiscoveryNodeAddedMessage to " + + debugLog(msg, "Local node already has node being added. Passing TcpDiscoveryNodeAddedMessage to " + "coordinator for final processing [ring=" + ring + ", node=" + node + ", locNode=" + locNode + ", msg=" + msg + ']'); @@ -3353,7 +3353,7 @@ class ServerImpl extends TcpDiscoveryImpl { ", msg=" + msg + ']'); if (debugMode) - debugLog("Discarding node added message since new node's order is less than " + + debugLog(msg, "Discarding node added message since new node's order is less than " + "max order in ring [ring=" + ring + ", node=" + node + ", locNode=" + locNode + ", msg=" + msg + ']'); @@ -4877,7 +4877,7 @@ class ServerImpl extends TcpDiscoveryImpl { ", client=" + req.client() + ']'); if (debugMode) - debugLog("Initialized connection with remote node [nodeId=" + nodeId + + debugLog(null, "Initialized connection with remote node [nodeId=" + nodeId + ", client=" + req.client() + ']'); } catch (IOException e) { @@ -4947,7 +4947,7 @@ class ServerImpl extends TcpDiscoveryImpl { spi.stats.onMessageReceived(msg); if (debugMode && recordable(msg)) - debugLog("Message has been received: " + msg); + debugLog(msg, "Message has been received: " + msg); if (msg instanceof TcpDiscoveryConnectionCheckMessage) { spi.writeToSocket(msg, sock, RES_OK, socketTimeout); http://git-wip-us.apache.org/repos/asf/ignite/blob/7f150cc7/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 8615fa8..2a1ee46 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 @@ -37,6 +37,8 @@ import org.apache.ignite.spi.IgniteSpiException; import org.apache.ignite.spi.IgniteSpiThread; import org.apache.ignite.spi.discovery.DiscoverySpiCustomMessage; import org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode; +import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryAbstractMessage; +import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryCustomEventMessage; import org.jetbrains.annotations.Nullable; /** @@ -101,9 +103,12 @@ abstract class TcpDiscoveryImpl { /** * @param msg Message. */ - protected void debugLog(String msg) { + protected void debugLog(TcpDiscoveryAbstractMessage discoMsg, String msg) { assert debugMode; + if (discoMsg != null && discoMsg instanceof TcpDiscoveryCustomEventMessage) + return; + String msg0 = new SimpleDateFormat("[HH:mm:ss,SSS]").format(new Date(System.currentTimeMillis())) + '[' + Thread.currentThread().getName() + "][" + getLocalNodeId() + "-" + locNode.internalOrder() + "] " +