brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjcorbett <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Add all.members.up sensor to Dyna...
Date Fri, 20 Nov 2015 10:35:19 GMT
Github user sjcorbett commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1050#discussion_r45455255
  
    --- Diff: core/src/main/java/org/apache/brooklyn/entity/group/DynamicClusterImpl.java
---
    @@ -181,6 +189,34 @@ private void initialiseMemberId() {
             }
         }
     
    +    private void connectAllMembersUp() {
    +        allMembersUp = FunctionFeed.builder()
    +                .entity(this)
    +                .period(Duration.FIVE_SECONDS)
    +                .poll(new FunctionPollConfig<Boolean, Boolean>(ALL_MEMBERS_UP)
    +                        .onException(Functions.constant(Boolean.FALSE))
    +                        .callable(new AllMembersUpCallable()))
    +                .build();
    +    }
    +
    +    private class AllMembersUpCallable implements Callable<Boolean> {
    +
    +        @Override
    +        public Boolean call() throws Exception {
    +            if (DynamicClusterImpl.this.getMembers().isEmpty())
    +                return false;
    --- End diff --
    
    Wouldn't no members mean that all the members are up?


---
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