brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [01/11] git commit: Added refactoring comments
Date Wed, 03 Sep 2014 16:15:28 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 5b1441584 -> 6f501d5ae


Added refactoring comments


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/1a51e230
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/1a51e230
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/1a51e230

Branch: refs/heads/master
Commit: 1a51e230e905752b23099613e021f6437117f4fd
Parents: 03e0989
Author: Martin Harris <github@nakomis.com>
Authored: Tue Jul 1 12:12:54 2014 +0100
Committer: Martin Harris <github@nakomis.com>
Committed: Mon Sep 1 17:34:03 2014 +0100

----------------------------------------------------------------------
 .../nosql/couchbase/CouchbaseClusterImpl.java   | 28 ++++++++++++++++++++
 1 file changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/1a51e230/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
b/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
index b47f133..c01342d 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
@@ -57,6 +57,34 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 
 public class CouchbaseClusterImpl extends DynamicClusterImpl implements CouchbaseCluster
{
+    
+    /*
+     * Refactoring required:
+     * 
+     * Currently, on start() the cluster waits for an arbitrary SERVICE_UP_TIME_OUT (3 minutes)
before assuming that a quorate 
+     * number of servers are available. The servers are then added to the cluster, and a
further wait period of  
+     * DELAY_BEFORE_ADVERTISING_CLUSTER (30 seconds) is used before advertising the cluster
+     * 
+     * DELAY_BEFORE_ADVERTISING_CLUSTER: It should be possible to refactor this away by adding
a repeater that will poll
+     * the REST API of the primary node (once established) until the API indicates that the
cluster is available
+     * 
+     * SERVICE_UP_TIME_OUT: The refactoring of this would be more substantial. One method
would be to remove the bulk of the 
+     * logic from the start() method, and rely entirely on the membership tracking policy
and the onServerPoolMemberChanged()
+     * method. The addition of a RUNNING sensor on the nodes would allow the cluster to determine
that a node is up and
+     * running but has not yet been added to the cluster. The IS_CLUSTER_INITIALIZED key
could be used to determine whether
+     * or not the cluster should be initialized, or a node simply added to an existing cluster.
A repeater could be used
+     * in the driver's to ensure that the method does not return until the node has been
fully added
+     * 
+     * There is an (incomplete) first-pass at this here: https://github.com/Nakomis/incubator-brooklyn/compare/couchbase-running-sensor
+     * however, there have been significant changes to the cluster initialization since that
work was done so it will probably
+     * need to be re-done
+     * 
+     * Additionally, during bucket creation, a HttpPoll is used to check that the bucket
has been created. This should be 
+     * refactored to use a Repeater in CouchbaseNodeSshDriver.bucketCreate() in a similar
way to the one employed in
+     * CouchbaseNodeSshDriver.rebalance(). Were this done, this class could simply queue
the bucket creation tasks
+     * 
+     */
+    
     private static final Logger log = LoggerFactory.getLogger(CouchbaseClusterImpl.class);
     private final Object mutex = new Object[0];
 


Mime
View raw message