Updated Branches:
  refs/heads/master ba8131ac0 -> ba5e7b2b0

Fixing lb id null issue at spawning instance


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

Branch: refs/heads/master
Commit: ba5e7b2b032978057b4d96817c9ab4f6b01971bd
Parents: ba8131a
Author: Lahiru Sandaruwan <[email protected]>
Authored: Fri Jan 17 08:21:02 2014 +0530
Committer: Lahiru Sandaruwan <[email protected]>
Committed: Fri Jan 17 08:21:02 2014 +0530

----------------------------------------------------------------------
 .../stratos/autoscaler/rule/RuleTasksDelegator.java   | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ba5e7b2b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java
 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java
index 063c2c0..7ce2de5 100644
--- 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java
+++ 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/rule/RuleTasksDelegator.java
@@ -85,19 +85,27 @@ public class RuleTasksDelegator {
 
     public static String getLbClusterId(String lbRefType, PartitionContext 
partitionCtxt, 
         NetworkPartitionContext nwPartitionCtxt) {
-       
+
        String lbClusterId = null;
 
         if (lbRefType != null) {
             if 
(lbRefType.equals(org.apache.stratos.messaging.util.Constants.DEFAULT_LOAD_BALANCER))
 {
-                lbClusterId = nwPartitionCtxt.getDefaultLbClusterId();
+                lbClusterId = 
PartitionManager.getInstance().getNetworkPartition(nwPartitionCtxt.getId()).getDefaultLbClusterId();
+//                lbClusterId = nwPartitionCtxt.getDefaultLbClusterId();
             } else if 
(lbRefType.equals(org.apache.stratos.messaging.util.Constants.SERVICE_AWARE_LOAD_BALANCER))
 {
                 String serviceName = partitionCtxt.getServiceName();
-                lbClusterId = 
nwPartitionCtxt.getLBClusterIdOfService(serviceName);
+                lbClusterId = 
PartitionManager.getInstance().getNetworkPartition(serviceName)
+                        .getLBClusterIdOfService(nwPartitionCtxt.getId());
+//                lbClusterId = 
nwPartitionCtxt.getLBClusterIdOfService(serviceName);
             } else {
                 log.warn("Invalid LB reference type defined: [value] 
"+lbRefType);
             }
         }
+        if (log.isDebugEnabled()){
+            log.debug(String.format("Getting LB id for spawning instance [lb 
reference] %s ," +
+                    " [partition] %s [network partition] %s [Lb id] %s " , 
lbRefType, partitionCtxt.getPartitionId(),
+                    nwPartitionCtxt.getId(), lbClusterId));
+        }
        return lbClusterId;
     }
 

Reply via email to