stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject stratos git commit: Fixing member termination logic in cluster monitor
Date Mon, 22 Dec 2014 11:48:24 GMT
Repository: stratos
Updated Branches:
  refs/heads/master af0f6edd8 -> 81ae4dc8a


Fixing member termination logic in cluster monitor


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

Branch: refs/heads/master
Commit: 81ae4dc8acb2427723cd190e9f22a19c0c3a8472
Parents: af0f6ed
Author: Imesh Gunaratne <imesh@apache.org>
Authored: Mon Dec 22 17:18:16 2014 +0530
Committer: Imesh Gunaratne <imesh@apache.org>
Committed: Mon Dec 22 17:18:16 2014 +0530

----------------------------------------------------------------------
 .../monitor/cluster/ClusterMonitor.java         | 23 +++++++++-----------
 1 file changed, 10 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/81ae4dc8/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 1ef3895..5659416 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
@@ -1060,35 +1060,32 @@ public class ClusterMonitor extends AbstractClusterMonitor {
                     // need to terminate active, pending and obsolete members
                     //FIXME to traverse concurrent
                     // active members
-                    List<String> activeMembers = new ArrayList<String>();
+                    List<String> activeMemberIdList = new ArrayList<String>();
                     Iterator<MemberContext> iterator = partitionContext.getActiveMembers().listIterator();
                     while (iterator.hasNext()) {
                         MemberContext activeMemberCtxt = iterator.next();
-                        activeMembers.add(activeMemberCtxt.getMemberId());
+                        activeMemberIdList.add(activeMemberCtxt.getMemberId());
 
                     }
-                    for (String memberId : activeMembers) {
+                    for (String memberId : activeMemberIdList) {
                         log.info("Sending instance cleanup event for the active member: [member-id]
" + memberId);
                         partitionContext.moveActiveMemberToTerminationPendingMembers(memberId);
-                        InstanceNotificationPublisher.getInstance().
-                                sendInstanceCleanupEventForMember(memberId);
+                        InstanceNotificationPublisher.getInstance().sendInstanceCleanupEventForMember(memberId);
                     }
-                    Iterator<MemberContext> pendingIterator = partitionContext.getPendingMembers().listIterator();
 
-                    List<String> pendingMembers = new ArrayList<String>();
+                    Iterator<MemberContext> pendingIterator = partitionContext.getPendingMembers().listIterator();
+                    List<String> pendingMemberIdList = new ArrayList<String>();
                     while (pendingIterator.hasNext()) {
                         MemberContext activeMemberCtxt = pendingIterator.next();
-                        pendingMembers.add(activeMemberCtxt.getMemberId());
+                        pendingMemberIdList.add(activeMemberCtxt.getMemberId());
 
                     }
-                    for (String memberId : pendingMembers) {
-                        MemberContext pendingMemberCtxt = pendingIterator.next();
+                    for (String memberId : pendingMemberIdList) {
                         // pending members
-                        String memeberId = pendingMemberCtxt.getMemberId();
                         if (log.isDebugEnabled()) {
-                            log.debug("Moving pending member [member id] " + memeberId +
" to obsolete list");
+                            log.debug("Moving pending member [member id] " + memberId + "
to obsolete list");
                         }
-                        partitionContext.movePendingMemberToObsoleteMembers(memeberId);
+                        partitionContext.movePendingMemberToObsoleteMembers(memberId);
                     }
                     if(partitionContext.getTotalMemberCount() == 0) {
                         allMovedToObsolete = allMovedToObsolete && true;


Mime
View raw message