ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [29/34] incubator-ignite git commit: ignite-754: minor fixes after the first review round
Date Fri, 17 Apr 2015 11:31:49 GMT
ignite-754: minor fixes after the first review round


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

Branch: refs/heads/ignite-758
Commit: 102de7b5386a97cf211b100695b30fdcf10d1351
Parents: f6a0864
Author: Denis Magda <dmagda@gridgain.com>
Authored: Fri Apr 17 11:53:19 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Fri Apr 17 11:53:19 2015 +0300

----------------------------------------------------------------------
 .../managers/discovery/GridDiscoveryManager.java    | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/102de7b5/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 27f62b2..e7c86f5 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
@@ -738,18 +738,18 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
 
         Object locMode = locNode.attribute(ATTR_DEPLOYMENT_MODE);
 
-        int locJvmMajVer = nodeJavaMajorVer(locNode);
+        int locJvmMajVer = nodeJavaMajorVersion(locNode);
 
         boolean locP2pEnabled = locNode.attribute(ATTR_PEER_CLASSLOADING);
 
         boolean warned = false;
 
         for (ClusterNode n : nodes) {
-            int rmtJvmMajVer = nodeJavaMajorVer(n);
+            int rmtJvmMajVer = nodeJavaMajorVersion(n);
 
             if (locJvmMajVer != rmtJvmMajVer)
-                throw new IgniteCheckedException("Local node's java major version = " + locJvmMajVer
+
-                    " is different from remote node's one = " + rmtJvmMajVer);
+                throw new IgniteCheckedException("Local node's java major version is different
from remote node's one" +
+                    " [locJvmMajVer=" + locJvmMajVer + ", rmtJvmMajVer=" + rmtJvmMajVer +
"]");
 
             String rmtPreferIpV4 = n.attribute("java.net.preferIPv4Stack");
 
@@ -798,12 +798,16 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
      * @return Java major version.
      * @throws IgniteCheckedException If failed to get the version.
      */
-    private int nodeJavaMajorVer(ClusterNode node) throws IgniteCheckedException {
+    private int nodeJavaMajorVersion(ClusterNode node) throws IgniteCheckedException {
         try {
+            // The format is identical for Oracle JDK, OpenJDK and IBM JDK.
             return Integer.parseInt(node.<String>attribute("java.version").split("\\.")[1]);
         }
         catch (Exception e) {
-            throw new IgniteCheckedException("Failed to get java major version with reason:
" + e.getMessage());
+            U.error(log, "Failed to get java major version (unknown 'java.version' format)
[ver=" +
+                node.<String>attribute("java.version") + "]", e);
+
+            return 0;
         }
     }
 


Mime
View raw message