stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject git commit: Removing cluster maintenance mode event listener in autoscaler
Date Thu, 30 Oct 2014 10:07:39 GMT
Repository: stratos
Updated Branches:
  refs/heads/docker-grouping-merge 1d817dbe8 -> 4a475b699


Removing cluster maintenance mode event listener in autoscaler


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

Branch: refs/heads/docker-grouping-merge
Commit: 4a475b699315b8e386b4fe900e707231d3dfeac3
Parents: 1d817db
Author: Imesh Gunaratne <imesh@apache.org>
Authored: Thu Oct 30 15:37:32 2014 +0530
Committer: Imesh Gunaratne <imesh@apache.org>
Committed: Thu Oct 30 15:37:32 2014 +0530

----------------------------------------------------------------------
 .../AutoscalerTopologyEventReceiver.java        | 27 --------------------
 1 file changed, 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/4a475b69/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java
index de058ec..e03ff52 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java
@@ -33,14 +33,12 @@ import org.apache.stratos.messaging.domain.topology.Cluster;
 import org.apache.stratos.messaging.domain.topology.Service;
 import org.apache.stratos.messaging.event.Event;
 import org.apache.stratos.messaging.event.topology.ClusterCreatedEvent;
-import org.apache.stratos.messaging.event.topology.ClusterMaintenanceModeEvent;
 import org.apache.stratos.messaging.event.topology.ClusterRemovedEvent;
 import org.apache.stratos.messaging.event.topology.MemberActivatedEvent;
 import org.apache.stratos.messaging.event.topology.MemberMaintenanceModeEvent;
 import org.apache.stratos.messaging.event.topology.MemberReadyToShutdownEvent;
 import org.apache.stratos.messaging.event.topology.MemberTerminatedEvent;
 import org.apache.stratos.messaging.listener.topology.ClusterCreatedEventListener;
-import org.apache.stratos.messaging.listener.topology.ClusterMaintenanceModeEventListener;
 import org.apache.stratos.messaging.listener.topology.ClusterRemovedEventListener;
 import org.apache.stratos.messaging.listener.topology.CompleteTopologyEventListener;
 import org.apache.stratos.messaging.listener.topology.MemberActivatedEventListener;
@@ -158,31 +156,6 @@ public class AutoscalerTopologyEventReceiver implements Runnable {
             }
         });
 
-        topologyEventReceiver.addEventListener(new ClusterMaintenanceModeEventListener()
{
-            @Override
-            protected void onEvent(Event event) {
-                try {
-                    log.info("Event received: " + event);
-                    ClusterMaintenanceModeEvent clusterMaintenanceModeEvent = (ClusterMaintenanceModeEvent)
event;
-                    TopologyManager.acquireReadLock();
-                    Service service = TopologyManager.getTopology().getService(clusterMaintenanceModeEvent.getServiceName());
-                    Cluster cluster = service.getCluster(clusterMaintenanceModeEvent.getClusterId());
-                    AbstractClusterMonitor monitor;
-                    monitor = AutoscalerContext.getInstance().getClusterMonitor(cluster.getClusterId());
-                    if (null == monitor) {
-                        log.error("cluster monitor not exists for the cluster: " + cluster.toString());
-                        return;
-                    }
-                    monitor.setStatus(clusterMaintenanceModeEvent.getStatus());
-                } catch (Exception e) {
-                    String msg = "Error processing event " + e.getLocalizedMessage();
-                    log.error(msg, e);
-                } finally {
-                    TopologyManager.releaseReadLock();
-                }
-            }
-        });
-
         topologyEventReceiver.addEventListener(new ClusterRemovedEventListener() {
             @Override
             protected void onEvent(Event event) {


Mime
View raw message