Repository: stratos
Updated Branches:
  refs/heads/4.0.0-grouping 67e868eb6 -> 991d7856d


fixing kill-all (multiple groups with same cartridge type), adding check for 
cartridge_type and group when determining active cluster state


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

Branch: refs/heads/4.0.0-grouping
Commit: 991d7856dd96fcb1d530a9fd447fea7d45f2c7fc
Parents: 67e868e
Author: Martin Eppel <[email protected]>
Authored: Thu Jun 26 17:44:44 2014 -0700
Committer: Martin Eppel <[email protected]>
Committed: Thu Jun 26 17:44:44 2014 -0700

----------------------------------------------------------------------
 .../autoscaler/ComplexApplicationContext.java      | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/991d7856/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/ComplexApplicationContext.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/ComplexApplicationContext.java
 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/ComplexApplicationContext.java
index 98c4d2c..07cb48f 100644
--- 
a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/ComplexApplicationContext.java
+++ 
b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/ComplexApplicationContext.java
@@ -298,13 +298,12 @@ public class ComplexApplicationContext {
                        StringBuffer buf = new StringBuffer();
                        buf.append("downstreamdependencies list: [ ");
                        
-                       if (downstreamDependencies != null & 
downstreamDependencies.keySet().size() > 0) {
+                       if (downstreamDependencies != null && 
downstreamDependencies.keySet().size() > 0) {
                                Set<String> downstream_keys = 
downstreamDependencies.keySet();
                                for (String c : downstream_keys) {
                                        String d = 
downstreamDependencies.get(c);
-                                       buf.append(c + ", in group:  
").append(d);
+                                       buf.append(c + ", in group:  
").append(d).append(" ");
                                }
-                               
                                buf.append("] ").append(" serviceId 
").append(aServiceId);
                        } else {
                                buf.append(" downstreamDependencies is null ");
@@ -324,11 +323,11 @@ public class ComplexApplicationContext {
                        StringBuffer buf = new StringBuffer();
                        buf.append("upstreamdependencies list: [ ");
                        
-                       if (upstreamDependencies != null & 
upstreamDependencies.keySet().size() > 0) {
+                       if (upstreamDependencies != null && 
upstreamDependencies.keySet().size() > 0) {
                                Set<String> upstream_keys = 
upstreamDependencies.keySet();
                                for (String c : upstream_keys) {
                                        String d = upstreamDependencies.get(c);
-                                       buf.append(c + ", in group:  
").append(upstreamDependencies.get(d));
+                                       buf.append(c + ", in group:  
").append(upstreamDependencies.get(d)).append(" ");
                                }
                                
                                buf.append("] ").append(" serviceId 
").append(aServiceId);
@@ -685,10 +684,10 @@ public class ComplexApplicationContext {
                                                                
log.debug("checking (inactive) cluster state for  " + cluster.getClusterId() + 
" (in group " + clusterGroup + ")" +
                                                                                
" and serviceType " + serviceType + " (in group " + serviceTypeGroup + ")");
                                                        }
-                                                       // Martin TODO if 
(hasClusterActiveMember (cluster)) {
+                                                       // TODO if 
(hasClusterActiveMember (cluster)) {
                                                        // check group cluster 
is in 
                                                        
-                                                       if (clusterGroup != 
null & clusterGroup.equals(serviceTypeGroup)) {
+                                                       if (clusterGroup != 
null && clusterGroup.equals(serviceTypeGroup)) {
                                                                if 
(hasClusterActiveMember (cluster)) { 
                                                                        
hasClusterWithActiveMember = true;
                                                                        if 
(log.isDebugEnabled()) {
@@ -782,8 +781,8 @@ public class ComplexApplicationContext {
                                                                
log.debug("checking (active) cluster state for  " + cluster.getClusterId() + " 
(in group " + clusterGroup + ")" +
                                                                                
" and serviceType " + serviceType + " (in group " + serviceTypeGroup + ")");
                                                        }
-                                                       // Martin TODO if 
(hasClusterActiveMember (cluster)) {
-                                                       if 
(hasClusterActiveMember (cluster)) { // Martin for test only, replace with 
hasClusterActiveMember !!!
+                                                       
+                                                       if (clusterGroup != 
null && clusterGroup.equals(serviceTypeGroup) && hasClusterActiveMember 
(cluster)) {
                                                                
hasClusterWithActiveMember = true;
                                                                if 
(log.isDebugEnabled()) {
                                                                        
log.debug("found active cluster for service " + cluster.getClusterId() + " in 
group " + serviceTypeGroup +

Reply via email to