brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: add support for configuring couch...
Date Tue, 07 Oct 2014 09:18:04 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/221#discussion_r18508212
  
    --- Diff: software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseNodeImpl.java
---
    @@ -232,6 +243,37 @@ public void disconnectSensors() {
     
         @Override
         public void bucketCreate(String bucketName, String bucketType, Integer bucketPort,
Integer bucketRamSize, Integer bucketReplica) {
    +        if (Strings.isBlank(bucketType)) bucketType = "couchbase";
    +        if (bucketRamSize==null || bucketRamSize<=0) bucketRamSize = 200;
    +        if (bucketReplica==null || bucketReplica<0) bucketReplica = 1;
    +        
             getDriver().bucketCreate(bucketName, bucketType, bucketPort, bucketRamSize, bucketReplica);
         }
    +    
    +    /** exposed through {@link CouchbaseNode#ADD_REPLICATION_RULE} */
    +    protected void addReplicationRule(ConfigBag ruleArgs) {
    +        Entity fromCluster = (Entity) ruleArgs.getStringKey("fromCluster");
    +        Entity toCluster = (Entity) ruleArgs.getStringKey("toCluster");
    +        if (fromCluster==null && toCluster==null)
    +            throw new IllegalArgumentException("At least one of 'fromCluster' or 'toCluster'
must be supplied");
    +        if (fromCluster==null) fromCluster = this;
    +        if (toCluster==null) toCluster = this;
    +        
    +        String fromBucket = (String)ruleArgs.getStringKey("fromBucket");
    +        String toBucket = (String)ruleArgs.getStringKey("toBucket");
    +        if (fromBucket==null && toBucket==null)
    +            throw new IllegalArgumentException("At least one of 'fromBucket' or 'toBucket'
must be supplied");
    +        if (fromBucket==null) fromBucket = toBucket;
    +        if (toBucket==null) toBucket = fromBucket;
    +        
    +//        String replType = (String)ruleArgs.getStringKey("replicationType");
    --- End diff --
    
    Needs a comment to say why this is commented out, and under what circumstances the code
would be useful.


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