Repository: stratos Updated Branches: refs/heads/master 012aaac36 -> 1b68926b1
fixing termination behaviour issue and commenting scaling Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/1b68926b Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/1b68926b Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/1b68926b Branch: refs/heads/master Commit: 1b68926b1e765a6a00b4f976f49d25b63058649d Parents: 012aaac Author: reka <[email protected]> Authored: Mon Dec 8 19:06:02 2014 +0530 Committer: reka <[email protected]> Committed: Mon Dec 8 19:06:34 2014 +0530 ---------------------------------------------------------------------- .../autoscaler/monitor/cluster/VMClusterMonitor.java | 4 ++-- .../monitor/component/ParentComponentMonitor.java | 15 +++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/1b68926b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/VMClusterMonitor.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/VMClusterMonitor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/VMClusterMonitor.java index 229dd7f..ef8491a 100644 --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/VMClusterMonitor.java +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/VMClusterMonitor.java @@ -247,7 +247,7 @@ public class VMClusterMonitor extends AbstractClusterMonitor { if (rifReset || memoryConsumptionReset || loadAverageReset) { - VMClusterContext vmClusterContext = (VMClusterContext) clusterContext; + /*VMClusterContext vmClusterContext = (VMClusterContext) clusterContext; getScaleCheckKnowledgeSession().setGlobal("clusterId", getClusterId()); getScaleCheckKnowledgeSession().setGlobal("autoscalePolicy", @@ -273,7 +273,7 @@ public class VMClusterMonitor extends AbstractClusterMonitor { instanceContext.setRifReset(false); instanceContext.setMemoryConsumptionReset(false); - instanceContext.setLoadAverageReset(false); + instanceContext.setLoadAverageReset(false);*/ } else if (log.isDebugEnabled()) { log.debug(String.format("Scale rule will not run since the LB statistics have not " + "received before this cycle for [cluster instance context] %s ", http://git-wip-us.apache.org/repos/asf/stratos/blob/1b68926b/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 217d0db..51a98de 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 @@ -165,12 +165,19 @@ public abstract class ParentComponentMonitor extends Monitor { * by traversing to find the terminated dependencies. * it will get invoked when start a child monitor on termination of a sub tree */ - public void startDependencyOnTermination() throws TopologyInConsistentException { + public void startDependencyOnTermination(String parentInstanceId) throws TopologyInConsistentException { //start the first dependency which went to terminated List<ApplicationChildContext> applicationContexts = this.startupDependencyTree. getStarAbleDependenciesByTermination(); - //FIXME to create new instanceIds - //startDependency(applicationContexts, null); + for(ApplicationChildContext context : applicationContexts) { + if(context instanceof GroupChildContext) { + GroupMonitor groupMonitor = (GroupMonitor) this.aliasToActiveMonitorsMap. + get(context.getId()); + groupMonitor. + } else if(context instanceof ClusterChildContext) { + + } + } } @@ -383,7 +390,7 @@ public abstract class ParentComponentMonitor extends Monitor { (parentContexts.isEmpty() || parentsTerminated || allParentsActive)) { //Find the non existent monitor by traversing dependency tree try { - this.startDependencyOnTermination(); + this.startDependencyOnTermination(parentInstanceId); } catch (TopologyInConsistentException e) { //TODO revert the siblings and notify parent, change a flag for reverting/un-subscription log.error("Error while starting the monitor upon termination" + e);
