brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahgittin <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: GUI+REST improvements - yaml spec...
Date Tue, 09 Sep 2014 16:23:23 GMT
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/156#discussion_r17311571
  
    --- Diff: core/src/main/java/brooklyn/entity/basic/ServiceStateLogic.java ---
    @@ -434,27 +434,31 @@ protected Object computeServiceNotUp() {
     
             protected Object computeServiceProblems() {
                 Map<Entity, Lifecycle> values = getValues(SERVICE_STATE_ACTUAL);
    -            int numRunning=0, numNotHealthy=0;
    +            int numRunning=0;
    +            List<Entity> onesNotHealthy=MutableList.of();
                 Set<Lifecycle> ignoreStates = getConfig(IGNORE_ENTITIES_WITH_THESE_SERVICE_STATES);
    -            for (Lifecycle state: values.values()) {
    -                if (state==Lifecycle.RUNNING) numRunning++;
    -                else if (!ignoreStates.contains(state)) numNotHealthy++;
    +            for (Map.Entry<Entity,Lifecycle> state: values.entrySet()) {
    +                if (state.getValue()==Lifecycle.RUNNING) numRunning++;
    +                else if (!ignoreStates.contains(state.getValue())) 
    +                    onesNotHealthy.add(state.getKey());
                 }
     
                 QuorumCheck qc = getConfig(RUNNING_QUORUM_CHECK);
                 if (qc!=null) {
    -                if (qc.isQuorate(numRunning, numNotHealthy+numRunning))
    +                if (qc.isQuorate(numRunning, onesNotHealthy.size()+numRunning))
                         // quorate
                         return null;
     
    -                if (numNotHealthy==0)
    +                if (onesNotHealthy.size()==0)
                         return "Not enough entities running to be quorate";
                 } else {
    -                if (numNotHealthy==0)
    +                if (onesNotHealthy.size()==0)
    --- End diff --
    
    +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message