Repository: ignite
Updated Branches:
  refs/heads/master 17e7bd731 -> 0b2f349ff


IGNITE-8724 Fixed misleading U.warn implementation - Fixes #4145.


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

Branch: refs/heads/master
Commit: 0b2f349ff47ab7353ca58f206c326a12567636f3
Parents: 17e7bd7
Author: Evgeny Stanilovskiy <estanilovs...@gridgain.com>
Authored: Fri Aug 10 16:21:25 2018 +0300
Committer: Alexey Goncharuk <alexey.goncha...@gmail.com>
Committed: Fri Aug 10 16:21:25 2018 +0300

----------------------------------------------------------------------
 .../rendezvous/RendezvousAffinityFunction.java  |  4 +-
 .../apache/ignite/internal/GridDiagnostic.java  | 22 +++----
 .../apache/ignite/internal/IgniteKernal.java    |  7 +--
 .../org/apache/ignite/internal/IgnitionEx.java  |  3 +-
 .../impl/GridTcpRouterNioListenerAdapter.java   |  3 +-
 .../checkpoint/GridCheckpointManager.java       | 11 ++--
 .../deployment/GridDeploymentManager.java       |  7 +--
 .../discovery/GridDiscoveryManager.java         |  3 +-
 .../cache/GridCacheEvictionManager.java         |  3 +-
 .../processors/cache/GridCacheProcessor.java    | 12 ++--
 .../rest/protocols/tcp/GridTcpRestProtocol.java | 10 ++--
 .../ignite/internal/util/GridLogThrottle.java   | 60 ++++++++------------
 .../ignite/internal/util/IgniteUtils.java       | 23 +++++---
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 17 ++----
 .../processors/query/h2/IgniteH2Indexing.java   |  6 +-
 .../zk/internal/ZookeeperDiscoveryImpl.java     |  9 +--
 16 files changed, 77 insertions(+), 123 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0b2f349f/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
 
b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
index 4b52f77..7b1ea59 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
@@ -389,9 +389,7 @@ public class RendezvousAffinityFunction implements 
AffinityFunction, Serializabl
 
             if (!exclNeighborsWarn) {
                 LT.warn(log, "Affinity function excludeNeighbors property is 
ignored " +
-                        "because topology has no enough nodes to assign 
backups.",
-                    "Affinity function excludeNeighbors property is ignored " +
-                        "because topology has no enough nodes to assign 
backups.");
+                    "because topology has no enough nodes to assign backups.");
 
                 exclNeighborsWarn = true;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b2f349f/modules/core/src/main/java/org/apache/ignite/internal/GridDiagnostic.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/GridDiagnostic.java 
b/modules/core/src/main/java/org/apache/ignite/internal/GridDiagnostic.java
index ced4f84..c415efc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridDiagnostic.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridDiagnostic.java
@@ -61,14 +61,12 @@ final class GridDiagnostic {
 
                         if (!locHost.isReachable(REACH_TIMEOUT)) {
                             U.warn(log, "Default local host is unreachable. 
This may lead to delays on " +
-                                "grid network operations. Check your OS 
network setting to correct it.",
-                                "Default local host is unreachable.");
+                                "grid network operations. Check your OS 
network setting to correct it.");
                         }
                     }
                     catch (IOException ignore) {
                         U.warn(log, "Failed to perform network diagnostics. It 
is usually caused by serious " +
-                            "network configuration problem. Check your OS 
network setting to correct it.",
-                            "Failed to perform network diagnostics.");
+                            "network configuration problem. Check your OS 
network setting to correct it.");
                     }
                 }
             });
@@ -80,14 +78,12 @@ final class GridDiagnostic {
 
                         if (locHost.isLoopbackAddress()) {
                             U.warn(log, "Default local host is a loopback 
address. This can be a sign of " +
-                                "potential network configuration problem.",
-                                "Default local host is a loopback address.");
+                                "potential network configuration problem.");
                         }
                     }
                     catch (IOException ignore) {
                         U.warn(log, "Failed to perform network diagnostics. It 
is usually caused by serious " +
-                            "network configuration problem. Check your OS 
network setting to correct it.",
-                            "Failed to perform network diagnostics.");
+                            "network configuration problem. Check your OS 
network setting to correct it.");
                     }
                 }
             });
