brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nakomis <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Couchbase sync gateway
Date Fri, 11 Jul 2014 16:08:21 GMT
Github user Nakomis commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/25#discussion_r14828879
  
    --- Diff: software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseNodeSshDriver.java
---
    @@ -175,8 +201,83 @@ public void rebalance() {
                     .failOnNonZeroResultCode()
                     .execute();
             entity.setAttribute(CouchbaseNode.REBALANCE_STATUS, "Rebalance Started");
    +        // wait until the re-balance is complete
    +        Repeater.create()
    +            .every(Duration.millis(500))
    +            .limitTimeTo(Duration.THIRTY_SECONDS)
    +            .until(new Callable<Boolean>() {
    +                @Override
    +                public Boolean call() throws Exception {
    +                    for (String nodeHostName : CouchbaseNodeSshDriver.this.getNodeHostNames())
{
    +                        if (isNodeRebalancing(nodeHostName)) {
    +                            return true;
    +                        }
    +                    }
    +                    return false;
    +                }
    +            })
    +            .run();
    +        Repeater.create()
    --- End diff --
    
    The logic is reversed, so it until the node starts rebalancing, then waits for it to stop
rebalancing


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