ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sath...@apache.org
Subject [15/30] ode git commit: Included all the changes to create patch-1
Date Fri, 06 Nov 2015 10:51:10 GMT
Included all the changes to create patch-1


Project: http://git-wip-us.apache.org/repos/asf/ode/repo
Commit: http://git-wip-us.apache.org/repos/asf/ode/commit/224dc217
Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/224dc217
Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/224dc217

Branch: refs/heads/ODE-563
Commit: 224dc217ba34a27a3df5f0453481f41996b92271
Parents: 82143f4
Author: suba <suba.11@cse.mrt.ac.lk>
Authored: Tue Jun 30 22:24:41 2015 +0530
Committer: suba <suba.11@cse.mrt.ac.lk>
Committed: Tue Jun 30 22:24:41 2015 +0530

----------------------------------------------------------------------
 .../hazelcast/HazelcastClusterImpl.java         | 22 ++++++++++++--------
 1 file changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ode/blob/224dc217/clustering/src/main/java/org/apache/ode/clustering/hazelcast/HazelcastClusterImpl.java
----------------------------------------------------------------------
diff --git a/clustering/src/main/java/org/apache/ode/clustering/hazelcast/HazelcastClusterImpl.java
b/clustering/src/main/java/org/apache/ode/clustering/hazelcast/HazelcastClusterImpl.java
index c721373..11e1313 100644
--- a/clustering/src/main/java/org/apache/ode/clustering/hazelcast/HazelcastClusterImpl.java
+++ b/clustering/src/main/java/org/apache/ode/clustering/hazelcast/HazelcastClusterImpl.java
@@ -40,6 +40,8 @@ public class HazelcastClusterImpl implements ClusterManager {
 
     private HazelcastInstance _hazelcastInstance;
     private boolean isMaster = false;
+    private String nodeID;
+    private String uuid;
     private Member leader;
     private IMap<String, String> lock_map;
     private ITopic<ProcessStoreClusterEvent> clusterMessageTopic;
@@ -68,7 +70,9 @@ public class HazelcastClusterImpl implements ClusterManager {
             // Registering this node in the cluster.
             _hazelcastInstance.getCluster().addMembershipListener(new ClusterMemberShipListener());
             Member localMember = _hazelcastInstance.getCluster().getLocalMember();
-            __log.info("Registering HZ localMember ID " + localMember);
+            nodeID = localMember.getInetSocketAddress().getHostName() +":" +localMember.getInetSocketAddress().getPort();
+            uuid = localMember.getUuid();
+            __log.info("Registering HZ localMember ID " + nodeID);
             markAsMaster();
             lock_map = _hazelcastInstance.getMap(HazelcastConstants.ODE_CLUSTER_DEPLOYMENT_LOCK);
             clusterMessageTopic = _hazelcastInstance.getTopic(HazelcastConstants.ODE_CLUSTER_MSG);
@@ -122,8 +126,8 @@ public class HazelcastClusterImpl implements ClusterManager {
     }
 
     public void publishProcessStoreClusterEvent(ProcessStoreClusterEvent clusterEvent) {
-        clusterEvent.setUuid(_hazelcastInstance.getCluster().getLocalMember().getUuid());
-        __log.info("Send " +clusterEvent.getInfo() +"Cluster Message " +"for " +clusterEvent.getDuName());
+        clusterEvent.setUuid(uuid);
+        __log.info("Send " +clusterEvent.getInfo() +" Cluster Message " +"for " +clusterEvent.getDuName()
+" [" +nodeID +"]");
         clusterMessageTopic.publish(clusterEvent);
     }
 
@@ -138,20 +142,20 @@ public class HazelcastClusterImpl implements ClusterManager {
     private void handleEvent(ProcessStoreClusterEvent message) {
         if (message instanceof ProcessStoreDeployedEvent) {
             ProcessStoreDeployedEvent event = (ProcessStoreDeployedEvent) message;
-
-            if (!_hazelcastInstance.getCluster().getLocalMember().getUuid().equals(event.getUuid()))
{
+            String eventUuid =  event.getUuid();
+            if (!uuid.equals(eventUuid)) {
                 String duName = event.getDuName();
-                __log.info("Receive " +event.getInfo() +"Cluster Message " +"for " +event.getDuName());
+                __log.info("Receive " +event.getInfo() +" Cluster Message " +"for " +event.getDuName()
+" [" +nodeID +"]");
                 _clusterProcessStore.deployProcesses(duName);
             }
         }
 
         else if (message instanceof ProcessStoreUndeployedEvent) {
             ProcessStoreUndeployedEvent event = (ProcessStoreUndeployedEvent) message;
-
-            if (!_hazelcastInstance.getCluster().getLocalMember().getUuid().equals(event.getUuid()))
{
+            String eventUuid =  event.getUuid();
+            if (!uuid.equals(eventUuid)) {
                 String duName = event.getDuName();
-                __log.info("Receive " +event.getInfo() +"Cluster Message " +"for " +event.getDuName());
+                __log.info("Receive " +event.getInfo() +"  Cluster Message " +"for " +event.getDuName()
+" [" +nodeID +"]");
                 _clusterProcessStore.undeployProcesses(duName);
             }
         }


Mime
View raw message