@@ -98,8 +94,7 @@ final class GridDiagnostic {
                     if (!U.isSufficientlyTestedOs()) {
                         U.warn(log, "This operating system has been tested 
less rigorously: " + U.osString() +
                             ". Our team will appreciate the feedback if you 
experience any problems running " +
-                            "ignite in this environment.",
-                            "This OS is tested less rigorously: " + 
U.osString());
+                            "ignite in this environment.");
                     }
                 }
             });
@@ -109,8 +104,7 @@ final class GridDiagnostic {
                     // Fix for GG-1075.
                     if (F.isEmpty(U.allLocalMACs()))
                         U.warn(log, "No live network interfaces detected. If 
IP-multicast discovery is used - " +
-                            "make sure to add 127.0.0.1 as a local address.",
-                            "No live network interfaces. Add 127.0.0.1 as a 
local address.");
+                            "make sure to add 127.0.0.1 as a local address.");
                 }
             });
 
@@ -131,7 +125,7 @@ final class GridDiagnostic {
 
                         U.warn(log, "JMX remote management is enabled but JMX 
port is either not set or invalid. " +
                             "Check system property 
'com.sun.management.jmxremote.port' to make sure it specifies " +
-                            "valid TCP/IP port.", "JMX remote port is invalid 
- JMX management is off.");
+                            "valid TCP/IP port.");
                     }
                 }
             });
@@ -156,4 +150,4 @@ final class GridDiagnostic {
                 "Failed to start background network diagnostics.", e);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b2f349f/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java 
b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 9b8ae5a..ff0e4ee 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -1588,8 +1588,7 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
         // Warn about loopback.
         if (ips.isEmpty() && macs.isEmpty())
             U.warn(log, "Ignite is starting on loopback address... Only nodes 
on the same physical " +
-                    "computer can participate in topology.",
-                "Ignite is starting on loopback address...");
+                "computer can participate in topology.");
 
         // Stick in network context into attributes.
         add(ATTR_IPS, (ips.isEmpty() ? "" : ips));
@@ -2515,9 +2514,7 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
             U.warn(
                 log,
                 "Peer class loading is enabled (disable it in production for 
performance and " +
-                    "deployment consistency reasons)",
-                "Peer class loading is enabled (disable it for better 
performance)"
-            );
+                    "deployment consistency reasons)");
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b2f349f/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java 
b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index aff19c0..2b408df 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -2259,8 +2259,7 @@ public class IgnitionEx {
                         "(only recent 1.6 and 1.7 versions HotSpot VMs are 
supported). " +
                         "To enable fast marshalling upgrade to recent 1.6 or 
1.7 HotSpot VM release. " +
                         "Switching to standard JDK marshalling - " +
-                        "object serialization performance will be 
significantly slower.",
-                        "To enable fast marshalling upgrade to recent 1.6 or 
1.7 HotSpot VM release.");
+                        "object serialization performance will be 
significantly slower.");
 
                     marsh = new JdkMarshaller();
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b2f349f/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridTcpRouterNioListenerAdapter.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridTcpRouterNioListenerAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridTcpRouterNioListenerAdapter.java
index 364e044..4c61ead 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridTcpRouterNioListenerAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridTcpRouterNioListenerAdapter.java
@@ -162,8 +162,7 @@ public abstract class GridTcpRouterNioListenerAdapter 
implements GridNioServerLi
 
                 U.warn(
                     log,
-                    "Message forwarding was interrupted (will ignore last 
message): " + e.getMessage(),
-                    "Message forwarding was interrupted.");
+                    "Message forwarding was interrupted (will ignore last 
message): " + e.getMessage());
             }
         }
         else if (msg instanceof GridClientHandshakeRequest) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b2f349f/modules/core/src/main/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointManager.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointManager.java
