stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject [43/50] [abbrv] git commit: fixing the logic which decides cluster inActive
Date Thu, 30 Oct 2014 04:14:07 GMT
fixing the logic which decides cluster inActive


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

Branch: refs/heads/docker-grouping-merge
Commit: b51b0b793961bd9b3784a996730225a05988bd8f
Parents: 3c43277
Author: reka <rthirunavukkarasu23@gmail.com>
Authored: Wed Oct 29 17:29:41 2014 +0530
Committer: reka <rthirunavukkarasu23@gmail.com>
Committed: Wed Oct 29 17:29:50 2014 +0530

----------------------------------------------------------------------
 .../health/AutoscalerHealthStatEventReceiver.java       |  3 ++-
 .../monitor/application/ApplicationMonitor.java         |  2 +-
 .../stratos/autoscaler/monitor/group/GroupMonitor.java  |  2 +-
 .../autoscaler/status/checker/StatusChecker.java        | 12 ++++++------
 4 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/b51b0b79/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/health/AutoscalerHealthStatEventReceiver.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/health/AutoscalerHealthStatEventReceiver.java
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/health/AutoscalerHealthStatEventReceiver.java
index cf072f3..f192cee 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/health/AutoscalerHealthStatEventReceiver.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/health/AutoscalerHealthStatEventReceiver.java
@@ -656,8 +656,9 @@ public class AutoscalerHealthStatEventReceiver implements Runnable {
                 }
                 return;
             }
+
             //Check the clusterStatus as part of the member fault event
-            StatusChecker.getInstance().onMemberFaultEvent(clusterId, partitionCtxt);
+            StatusChecker.getInstance().onMemberFaultEvent(clusterId, partitionId);
 
             // terminate the faulty member
             CloudControllerClient ccClient = CloudControllerClient.getInstance();

http://git-wip-us.apache.org/repos/asf/stratos/blob/b51b0b79/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/application/ApplicationMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/application/ApplicationMonitor.java
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/application/ApplicationMonitor.java
index 1ec7399..2bf85a6 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/application/ApplicationMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/application/ApplicationMonitor.java
@@ -170,7 +170,7 @@ public class ApplicationMonitor extends ParentComponentMonitor {
         } else if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated)
{
             //Check whether all dependent goes Terminated and then start them in parallel.
             this.aliasToInActiveMonitorsMap.remove(id);
-            if (this.status != ApplicationStatus.Terminating) {
+            if (this.status != ApplicationStatus.Terminating || this.status != ApplicationStatus.Terminated)
{
                 onChildTerminatedEvent(id);
             } else {
                 StatusChecker.getInstance().onChildStatusChange(id, this.id, this.appId);

http://git-wip-us.apache.org/repos/asf/stratos/blob/b51b0b79/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/group/GroupMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/group/GroupMonitor.java
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/group/GroupMonitor.java
index 9b9695a..55f3b4e 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/group/GroupMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/group/GroupMonitor.java
@@ -81,7 +81,7 @@ public class GroupMonitor extends ParentComponentMonitor implements EventHandler
         } else if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated)
{
             //Check whether all dependent goes Terminated and then start them in parallel.
             this.aliasToInActiveMonitorsMap.remove(id);
-            if (this.status != GroupStatus.Terminating) {
+            if (this.status != GroupStatus.Terminating || this.status != GroupStatus.Terminated)
{
                 onChildTerminatedEvent(id);
             } else {
                 StatusChecker.getInstance().onChildStatusChange(id, this.id, this.appId);

http://git-wip-us.apache.org/repos/asf/stratos/blob/b51b0b79/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/checker/StatusChecker.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/checker/StatusChecker.java
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/checker/StatusChecker.java
index d2d8b44..3a925d1 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/checker/StatusChecker.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/checker/StatusChecker.java
@@ -156,13 +156,13 @@ public class StatusChecker {
 
     /**
      * @param clusterId
-     * @param partitionContext is to decide in which partition has less members while others
have active members
+     * @param partitionId is to decide in which partition has less members while others have
active members
      */
-    public void onMemberFaultEvent(final String clusterId, final PartitionContext partitionContext)
{
+    public void onMemberFaultEvent(final String clusterId, final String partitionId) {
         Runnable group = new Runnable() {
             public void run() {
                 ClusterMonitor monitor = (ClusterMonitor) AutoscalerContext.getInstance().getMonitor(clusterId);
-                boolean clusterInActive = getClusterInActive(monitor, partitionContext);
+                boolean clusterInActive = getClusterInActive(monitor, partitionId);
                 String appId = monitor.getAppId();
                 if (clusterInActive) {
                     //if the monitor is dependent, temporarily pausing it
@@ -185,12 +185,12 @@ public class StatusChecker {
         groupThread.start();
     }
 
-    private boolean getClusterInActive(AbstractClusterMonitor monitor, PartitionContext partitionContext)
{
+    private boolean getClusterInActive(AbstractClusterMonitor monitor, String  partitionId)
{
         boolean clusterInActive = false;
         for (NetworkPartitionContext networkPartitionContext : monitor.getNetworkPartitionCtxts().values())
{
             for (PartitionContext partition : networkPartitionContext.getPartitionCtxts().values())
{
-                if (partitionContext.getPartitionId().equals(partition.getPartitionId())
&&
-                        partition.getActiveMemberCount() < partition.getMinimumMemberCount())
{
+                if (partitionId.equals(partition.getPartitionId()) &&
+                        partition.getActiveMemberCount() <= partition.getMinimumMemberCount())
{
                     clusterInActive = true;
                     return clusterInActive;
                 }


Mime
View raw message