brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grkvlt <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Couchbase changes for Clocker
Date Tue, 11 Nov 2014 22:59:24 GMT
Github user grkvlt commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/317#discussion_r20188557
  
    --- Diff: software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseNodeSshDriver.java
---
    @@ -319,68 +314,68 @@ private String getPassword() {
         }
     
         private String getWebPort() {
    -        return ""+entity.getAttribute(CouchbaseNode.COUCHBASE_WEB_ADMIN_PORT);
    +        return "" + entity.getAttribute(CouchbaseNode.COUCHBASE_WEB_ADMIN_PORT);
         }
     
         private String getCouchbaseHostnameAndCredentials() {
    -        return format("-c localhost:%s -u %s -p %s", getWebPort(), getUsername(), getPassword());
    +        return format("-c %s:%s -u %s -p %s", getSubnetHostname(), getWebPort(), getUsername(),
getPassword());
         }
     
         private String getCouchbaseHostnameAndPort() {
    -        return format("-c localhost:%s", getWebPort());
    +        return format("-c %s:%s", getSubnetHostname(), getWebPort());
         }
     
         private String getClusterInitRamSize() {
             return entity.getConfig(CouchbaseNode.COUCHBASE_CLUSTER_INIT_RAM_SIZE).toString();
         }
    -        
    +
         @Override
         public void rebalance() {
             entity.setAttribute(CouchbaseNode.REBALANCE_STATUS, "explicitly started");
             newScript("rebalance")
                     .body.append(
    -                couchbaseCli("rebalance") +
    -                        getCouchbaseHostnameAndCredentials())
    +                couchbaseCli("rebalance") + getCouchbaseHostnameAndCredentials())
                     .failOnNonZeroResultCode()
                     .execute();
    -        
    +
             // wait until the re-balance is started
             // (if it's quick, this might miss it, but it will only block for 30s if so)
             Repeater.create()
    -            .backoff(Duration.millis(10), 2, Duration.millis(500))
    -            .limitTimeTo(Duration.THIRTY_SECONDS)
    -            .until(new Callable<Boolean>() {
    -                @Override
    -                public Boolean call() throws Exception {
    -                    for (String nodeHostAndPort : CouchbaseNodeSshDriver.this.getNodesHostAndPort())
{
    -                        if (isNodeRebalancing(nodeHostAndPort)) {
    -                            return true;
    -                        }
    -                    }
    -                    return false;
    -                }
    -            })
    -            .run();
    -        
    +                .backoff(Duration.millis(10), 2, Duration.millis(500))
    +                .limitTimeTo(Duration.THIRTY_SECONDS)
    +                .until(new Callable<Boolean>() {
    +                           @Override
    +                           public Boolean call() throws Exception {
    +                               for (HostAndPort nodeHostAndPort : getNodesHostAndPort())
{
    +                                   if (isNodeRebalancing(nodeHostAndPort.toString()))
{
    +                                       return true;
    +                                   }
    +                               }
    +                               return false;
    +                           }
    +                       }
    +                ).run();
    +
             entity.setAttribute(CouchbaseNode.REBALANCE_STATUS, "waiting for completion");
             // NB: a sensor feed will also update this
    -        
    +
             // then wait until the re-balance is complete
             boolean completed = Repeater.create()
    --- End diff --
    
    Wrap these both is tasks, and execute sequentially, so they show in activity pane. See
`DockerHost test for SSHable after reboot for example, in Clocker.


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