fixing service aware LB spawning
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/f2e441cd Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/f2e441cd Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/f2e441cd Branch: refs/heads/master Commit: f2e441cdb77bbb4520fbcf220eb39ec74d7617c7 Parents: 37bc637 Author: Isuru <[email protected]> Authored: Wed Apr 9 19:06:15 2014 +0530 Committer: Isuru <[email protected]> Committed: Wed Apr 9 19:06:15 2014 +0530 ---------------------------------------------------------------------- .../manager/lb/category/ServiceLevelLoadBalancerCategory.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f2e441cd/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/lb/category/ServiceLevelLoadBalancerCategory.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/lb/category/ServiceLevelLoadBalancerCategory.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/lb/category/ServiceLevelLoadBalancerCategory.java index f9563af..fc47261 100644 --- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/lb/category/ServiceLevelLoadBalancerCategory.java +++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/lb/category/ServiceLevelLoadBalancerCategory.java @@ -51,7 +51,7 @@ public class ServiceLevelLoadBalancerCategory extends LoadBalancerCategory { String clusterId = null; try { - clusterId = AutoscalerServiceClient.getServiceClient().getServiceLBClusterId(cartridgeInfo.getType(), getDeploymentPolicyName()); + clusterId = AutoscalerServiceClient.getServiceClient().getServiceLBClusterId(getLoadBalancedServiceType(), getDeploymentPolicyName()); } catch (Exception e) { log.error("Error occurred in retrieving Service LB cluster id" + e.getMessage()); @@ -59,6 +59,7 @@ public class ServiceLevelLoadBalancerCategory extends LoadBalancerCategory { } if (clusterId != null) { + //set the cluster id to Cluster object cluster.setClusterDomain(clusterId); if (log.isDebugEnabled()) { @@ -86,6 +87,7 @@ public class ServiceLevelLoadBalancerCategory extends LoadBalancerCategory { return null; } else { + // set cluster domain cluster.setClusterDomain(generateClusterId(alias, cartridgeInfo.getType())); // set hostname @@ -110,7 +112,7 @@ public class ServiceLevelLoadBalancerCategory extends LoadBalancerCategory { super.register(cartridgeInfo, cluster, payloadData, autoscalePolicyName, deploymentPolicyName, properties); }else { - log.info("Service LB already exists for cartridge type: " + cartridgeInfo.getType() + ", deployment policy: " + getDeploymentPolicyName()); + log.info("Service LB already exists for cartridge type: " + getLoadBalancedServiceType() + ", deployment policy: " + getDeploymentPolicyName()); } } }