index f0b19f3..6337d53 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointManager.java
@@ -188,8 +188,7 @@ public class GridCheckpointManager extends 
GridManagerAdapter<CheckpointSpi> {
                         U.warn(log, S.toString("Checkpoint will not be saved 
due to session invalidation",
                             "key", key, true,
                             "val", state, true,
-                            "ses", ses, false),
-                            "Checkpoint will not be saved due to session 
invalidation.");
+                            "ses", ses, false));
 
                         break;
                     }
@@ -198,8 +197,7 @@ public class GridCheckpointManager extends 
GridManagerAdapter<CheckpointSpi> {
                         U.warn(log, S.toString("Checkpoint will not be saved 
due to session timeout",
                             "key", key, true,
                             "val", state, true,
-                            "ses", ses, false),
-                            "Checkpoint will not be saved due to session 
timeout.");
+                            "ses", ses, false));
 
                         break;
                     }
@@ -224,8 +222,7 @@ public class GridCheckpointManager extends 
GridManagerAdapter<CheckpointSpi> {
                             U.warn(log, S.toString("Checkpoint will not be 
saved due to session invalidation",
                                 "key", key, true,
                                 "val", state, true,
-                                "ses", ses, false),
-                                "Checkpoint will not be saved due to session 
invalidation.");
+                                "ses", ses, false));
 
                             keyMap.remove(ses.getId(), keys);
 
@@ -508,4 +505,4 @@ public class GridCheckpointManager extends 
GridManagerAdapter<CheckpointSpi> {
             }
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b2f349f/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentManager.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentManager.java
index cea1786..01d8604 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentManager.java
@@ -470,7 +470,7 @@ public class GridDeploymentManager extends 
GridManagerAdapter<DeploymentSpi> {
                             "in some other mode). Either change 
IgniteConfiguration.getDeploymentMode() property to " +
                             "SHARED or CONTINUOUS or remove class from local 
classpath and any of " +
                             "the local GAR deployments that may have it [cls=" 
+ meta.className() + ", depMode=" +
-                            locDep.deployMode() + ']', "Failed to deploy class 
in SHARED or CONTINUOUS mode.");
+                            locDep.deployMode() + ']');
 
                         return null;
                     }
