You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2014/12/14 06:47:30 UTC

[1/4] stratos git commit: Getting scaling dependencies list directly at parent component monitor

Repository: stratos
Updated Branches:
  refs/heads/4.1.0-test df2d6e6ce -> d9d91484a


Getting scaling dependencies list directly at parent component monitor


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

Branch: refs/heads/4.1.0-test
Commit: 0d3154829beeaab86da32d724450e9f3d8821e98
Parents: c0aed45
Author: Lahiru Sandaruwan <la...@apache.org>
Authored: Sun Dec 14 11:12:43 2014 +0530
Committer: Lahiru Sandaruwan <la...@apache.org>
Committed: Sun Dec 14 11:19:36 2014 +0530

----------------------------------------------------------------------
 .../dependency/DependencyBuilder.java           | 48 ++++++++++----------
 .../component/ParentComponentMonitor.java       |  7 +--
 2 files changed, 28 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/0d315482/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyBuilder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyBuilder.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyBuilder.java
index 745aaa5..7dd9c2a 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyBuilder.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/DependencyBuilder.java
@@ -161,30 +161,30 @@ public class DependencyBuilder {
      * Utility method to build scaling dependencies
      * 
      */
-	public Set<String> buildScalingDependencies(ParentComponent component) {
-		log.info(" ******* in build scaling dependencies ************ "); // TODO - remove
-		Set<String> scalingDependencies = new HashSet<String>();
-		if(component.getDependencyOrder() != null && component.getDependencyOrder().getScalingDependents() != null) {
-			log.info(" ******* in build scaling dependencies 22 ************ "); // TODO - remove
-		for (String string : component.getDependencyOrder().getScalingDependents()) {
-	    
-			log.info(" ******* in build scaling dependencies 33 ************ "); // TODO - remove
-		        if (string.startsWith(Constants.GROUP + ".")) {
-		            //getting the group alias            
-		            scalingDependencies.add(getGroupFromStartupOrder(string));
-		        } else if (string.startsWith(Constants.CARTRIDGE + ".")) {
-		            //getting the cluster alias
-		            String id = getClusterFromStartupOrder(string);
-		            //getting the cluster-id from cluster alias
-		            ClusterDataHolder clusterDataHolder = (ClusterDataHolder) component.getClusterDataMap().get(id);
-		            scalingDependencies.add(clusterDataHolder.getClusterId());
-		        } else {
-		            log.warn("[Scaling Dependency]: " + string + " contains unknown reference");
-		        }
-        }
-		}
-	    return scalingDependencies;
-    }
+//	public Set<String> buildScalingDependencies(ParentComponent component) {
+//		log.info(" ******* in build scaling dependencies ************ "); // TODO - remove
+//		Set<String> scalingDependencies = new HashSet<String>();
+//		if(component.getDependencyOrder() != null && component.getDependencyOrder().getScalingDependents() != null) {
+//			log.info(" ******* in build scaling dependencies 22 ************ "); // TODO - remove
+//		for (String string : component.getDependencyOrder().getScalingDependents()) {
+//
+//			log.info(" ******* in build scaling dependencies 33 ************ "); // TODO - remove
+//		        if (string.startsWith(Constants.GROUP + ".")) {
+//		            //getting the group alias
+//		            scalingDependencies.add(getGroupFromStartupOrder(string));
+//		        } else if (string.startsWith(Constants.CARTRIDGE + ".")) {
+//		            //getting the cluster alias
+//		            String id = getClusterFromStartupOrder(string);
+//		            //getting the cluster-id from cluster alias
+//		            ClusterDataHolder clusterDataHolder = (ClusterDataHolder) component.getClusterDataMap().get(id);
+//		            scalingDependencies.add(clusterDataHolder.getClusterId());
+//		        } else {
+//		            log.warn("[Scaling Dependency]: " + string + " contains unknown reference");
+//		        }
+//        }
+//		}
+//	    return scalingDependencies;
+//    }
 
     /**
      * Utility method to get the group alias from the startup order Eg: group.mygroup

http://git-wip-us.apache.org/repos/asf/stratos/blob/0d315482/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ParentComponentMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ParentComponentMonitor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ParentComponentMonitor.java
index 3f6a5eb..175e2ee 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ParentComponentMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/ParentComponentMonitor.java
@@ -44,6 +44,7 @@ import org.apache.stratos.autoscaler.util.ServiceReferenceHolder;
 import org.apache.stratos.common.threading.StratosThreadPool;
 import org.apache.stratos.messaging.domain.applications.GroupStatus;
 import org.apache.stratos.messaging.domain.applications.ParentComponent;
+import org.apache.stratos.messaging.domain.applications.ScalingDependentList;
 import org.apache.stratos.messaging.domain.instance.ClusterInstance;
 import org.apache.stratos.messaging.domain.instance.Instance;
 import org.apache.stratos.messaging.domain.topology.ClusterStatus;
@@ -65,7 +66,7 @@ public abstract class ParentComponentMonitor extends Monitor {
 	//The monitors dependency tree with all the start-able/kill-able dependencies
     protected DependencyTree startupDependencyTree;
     //The monitors dependency tree with all the scaling dependencies
-    protected Set<String> scalingDependencies;
+    protected Set<ScalingDependentList> scalingDependencies;
     //monitors map, key=GroupAlias/clusterId and value=GroupMonitor/AbstractClusterMonitor
     protected Map<String, Monitor> aliasToActiveMonitorsMap;
     //Pending monitors list
@@ -87,7 +88,7 @@ public abstract class ParentComponentMonitor extends Monitor {
         //Building the startup dependencies for this monitor within the immediate children
         startupDependencyTree = DependencyBuilder.getInstance().buildDependency(component);
         //Building the scaling dependencies for this monitor within the immediate children
-        scalingDependencies  =  DependencyBuilder.getInstance().buildScalingDependencies(component);
+        scalingDependencies  =  component.getDependencyOrder().getScalingDependents();
         //Create the executor service with identifier and thread pool size
 	    executorService= StratosThreadPool.getExecutorService(IDENTIFIER, THREAD_POOL_SIZE);
     }
@@ -702,7 +703,7 @@ private class MonitorAdder implements Runnable {
     }
 }
 
-	public Set<String> getScalingDependencies() {
+	public Set<ScalingDependentList> getScalingDependencies() {
 		return scalingDependencies;
 	}
 }


[4/4] stratos git commit: Scaling dependency list converting logic

Posted by la...@apache.org.
Scaling dependency list converting logic


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

Branch: refs/heads/4.1.0-test
Commit: d9d91484a6edab15896d707de1b2711606f5441f
Parents: a9cd181
Author: Lahiru Sandaruwan <la...@apache.org>
Authored: Sun Dec 14 11:19:25 2014 +0530
Committer: Lahiru Sandaruwan <la...@apache.org>
Committed: Sun Dec 14 11:19:37 2014 +0530

----------------------------------------------------------------------
 .../parser/DefaultApplicationParser.java        |  26 +++--
 .../applications/parser/ParserUtils.java        | 101 ++++++++++++++++++-
 2 files changed, 115 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/d9d91484/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/DefaultApplicationParser.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/DefaultApplicationParser.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/DefaultApplicationParser.java
index fc2e838..867e45a 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/DefaultApplicationParser.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/DefaultApplicationParser.java
@@ -199,14 +199,26 @@ public class DefaultApplicationParser implements ApplicationParser {
                 DependencyOrder appDependencyOrder = new DependencyOrder();
                 String [] startupOrders = appCtxt.getComponents().getDependencyContext().getStartupOrdersContexts();
                 if (startupOrders != null) {
-                	if (log.isDebugEnabled()) {
-                    	log.debug("parsing application ... buildCompositeAppStructure: startupOrders != null for app alias: " +
-                    				appCtxt.getAlias() + " #: " + startupOrders.length);
+                    if (log.isDebugEnabled()) {
+                        log.debug("parsing application ... buildCompositeAppStructure: startupOrders != null for app alias: " +
+                                appCtxt.getAlias() + " #: " + startupOrders.length);
                     }
-                    appDependencyOrder.setStartupOrders(ParserUtils.convert(startupOrders));
+                    appDependencyOrder.setStartupOrders(ParserUtils.convertStartupOrder(startupOrders));
                 } else {
-                	if (log.isDebugEnabled()) {
-                    	log.debug("parsing application ... buildCompositeAppStructure: startupOrders == null for app alias: " + appCtxt.getAlias());
+                    if (log.isDebugEnabled()) {
+                        log.debug("parsing application ... buildCompositeAppStructure: startupOrders == null for app alias: " + appCtxt.getAlias());
+                    }
+                }
+                String [] scalingDependents = appCtxt.getComponents().getDependencyContext().getScalingDependents();
+                if (scalingDependents != null) {
+                    if (log.isDebugEnabled()) {
+                        log.debug("parsing application ... buildCompositeAppStructure: scalingDependents != null for app alias: " +
+                                appCtxt.getAlias() + " #: " + scalingDependents.length);
+                    }
+                    appDependencyOrder.setScalingDependents(ParserUtils.convertScalingDependentList(scalingDependents));
+                } else {
+                    if (log.isDebugEnabled()) {
+                        log.debug("parsing application ... buildCompositeAppStructure: startupOrders == null for app alias: " + appCtxt.getAlias());
                     }
                 }
                 String terminationBehavior = appCtxt.getComponents().getDependencyContext().getTerminationBehaviour();
@@ -450,7 +462,7 @@ public class DefaultApplicationParser implements ApplicationParser {
         // create the Dependency Ordering
         String []  startupOrders = getStartupOrderForGroup(groupCtxt.getName(),serviceGroup);
         if (startupOrders != null) {
-            dependencyOrder.setStartupOrders(ParserUtils.convert(startupOrders, groupCtxt));
+            dependencyOrder.setStartupOrders(ParserUtils.convertStartupOrder(startupOrders, groupCtxt));
         }
         dependencyOrder.setTerminationBehaviour(getKillbehaviour(groupCtxt.getName(),serviceGroup));
         //dependencyOrder.setScalingDependents(scalingDependents);

http://git-wip-us.apache.org/repos/asf/stratos/blob/d9d91484/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/ParserUtils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/ParserUtils.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/ParserUtils.java
index 4633872..4b4d4ce 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/ParserUtils.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/ParserUtils.java
@@ -23,13 +23,14 @@ import org.apache.stratos.autoscaler.applications.pojo.CartridgeContext;
 import org.apache.stratos.autoscaler.applications.pojo.GroupContext;
 import org.apache.stratos.autoscaler.applications.pojo.SubscribableContext;
 import org.apache.stratos.autoscaler.exception.application.ApplicationDefinitionException;
+import org.apache.stratos.messaging.domain.applications.ScalingDependentList;
 import org.apache.stratos.messaging.domain.applications.StartupOrder;
 
 import java.util.*;
 
 public class ParserUtils {
 
-    public static Set<StartupOrder> convert (String [] startupOrderArr) throws ApplicationDefinitionException {
+    public static Set<StartupOrder> convertStartupOrder(String[] startupOrderArr) throws ApplicationDefinitionException {
 
         Set<StartupOrder> startupOrders = new HashSet<StartupOrder>();
 
@@ -60,7 +61,7 @@ public class ParserUtils {
         return new StartupOrder(startupOrders);
     }
 
-    public static Set<StartupOrder> convert (String [] startupOrderArr, GroupContext groupContext)
+    public static Set<StartupOrder> convertStartupOrder(String[] startupOrderArr, GroupContext groupContext)
             throws ApplicationDefinitionException {
 
         Set<StartupOrder> startupOrders = new HashSet<StartupOrder>();
@@ -71,7 +72,7 @@ public class ParserUtils {
 
 
         for (String commaSeparatedStartupOrder : startupOrderArr) {
-            // convert all Startup Orders to aliases-based
+            // convertStartupOrder all Startup Orders to aliases-based
             List<String> components = Arrays.asList(commaSeparatedStartupOrder.split(","));
             startupOrders.add(getStartupOrder(components, groupContext));
         }
@@ -92,7 +93,7 @@ public class ParserUtils {
                 String cartridgeType = component.substring(10);
                 aliasBasedComponent = getAliasForServiceType(cartridgeType, groupContext);
                 if (aliasBasedComponent == null) {
-                    throw new ApplicationDefinitionException("Unable convert Startup Order to alias-based; " +
+                    throw new ApplicationDefinitionException("Unable convertStartupOrder Startup Order to alias-based; " +
                             "cannot find the matching alias for Service type " + cartridgeType);
                 }
 
@@ -102,7 +103,7 @@ public class ParserUtils {
                 String groupName = component.substring(6);
                 aliasBasedComponent = getAliasForGroupName(groupName, groupContext);
                 if (aliasBasedComponent == null) {
-                    throw new ApplicationDefinitionException("Unable convert Startup Order to alias-based; " +
+                    throw new ApplicationDefinitionException("Unable convertStartupOrder Startup Order to alias-based; " +
                             "cannot find the matching alias for Group name " + groupName);
                 }
 
@@ -118,6 +119,96 @@ public class ParserUtils {
         return new StartupOrder(aliasBasedComponents);
     }
 
+
+    public static Set<ScalingDependentList> convertScalingDependentList(String[] scalingDependentListArr) throws ApplicationDefinitionException {
+
+        Set<ScalingDependentList> scalingDependentLists = new HashSet<ScalingDependentList>();
+
+        if (scalingDependentListArr == null) {
+            return scalingDependentLists;
+        }
+
+        for (String commaSeparatedScalingDependentList : scalingDependentListArr) {
+            scalingDependentLists.add(getScalingDependentList(commaSeparatedScalingDependentList));
+        }
+
+        return scalingDependentLists;
+    }
+
+    private static ScalingDependentList getScalingDependentList (String commaSeparatedScalingDependentList) throws ApplicationDefinitionException{
+
+        List<String> scalingDependentLists = new ArrayList<String>();
+
+        for (String scalingDependentList : Arrays.asList(commaSeparatedScalingDependentList.split(","))) {
+            scalingDependentList = scalingDependentList.trim();
+            if (!scalingDependentList.startsWith("cartridge.") && !scalingDependentList.startsWith("group.")) {
+                throw new ApplicationDefinitionException("Incorrect Scaling Dependent List specified, should start with 'cartridge.' or 'group.'");
+            }
+
+            scalingDependentLists.add(scalingDependentList);
+        }
+
+        return new ScalingDependentList(scalingDependentLists);
+    }
+
+    public static Set<ScalingDependentList> convertScalingDependentList(String[] scalingDependentListArr, GroupContext groupContext)
+            throws ApplicationDefinitionException {
+
+        Set<ScalingDependentList> scalingDependentLists = new HashSet<ScalingDependentList>();
+
+        if (scalingDependentListArr == null) {
+            return scalingDependentLists;
+        }
+
+
+        for (String commaSeparatedScalingDependentList : scalingDependentListArr) {
+            // convertScalingDependentList all scaling dependents to aliases-based
+            List<String> components = Arrays.asList(commaSeparatedScalingDependentList.split(","));
+            scalingDependentLists.add(getScalingDependentList(components, groupContext));
+        }
+
+        return scalingDependentLists;
+    }
+
+    private static ScalingDependentList getScalingDependentList (List<String> components, GroupContext groupContext)
+            throws ApplicationDefinitionException {
+
+        List<String> aliasBasedComponents = new ArrayList<String>();
+
+        for (String component : components) {
+            component = component.trim();
+
+            String aliasBasedComponent;
+            if (component.startsWith("cartridge.")) {
+                String cartridgeType = component.substring(10);
+                aliasBasedComponent = getAliasForServiceType(cartridgeType, groupContext);
+                if (aliasBasedComponent == null) {
+                    throw new ApplicationDefinitionException("Unable convertScalingDependentList Scaling dependent list to alias-based; " +
+                            "cannot find the matching alias for Service type " + cartridgeType);
+                }
+
+                aliasBasedComponent = "cartridge.".concat(aliasBasedComponent);
+
+            } else if (component.startsWith("group.")) {
+                String groupName = component.substring(6);
+                aliasBasedComponent = getAliasForGroupName(groupName, groupContext);
+                if (aliasBasedComponent == null) {
+                    throw new ApplicationDefinitionException("Unable convertScalingDependentList Scaling dependent list to alias-based; " +
+                            "cannot find the matching alias for Group name " + groupName);
+                }
+
+                aliasBasedComponent = "group.".concat(aliasBasedComponent);
+
+            } else {
+                throw new ApplicationDefinitionException("Incorrect Scaling dependent list specified, " +
+                        "should start with 'cartridge.' or 'group.'");
+            }
+            aliasBasedComponents.add(aliasBasedComponent);
+        }
+
+        return new ScalingDependentList(aliasBasedComponents);
+    }
+
     private static String getAliasForGroupName (String groupName, GroupContext groupContext) {
 
         for (GroupContext groupCtxt : groupContext.getGroupContexts()) {


[3/4] stratos git commit: Parent scaling event handling logic improvements

Posted by la...@apache.org.
Parent scaling event handling logic improvements


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

Branch: refs/heads/4.1.0-test
Commit: a9cd18160612278b690b1c4c71905399a69fadd2
Parents: 0d31548
Author: Lahiru Sandaruwan <la...@apache.org>
Authored: Sun Dec 14 11:18:52 2014 +0530
Committer: Lahiru Sandaruwan <la...@apache.org>
Committed: Sun Dec 14 11:19:37 2014 +0530

----------------------------------------------------------------------
 .../monitor/component/GroupMonitor.java         | 36 +++++++++++++-------
 1 file changed, 24 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/a9cd1816/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
index 0928e93..92867e9 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/component/GroupMonitor.java
@@ -33,6 +33,7 @@ import org.apache.stratos.autoscaler.exception.application.DependencyBuilderExce
 import org.apache.stratos.autoscaler.exception.application.MonitorNotFoundException;
 import org.apache.stratos.autoscaler.exception.application.TopologyInConsistentException;
 import org.apache.stratos.autoscaler.monitor.Monitor;
+import org.apache.stratos.autoscaler.monitor.cluster.VMClusterMonitor;
 import org.apache.stratos.autoscaler.monitor.events.GroupStatusEvent;
 import org.apache.stratos.autoscaler.monitor.events.MonitorScalingEvent;
 import org.apache.stratos.autoscaler.monitor.events.MonitorStatusEvent;
@@ -42,10 +43,7 @@ import org.apache.stratos.autoscaler.pojo.policy.deployment.ChildPolicy;
 import org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network.ChildLevelNetworkPartition;
 import org.apache.stratos.autoscaler.pojo.policy.deployment.partition.network.ChildLevelPartition;
 import org.apache.stratos.autoscaler.util.ServiceReferenceHolder;
-import org.apache.stratos.messaging.domain.applications.Application;
-import org.apache.stratos.messaging.domain.applications.ApplicationStatus;
-import org.apache.stratos.messaging.domain.applications.Group;
-import org.apache.stratos.messaging.domain.applications.GroupStatus;
+import org.apache.stratos.messaging.domain.applications.*;
 import org.apache.stratos.messaging.domain.instance.GroupInstance;
 import org.apache.stratos.messaging.domain.instance.Instance;
 import org.apache.stratos.messaging.domain.topology.ClusterStatus;
@@ -269,14 +267,28 @@ public class GroupMonitor extends ParentComponentMonitor implements Runnable {
         //Notifying children, if this group has scaling dependencies
         if(scalingDependencies != null && !scalingDependencies.isEmpty()) {
         	// has dependencies. Notify children
-			if (aliasToActiveMonitorsMap != null
-			        && !aliasToActiveMonitorsMap.values().isEmpty()) {
-				for (String dependent : scalingDependencies) {
-					Monitor monitor = aliasToActiveMonitorsMap.get(dependent);
-					if (monitor instanceof GroupMonitor || monitor instanceof ApplicationMonitor) {
-	                    monitor.onParentScalingEvent(scalingEvent);
-	                }
-                }				
+			if (aliasToActiveMonitorsMap != null && !aliasToActiveMonitorsMap.values().isEmpty()) {
+
+				for (ScalingDependentList scalingDependentList : scalingDependencies) {
+
+                    for(String scalingDependentListComponent : scalingDependentList.getScalingDependentListComponents()){
+
+                        if(scalingDependentListComponent.equals(scalingEvent.getId())){
+
+                            for(String scalingDependentListComponentInSelectedList : scalingDependentList.getScalingDependentListComponents()){
+
+                                if(!scalingDependentListComponent.equals(scalingDependentListComponentInSelectedList)){
+
+                                    Monitor monitor = aliasToActiveMonitorsMap.get(scalingDependentListComponentInSelectedList);
+                                    if(monitor instanceof GroupMonitor || monitor instanceof VMClusterMonitor){
+                                        monitor.onParentScalingEvent(scalingEvent);
+                                    }
+                                }
+                            }
+                            break;
+                        }
+                    }
+                }
 			}
         }
     }


[2/4] stratos git commit: adding scalingDependents to Dependency Order class

Posted by la...@apache.org.
adding scalingDependents to Dependency Order class


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

Branch: refs/heads/4.1.0-test
Commit: c0aed455bc53d7c1e45efbf6325d5ad0d3b4be05
Parents: df2d6e6
Author: Lahiru Sandaruwan <la...@apache.org>
Authored: Sun Dec 14 11:11:08 2014 +0530
Committer: Lahiru Sandaruwan <la...@apache.org>
Committed: Sun Dec 14 11:19:36 2014 +0530

----------------------------------------------------------------------
 .../stratos/messaging/domain/applications/DependencyOrder.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/c0aed455/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/applications/DependencyOrder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/applications/DependencyOrder.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/applications/DependencyOrder.java
index 1225fe0..d212577 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/applications/DependencyOrder.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/applications/DependencyOrder.java
@@ -28,7 +28,7 @@ public class DependencyOrder implements Serializable {
 
 	private Set<StartupOrder> startupOrders;
 
-	private Set<String> scalingDependents;
+	private Set<ScalingDependentList> scalingDependents;
 
     private String terminationBehaviour;
 
@@ -52,11 +52,11 @@ public class DependencyOrder implements Serializable {
 		this.startupOrders = startupOrders;
 	}
 
-	public Set<String> getScalingDependents() {
+	public Set<ScalingDependentList> getScalingDependents() {
 		return scalingDependents;
 	}
 
-	public void setScalingDependents(Set<String> scalingDependents) {
+	public void setScalingDependents(Set<ScalingDependentList> scalingDependents) {
 		this.scalingDependents = scalingDependents;
 	}