Repository: stratos
Updated Branches:
  refs/heads/container-autoscaling f37ece08b -> 6b87cca59


If the member context is already there, stop executing 'on Pod activated' logic.


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/6d88c6d4
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/6d88c6d4
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/6d88c6d4

Branch: refs/heads/container-autoscaling
Commit: 6d88c6d4a83841f77320437fa3f0cd685534c899
Parents: f37ece0
Author: Nirmal Fernando <[email protected]>
Authored: Fri Oct 10 20:29:56 2014 +0530
Committer: Nirmal Fernando <[email protected]>
Committed: Fri Oct 10 20:29:56 2014 +0530

----------------------------------------------------------------------
 .../stratos/cloud/controller/util/PodActivationWatcher.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/6d88c6d4/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/PodActivationWatcher.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/PodActivationWatcher.java
 
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/PodActivationWatcher.java
index 13d1ac6..672cfeb 100644
--- 
a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/PodActivationWatcher.java
+++ 
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/PodActivationWatcher.java
@@ -48,20 +48,21 @@ public class PodActivationWatcher implements Runnable {
     @Override
     public void run() {
         try {
+            FasterLookUpDataHolder dataHolder = 
FasterLookUpDataHolder.getInstance();
             Pod pod = kubApi.getPod(podId);
             if (LOG.isDebugEnabled()) {
                 LOG.debug("PodActivationWatcher running : 
"+pod.getCurrentState().getStatus());
             }
-            if ("Running".equals(pod.getCurrentState().getStatus())) {
+            if ("Running".equals(pod.getCurrentState().getStatus()) && 
dataHolder.getMemberContextOfMemberId(podId) == null) {
                 String hostIP = pod.getCurrentState().getHost();
                 ctxt.setPublicIpAddress(hostIP);
                 ctxt.setPrivateIpAddress(hostIP);
-                FasterLookUpDataHolder.getInstance().addMemberContext(ctxt);
+                dataHolder.addMemberContext(ctxt);
                 // trigger topology
                 TopologyBuilder.handleMemberSpawned(ctxt.getCartridgeType(), 
ctxt.getClusterId(), 
                         null, hostIP, hostIP, ctxt);
                 
-                
RegistryManager.getInstance().persist(FasterLookUpDataHolder.getInstance());
+                RegistryManager.getInstance().persist(dataHolder);
                 
             }
             

Reply via email to