@@ -478,8 +478,7 @@ public class GridDeploymentManager extends 
GridManagerAdapter<DeploymentSpi> {
                     if (!locDep.userVersion().equals(meta.userVersion())) {
                         U.warn(log, "Failed to deploy class in SHARED or 
CONTINUOUS mode for given user version " +
                             "(class is locally deployed for a different user 
version) [cls=" + meta.className() +
-                            ", localVer=" + locDep.userVersion() + ", 
otherVer=" + meta.userVersion() + ']',
-                            "Failed to deploy class in SHARED or CONTINUOUS 
mode.");
+                            ", localVer=" + locDep.userVersion() + ", 
otherVer=" + meta.userVersion() + ']');
 
                         return null;
                     }
@@ -664,4 +663,4 @@ public class GridDeploymentManager extends 
GridManagerAdapter<DeploymentSpi> {
             return S.toString(LocalDeployment.class, this, super.toString());
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b2f349f/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 38ce9bd..82abdf5 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -1221,8 +1221,7 @@ public class GridDiscoveryManager extends 
GridManagerAdapter<DiscoverySpi> {
                         "(all nodes in topology should have identical value) " 
+
                         "[locPreferIpV4=" + locPreferIpV4 + ", rmtPreferIpV4=" 
+ rmtPreferIpV4 +
                         ", locId8=" + U.id8(locNode.id()) + ", rmtId8=" + 
U.id8(n.id()) +
-                        ", rmtAddrs=" + U.addressesAsString(n) + ", rmtNode=" 
+ U.toShortString(n) + "]",
-                        "Local and remote 'java.net.preferIPv4Stack' system 
properties do not match.");
+                        ", rmtAddrs=" + U.addressesAsString(n) + ", rmtNode=" 
+ U.toShortString(n) + "]");
 
                 ipV4Warned = true;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b2f349f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
index 6caf3e4..cfe7e46 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
@@ -238,8 +238,7 @@ public class GridCacheEvictionManager extends 
GridCacheManagerAdapter implements
         }
 
         U.warn(log, "Evictions started (cache may have reached its capacity)." 
+
-                " You may wish to increase 'maxSize' on eviction policy being 
used for cache: " + cctx.name(),
-            "Evictions started (cache may have reached its capacity): " + 
cctx.name());
+            " You may wish to increase 'maxSize' on eviction policy being used 
for cache: " + cctx.name());
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b2f349f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 538d367..09e2860 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -509,18 +509,15 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 
         if (delay != 0) {
             if (cc.getCacheMode() != PARTITIONED)
-                U.warn(log, "Rebalance delay is supported only for partitioned 
caches (will ignore): " + (cc.getName()),
-                    "Will ignore rebalance delay for cache: " + 
U.maskName(cc.getName()));
+                U.warn(log, "Rebalance delay is supported only for partitioned 
caches (will ignore): " + (cc.getName()));
             else if (cc.getRebalanceMode() == SYNC) {
                 if (delay < 0) {
                     U.warn(log, "Ignoring SYNC rebalance mode with manual 
rebalance start (node will not wait for " +
-                            "rebalancing to be finished): " + 
U.maskName(cc.getName()),
-                        "Node will not wait for rebalance in SYNC mode: " + 
U.maskName(cc.getName()));
+                        "rebalancing to be finished): " + 
U.maskName(cc.getName()));
                 }
                 else {
                     U.warn(log, "Using SYNC rebalance mode with rebalance 
delay (node will wait until rebalancing is " +
-                            "initiated for " + delay + "ms) for cache: " + 
U.maskName(cc.getName()),
-                        "Node will wait until rebalancing is initiated for " + 
delay + "ms for cache: " + U.maskName(cc.getName()));
+                        "initiated for " + delay + "ms) for cache: " + 
U.maskName(cc.getName()));
                 }
             }
         }
@@ -665,8 +662,7 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
         if (!F.isEmpty(ctx.config().getCacheConfiguration())) {
             if (depMode != CONTINUOUS && depMode != SHARED)
                 U.warn(log, "Deployment mode for cache is not CONTINUOUS or 
SHARED " +
-                        "(it is recommended that you change deployment mode 
and restart): " + depMode,
-                    "Deployment mode for cache is not CONTINUOUS or SHARED.");
+                    "(it is recommended that you change deployment mode and 
restart): " + depMode);
         }
 
         initializeInternalCacheNames();

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b2f349f/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java
index f08cc25..caedd1a 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java
@@ -129,14 +129,12 @@ public class GridTcpRestProtocol extends 
GridRestProtocolAdapter {
                 "[firstPort=" + cfg.getPort() + ", lastPort=" + lastPort + ", 
host=" + host + ']');
         }
         catch (SSLException e) {
-            U.warn(log, "Failed to start " + name() + " protocol on port " + 
port + ": " + e.getMessage(),
-                "Failed to start " + name() + " protocol on port " + port + ". 
Check if SSL context factory is " +
-                    "properly configured.");
+            U.warn(log, "Failed to start " + name() + " protocol on port " + 
port + ". Check if SSL context factory " +
+                "is properly configured: " + e.getMessage());
         }
         catch (IOException e) {
-            U.warn(log, "Failed to start " + name() + " protocol on port " + 
port + ": " + e.getMessage(),
-                "Failed to start " + name() + " protocol on port " + port + ". 
" +
-                    "Check restTcpHost configuration property.");
+            U.warn(log, "Failed to start " + name() + " protocol on port " + 
port + ". " +
+                "Check restTcpHost configuration property: " + e.getMessage());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b2f349f/modules/core/src/main/java/org/apache/ignite/internal/util/GridLogThrottle.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/util/GridLogThrottle.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/util/GridLogThrottle.java
index 396cf37..b0b4d80 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/util/GridLogThrottle.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/util/GridLogThrottle.java
@@ -88,7 +88,7 @@ public class GridLogThrottle {
     public static void error(@Nullable IgniteLogger log, @Nullable Throwable 
e, String msg) {
         assert !F.isEmpty(msg);
 
-        log(log, e, msg, null, LogLevel.ERROR, false, false);
+        log(log, e, msg, LogLevel.ERROR, false, false);
     }
 
     /**
@@ -102,7 +102,7 @@ public class GridLogThrottle {
     public static void error(@Nullable IgniteLogger log, @Nullable Throwable 
e, String msg, boolean byMsg) {
         assert !F.isEmpty(msg);
 
-        log(log, e, msg, null, LogLevel.ERROR, false, byMsg);
+        log(log, e, msg, LogLevel.ERROR, false, byMsg);
     }
 
     /**
@@ -114,7 +114,7 @@ public class GridLogThrottle {
     public static void warn(@Nullable IgniteLogger log, String msg) {
         assert !F.isEmpty(msg);
 
-        log(log, null, msg, null, LogLevel.WARN, false, false);
+        log(log, null, msg, LogLevel.WARN, false, false);
     }
 
     /**
@@ -129,7 +129,7 @@ public class GridLogThrottle {
     public static void warn(@Nullable IgniteLogger log, @Nullable Throwable e, 
String msg, boolean quite, boolean byMsg) {
         assert !F.isEmpty(msg);
 
-        log(log, e, msg, null, LogLevel.WARN, quite, byMsg);
+        log(log, e, msg, LogLevel.WARN, quite, byMsg);
     }
 
 
@@ -143,20 +143,7 @@ public class GridLogThrottle {
     public static void warn(@Nullable IgniteLogger log, String msg, boolean 
quiet) {
         assert !F.isEmpty(msg);
 
-        log(log, null, msg, null, LogLevel.WARN, quiet, false);
-    }
-
-    /**
-     * Logs warning if needed.
-     *
-     * @param log Logger.
-     * @param longMsg Long message (or just message).
-     * @param shortMsg Short message for quiet logging.
-     */
-    public static void warn(@Nullable IgniteLogger log, String longMsg, 
@Nullable String shortMsg) {
-        assert !F.isEmpty(longMsg);
-
-        log(log, null, longMsg, shortMsg, LogLevel.WARN, false, false);
+        log(log, null, msg, LogLevel.WARN, quiet, false);
     }
 
     /**
@@ -169,7 +156,7 @@ public class GridLogThrottle {
     public static void info(@Nullable IgniteLogger log, String msg, boolean 
quiet) {
         assert !F.isEmpty(msg);
 
-        log(log, null, msg, null, LogLevel.INFO, quiet, false);
+        log(log, null, msg, LogLevel.INFO, quiet, false);
     }
 
     /**
@@ -197,13 +184,17 @@ public class GridLogThrottle {
      * @param log Logger.
      * @param e Error (optional).
      * @param longMsg Long message (or just message).
-     * @param shortMsg Short message for quiet logging.
      * @param level Level where messages should appear.
      * @param byMsg Errors group by message, not by tuple(error, msg).
      */
     @SuppressWarnings({"RedundantTypeArguments"})
-    private static void log(@Nullable IgniteLogger log, @Nullable Throwable e, 
String longMsg,
-        @Nullable String shortMsg, LogLevel level, boolean quiet, boolean 
byMsg) {
+    private static void log(@Nullable IgniteLogger log,
+        @Nullable Throwable e,
+        String longMsg,
+        LogLevel level,
+        boolean quiet,
+        boolean byMsg
+    ) {
         assert !F.isEmpty(longMsg);
 
         IgniteBiTuple<Class<? extends Throwable>, String> tup =
@@ -217,7 +208,7 @@ public class GridLogThrottle {
 
             if (loggedTs == null || loggedTs < curTs - throttleTimeout) {
                 if (replace(tup, loggedTs, curTs)) {
-                    level.doLog(log, longMsg, shortMsg, e, quiet);
+                    level.doLog(log, longMsg, e, quiet);
 
                     break;
                 }
@@ -258,32 +249,32 @@ public class GridLogThrottle {
     private enum LogLevel {
         /** Error level. */
         ERROR {
-            @Override public void doLog(IgniteLogger log, String longMsg, 
String shortMsg, Throwable e, boolean quiet) {
+            @Override public void doLog(IgniteLogger log, String msg, 
Throwable e, boolean quiet) {
                 if (e != null)
-                    U.error(log, longMsg, e);
+                    U.error(log, msg, e);
                 else
-                    U.error(log, longMsg);
+                    U.error(log, msg);
             }
         },
 
         /** Warn level. */
         WARN {
-            @Override public void doLog(IgniteLogger log, String longMsg, 
String shortMsg, Throwable e, boolean quiet) {
+            @Override public void doLog(IgniteLogger log, String msg, 
Throwable e, boolean quiet) {
                 if (quiet)
-                    U.quietAndWarn(log, longMsg, F.isEmpty(shortMsg) ? longMsg 
: shortMsg);
+                    U.quietAndWarn(log, msg);
                 else
-                    U.warn(log, longMsg, F.isEmpty(shortMsg) ? longMsg : 
shortMsg);
+                    U.warn(log, msg);
             }
         },
 
         /** Info level. */
         INFO {
-            @Override public void doLog(IgniteLogger log, String longMsg, 
String shortMsg, Throwable e, boolean quiet) {
+            @Override public void doLog(IgniteLogger log, String msg, 
Throwable e, boolean quiet) {
                 if (quiet)
-                    U.quietAndInfo(log, longMsg);
+                    U.quietAndInfo(log, msg);
                 else {
                     if (log.isInfoEnabled())
-                        log.info(longMsg);
+                        log.info(msg);
                 }
             }
         };
@@ -292,10 +283,9 @@ public class GridLogThrottle {
          * Performs logging operation.
          *
          * @param log Logger to use.
-         * @param longMsg Long message.
-         * @param shortMsg Short message.
+         * @param msg Long message.
          * @param e Exception to attach to log.
          */
-        public abstract void doLog(IgniteLogger log, String longMsg, String 
shortMsg, Throwable e, boolean quiet);
+        public abstract void doLog(IgniteLogger log, String msg, Throwable e, 
boolean quiet);
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b2f349f/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java 
b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 3dfa8c1..a68fb6d 100755
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -4230,7 +4230,7 @@ public abstract class IgniteUtils {
 
         String s = msg.toString();
 
-        warn(log, s, s);
+        warn(log, s, null);
     }
 
     /**
@@ -4286,18 +4286,23 @@ public abstract class IgniteUtils {
      * or in QUIET mode it will add {@code (wrn)} prefix to the message.
      *
      * @param log Optional logger to use when QUIET mode is not enabled.
-     * @param longMsg Message to log using normal logger.
-     * @param shortMsg Message to log using quiet logger.
+     * @param msg Message to log using normal logger.
+     * @param e Optional exception.
      */
-    public static void warn(@Nullable IgniteLogger log, Object longMsg, Object 
shortMsg) {
-        assert longMsg != null;
-        assert shortMsg != null;
+    public static void warn(@Nullable IgniteLogger log, Object msg, @Nullable 
Throwable e) {
+        assert msg != null;
 
         if (log != null)
-            log.warning(compact(longMsg.toString()));
-        else
+            log.warning(compact(msg.toString()), e);
+        else {
             X.println("[" + SHORT_DATE_FMT.format(new java.util.Date()) + "] 
(wrn) " +
-                compact(shortMsg.toString()));
+                    compact(msg.toString()));
+
+            if (e != null)
+                e.printStackTrace(System.err);
+            else
+                X.printerrln();
+        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b2f349f/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 3859e17..15b941f 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
@@ -3681,9 +3681,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                         if (subj == null) {
                             // Node has not pass authentication.
                             LT.warn(log, "Authentication failed [nodeId=" + 
node.id() +
-                                    ", addrs=" + U.addressesAsString(node) + 
']',
-                                "Authentication failed [nodeId=" + 
U.id8(node.id()) + ", addrs=" +
-                                    U.addressesAsString(node) + ']');
+                                ", addrs=" + U.addressesAsString(node) + ']');
 
                             // Always output in debug.
                             if (log.isDebugEnabled())
@@ -3712,10 +3710,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                             if (!(subj instanceof Serializable)) {
                                 // Node has not pass authentication.
                                 LT.warn(log, "Authentication subject is not 
Serializable [nodeId=" + node.id() +
-                                        ", addrs=" + U.addressesAsString(node) 
+ ']',
-                                    "Authentication subject is not 
Serializable [nodeId=" + U.id8(node.id()) +
-                                        ", addrs=" +
-                                        U.addressesAsString(node) + ']');
+                                    ", addrs=" + U.addressesAsString(node) + 
']');
 
                                 authFailedMsg = "Authentication subject is not 
serializable";
                             }
@@ -4311,9 +4306,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                             if 
(!permissionsEqual(coordSubj.subject().permissions(), 
subj.subject().permissions())) {
                                 // Node has not pass authentication.
                                 LT.warn(log, "Authentication failed [nodeId=" 
+ node.id() +
-                                        ", addrs=" + U.addressesAsString(node) 
+ ']',
-                                    "Authentication failed [nodeId=" + 
U.id8(node.id()) + ", addrs=" +
-                                        U.addressesAsString(node) + ']');
+                                    ", addrs=" + U.addressesAsString(node) + 
']');
 
                                 // Always output in debug.
                                 if (log.isDebugEnabled())
@@ -4417,9 +4410,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                                         LT.warn(log,
                                             "Failed to authenticate local node 
" +
                                                 "(local authentication result 
is different from rest of topology) " +
-                                                "[nodeId=" + node.id() + ", 
addrs=" + U.addressesAsString(node) + ']',
-                                            "Authentication failed [nodeId=" + 
U.id8(node.id()) +
-                                                ", addrs=" + 
U.addressesAsString(node) + ']');
+                                                "[nodeId=" + node.id() + ", 
addrs=" + U.addressesAsString(node) + ']');
 
                                         joinRes.set(authFail);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b2f349f/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
 
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 4f51ca0..d059306 100644
--- 
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ 
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -1258,19 +1258,17 @@ public class IgniteH2Indexing implements 
GridQueryIndexing {
             long longQryExecTimeout = 
ctx.config().getLongQueryWarningTimeout();
 
             if (time > longQryExecTimeout) {
-                String msg = "Query execution is too long (" + time + " ms): " 
+ sql;
-
                 ResultSet plan = executeSqlQuery(conn, 
preparedStatementWithParams(conn, "EXPLAIN " + sql,
                     params, false), 0, null);
 
                 plan.next();
 
                 // Add SQL explain result message into log.
-                String longMsg = "Query execution is too long [time=" + time + 
" ms, sql='" + sql + '\'' +
+                String msg = "Query execution is too long [time=" + time + " 
ms, sql='" + sql + '\'' +
                     ", plan=" + U.nl() + plan.getString(1) + U.nl() + ", 
parameters=" +
                     (params == null ? "[]" : 
Arrays.deepToString(params.toArray())) + "]";
 
-                LT.warn(log, longMsg, msg);
+                LT.warn(log, msg);
             }
 
             return rs;

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b2f349f/modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java
 
b/modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java
index dc687b8..4579efd 100644
--- 
a/modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java
+++ 
b/modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java
@@ -2015,9 +2015,7 @@ public class ZookeeperDiscoveryImpl {
 
         if (subj == null) {
             U.warn(log, "Authentication failed [nodeId=" + node.id() +
-                    ", addrs=" + U.addressesAsString(node) + ']',
-                "Authentication failed [nodeId=" + U.id8(node.id()) + ", 
addrs=" +
-                    U.addressesAsString(node) + ']');
+                ", addrs=" + U.addressesAsString(node) + ']');
 
             // Note: exception message test is checked in tests.
             return new ZkNodeValidateResult("Authentication failed");
@@ -2025,10 +2023,7 @@ public class ZookeeperDiscoveryImpl {
 
         if (!(subj instanceof Serializable)) {
             U.warn(log, "Authentication subject is not Serializable [nodeId=" 
+ node.id() +
-                    ", addrs=" + U.addressesAsString(node) + ']',
-                "Authentication subject is not Serializable [nodeId=" + 
U.id8(node.id()) +
-                    ", addrs=" +
-                    U.addressesAsString(node) + ']');
+                ", addrs=" + U.addressesAsString(node) + ']');
 
             return new ZkNodeValidateResult("Authentication subject is not 
serializable");
         }

Reply via email to