stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject [41/50] [abbrv] git commit: implementing onParentEvent method in ClusterMonitor
Date Thu, 30 Oct 2014 04:14:05 GMT
implementing onParentEvent method in ClusterMonitor


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

Branch: refs/heads/docker-grouping-merge
Commit: e2994c4ff22053162922fb9cba0415b55fb5b04d
Parents: caa6f1b
Author: Isuru Haththotuwa <isuruh@apache.org>
Authored: Wed Oct 29 16:23:22 2014 +0530
Committer: Isuru Haththotuwa <isuruh@apache.org>
Committed: Wed Oct 29 16:23:22 2014 +0530

----------------------------------------------------------------------
 .../stratos/autoscaler/monitor/cluster/ClusterMonitor.java  | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/e2994c4f/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
index b9f6cbf..6d7e8ca 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/cluster/ClusterMonitor.java
@@ -25,6 +25,7 @@ import org.apache.stratos.autoscaler.PartitionContext;
 import org.apache.stratos.autoscaler.client.cloud.controller.CloudControllerClient;
 import org.apache.stratos.autoscaler.deployment.policy.DeploymentPolicy;
 import org.apache.stratos.autoscaler.exception.TerminationException;
+import org.apache.stratos.autoscaler.grouping.topic.StatusEventPublisher;
 import org.apache.stratos.autoscaler.monitor.AbstractClusterMonitor;
 import org.apache.stratos.autoscaler.monitor.events.MonitorStatusEvent;
 import org.apache.stratos.autoscaler.policy.model.AutoscalePolicy;
@@ -32,7 +33,9 @@ import org.apache.stratos.autoscaler.rule.AutoscalerRuleEvaluator;
 import org.apache.stratos.cloud.controller.stub.pojo.MemberContext;
 import org.apache.stratos.cloud.controller.stub.pojo.Properties;
 import org.apache.stratos.cloud.controller.stub.pojo.Property;
+import org.apache.stratos.messaging.domain.topology.ApplicationStatus;
 import org.apache.stratos.messaging.domain.topology.ClusterStatus;
+import org.apache.stratos.messaging.domain.topology.GroupStatus;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -281,6 +284,10 @@ public class ClusterMonitor extends AbstractClusterMonitor {
 
     @Override
     public void onParentEvent(MonitorStatusEvent statusEvent) {
-        // doesn't have to do anything since this is not a Parent Monitor
+        // send the ClusterTerminating event
+        if (statusEvent.getStatus() == GroupStatus.Terminating || statusEvent.getStatus()
==
+                ApplicationStatus.Terminating) {
+            StatusEventPublisher.sendClusterTerminatingEvent(appId, serviceId, clusterId);
+        }
     }
 }


Mime
View raw message