ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [23/47] incubator-ignite git commit: ignite-754: implemented
Date Fri, 17 Apr 2015 16:06:45 GMT
ignite-754: implemented


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

Branch: refs/heads/ignite-485
Commit: bee6ac82d6ed41dc7e5262c72100c7274a1e7880
Parents: 655514b
Author: Denis Magda <dmagda@gridgain.com>
Authored: Thu Apr 16 13:53:51 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Thu Apr 16 13:53:51 2015 +0300

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


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bee6ac82/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 9f74b83..7b6edc2 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,11 +738,19 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
 
         Object locMode = locNode.attribute(ATTR_DEPLOYMENT_MODE);
 
+        int locJvmMajVer = nodeJavaMajorVer(locNode);
+
         boolean locP2pEnabled = locNode.attribute(ATTR_PEER_CLASSLOADING);
 
         boolean warned = false;
 
         for (ClusterNode n : nodes) {
+            int rmtJvmMajVer = nodeJavaMajorVer(n);
+
+            if (locJvmMajVer != rmtJvmMajVer)
+                throw new IgniteCheckedException("Local node's java major version = " + locJvmMajVer
+
+                    " is different from remote node's one = " + rmtJvmMajVer);
+
             String rmtPreferIpV4 = n.attribute("java.net.preferIPv4Stack");
 
             if (!F.eq(rmtPreferIpV4, locPreferIpV4)) {
@@ -783,6 +791,14 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
             log.debug("Finished node attributes consistency check.");
     }
 
+    private int nodeJavaMajorVer(ClusterNode node) throws IgniteCheckedException {
+        try {
+            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());
+        }
+    }
     /**
      * @param nodes Nodes.
      * @return Total CPUs.


Mime
View raw message