You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2013/12/11 12:54:15 UTC

git commit: setting whether the cluster is lb or not

Updated Branches:
  refs/heads/master e68c7e86c -> 0bbf1f13c


setting whether the cluster is lb or not


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

Branch: refs/heads/master
Commit: 0bbf1f13c9491f441365cdb5b88708e3b824307a
Parents: e68c7e8
Author: Nirmal Fernando <ni...@apache.org>
Authored: Wed Dec 11 17:23:53 2013 +0530
Committer: Nirmal Fernando <ni...@apache.org>
Committed: Wed Dec 11 17:23:53 2013 +0530

----------------------------------------------------------------------
 .../stratos/cloud/controller/topology/TopologyBuilder.java     | 6 ++++++
 .../cloud/controller/util/CloudControllerConstants.java        | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0bbf1f13/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyBuilder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyBuilder.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyBuilder.java
index 185abad..39c7608 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyBuilder.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/topology/TopologyBuilder.java
@@ -26,6 +26,7 @@ import org.apache.stratos.cloud.controller.pojo.ClusterContext;
 import org.apache.stratos.cloud.controller.pojo.PortMapping;
 import org.apache.stratos.cloud.controller.pojo.Registrant;
 import org.apache.stratos.cloud.controller.runtime.FasterLookUpDataHolder;
+import org.apache.stratos.cloud.controller.util.CloudControllerConstants;
 import org.apache.stratos.cloud.controller.util.CloudControllerUtil;
 import org.apache.stratos.messaging.domain.topology.*;
 import org.apache.stratos.messaging.event.instance.status.MemberActivatedEvent;
@@ -169,6 +170,9 @@ public class TopologyBuilder {
 //            } else {
             Properties props = CloudControllerUtil.toJavaUtilProperties(registrant.getProperties());
             
+            String property = props.getProperty(CloudControllerConstants.IS_LOAD_BALANCER);
+            boolean isLb = property != null ? Boolean.parseBoolean(property) : false;
+            
             Cluster cluster;
                 if (service.clusterExists(registrant.getClusterId())) {
                     //update the cluster
@@ -177,6 +181,7 @@ public class TopologyBuilder {
                     cluster.setAutoscalePolicyName(registrant.getAutoScalerPolicyName());
                     cluster.setTenantRange(registrant.getTenantRange());
                     cluster.setProperties(props);
+                    cluster.setLbCluster(isLb);
                 } else {
                     cluster = new Cluster(registrant.getCartridgeType(),
                             registrant.getClusterId(),
@@ -185,6 +190,7 @@ public class TopologyBuilder {
                     cluster.setTenantRange(registrant.getTenantRange());
                     cluster.setAutoscalePolicyName(registrant.getAutoScalerPolicyName());
                     cluster.setProperties(props);
+                    cluster.setLbCluster(isLb);
                     service.addCluster(cluster);
                 }
 //            }

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0bbf1f13/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerConstants.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerConstants.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerConstants.java
index ee135de..d357a58 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerConstants.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerConstants.java
@@ -246,5 +246,5 @@ public final class CloudControllerConstants {
     public static final String AUTO_ASSIGN_IP = "autoAssignIp";
     public static final String INSTANCE_TYPE = "instanceType";
 
-    
+    public static final String IS_LOAD_BALANCER = "load.balancer";
 }