Repository: stratos Updated Branches: refs/heads/master 1b9488cb5 -> b2cd07dcf
Improve comments and set obsoleteness of partition before it starts to terminate instances Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/0f4ea4a1 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/0f4ea4a1 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/0f4ea4a1 Branch: refs/heads/master Commit: 0f4ea4a12d2f23bacc4a526917494d6e7dff2554 Parents: 1b9488c Author: Lahiru Sandaruwan <[email protected]> Authored: Fri Apr 24 22:33:02 2015 +0530 Committer: Lahiru Sandaruwan <[email protected]> Committed: Fri Apr 24 22:33:02 2015 +0530 ---------------------------------------------------------------------- .../autoscaler/services/impl/AutoscalerServiceImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/0f4ea4a1/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java index a21be3f..acda7b4 100644 --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java @@ -966,6 +966,7 @@ public class AutoscalerServiceImpl implements AutoscalerService { for (ClusterMonitor clusterMonitor : AutoscalerContext.getInstance().getClusterMonitors().values()) { + //Following if statement checks the relevant clusters for the updated deployment policy if (deploymentPolicy.getDeploymentPolicyID().equals(clusterMonitor.getDeploymentPolicyId())) { for (NetworkPartition networkPartition : deploymentPolicy.getNetworkPartitions()) { @@ -1011,7 +1012,8 @@ public class AutoscalerServiceImpl implements AutoscalerService { if (null == networkPartition.getPartition(clusterLevelPartitionContext.getPartitionId())) { - //We have found that this partition context which is in cluster monitor is removed in updated policy + //It has found that this partition context which is in cluster monitor is removed in updated policy + clusterLevelPartitionContext.setIsObsoletePartition(true); while (clusterLevelPartitionContext.getActiveMembers().size() != 0) { @@ -1024,7 +1026,6 @@ public class AutoscalerServiceImpl implements AutoscalerService { MemberContext member = clusterLevelPartitionContext.getPendingMembers().get(0); clusterLevelPartitionContext.movePendingMemberToObsoleteMembers(member.getMemberId()); } - clusterLevelPartitionContext.setIsObsoletePartition(true); } } } @@ -1039,13 +1040,13 @@ public class AutoscalerServiceImpl implements AutoscalerService { boolean validationOfNetworkPartitionRequired = false; for (Partition partition : networkPartition.getPartitions()) { - //Iterating through active instances + //Iterating through instances for (InstanceContext instanceContext : clusterLevelNetworkPartitionContext.getInstanceIdToInstanceContextMap().values()) { ClusterInstanceContext clusterInstanceContext = (ClusterInstanceContext) instanceContext; if (null == clusterInstanceContext.getPartitionCtxt(partition.getId())) { - //We have found that this partition which is in deployment policy/network partition is new + //It has found that this partition which is in deployment policy/network partition is new ClusterLevelPartitionContext clusterLevelPartitionContext = new ClusterLevelPartitionContext( partition, networkPartition.getId(), deploymentPolicyID); validationOfNetworkPartitionRequired = true;
