You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ud...@apache.org on 2014/12/12 11:11:22 UTC
[20/50] stratos git commit: fixing a build failure due to partial
commit
fixing a build failure due to partial commit
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/590a4f6d
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/590a4f6d
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/590a4f6d
Branch: refs/heads/master
Commit: 590a4f6dbea74f8fd4074d655b1c522f83fe61a2
Parents: 359d323
Author: reka <rt...@gmail.com>
Authored: Mon Dec 8 19:20:25 2014 +0530
Committer: reka <rt...@gmail.com>
Committed: Thu Dec 11 19:20:13 2014 +0530
----------------------------------------------------------------------
.../component/ParentComponentMonitor.java | 25 ++++++++++++++++----
1 file changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/590a4f6d/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 f2f345a..6156015 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
@@ -104,7 +104,7 @@ public abstract class ParentComponentMonitor extends Monitor {
MonitorNotFoundException {
//start the first dependency
List<ApplicationChildContext> applicationContexts = this.startupDependencyTree.
- getStarAbleDependencies();
+ getStartAbleDependencies();
startDependency(applicationContexts, instanceId);
}
@@ -128,7 +128,7 @@ public abstract class ParentComponentMonitor extends Monitor {
public void startDependency(ParentComponent component) {
//start the first dependency
List<ApplicationChildContext> applicationContexts = this.startupDependencyTree.
- getStarAbleDependencies();
+ getStartAbleDependencies();
Collection<Instance> contexts = component.getInstanceIdToInstanceContextMap().values();
//traversing through all the Instance context and start them
List<String> instanceIds = new ArrayList<String>();
@@ -164,10 +164,13 @@ 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 instanceId) throws TopologyInConsistentException,
+ MonitorNotFoundException, PolicyValidationException, PartitionValidationException {
+
//start the first dependency which went to terminated
List<ApplicationChildContext> applicationContexts = this.startupDependencyTree.
- getStarAbleDependenciesByTermination();
+ getStarAbleDependenciesByTermination(this, instanceId);
for(ApplicationChildContext context : applicationContexts) {
if(context instanceof GroupChildContext) {
GroupMonitor groupMonitor = (GroupMonitor) this.aliasToActiveMonitorsMap.
@@ -382,7 +385,15 @@ public abstract class ParentComponentMonitor extends Monitor {
(parentContexts.isEmpty() || parentsTerminated || allParentsActive)) {
//Find the non existent monitor by traversing dependency tree
try {
- this.startDependencyOnTermination();
+ try {
+ this.startDependencyOnTermination(instanceId);
+ } catch (MonitorNotFoundException e) {
+ e.printStackTrace();
+ } catch (PolicyValidationException e) {
+ e.printStackTrace();
+ } catch (PartitionValidationException e) {
+ e.printStackTrace();
+ }
} 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);
@@ -574,6 +585,10 @@ public abstract class ParentComponentMonitor extends Monitor {
return hasMonitor;
}
+ public Monitor getMonitor(String childId) {
+ return this.aliasToActiveMonitorsMap.get(childId);
+ }
+
public boolean hasMonitors() {
return this.aliasToActiveMonitorsMap != null;