brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [12/50] brooklyn-library git commit: Update WideAreaCassandraCluster.java
Date Mon, 01 Feb 2016 17:46:42 GMT
Update WideAreaCassandraCluster.java

Add initialSize as catalog options.


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/3db36f17
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/3db36f17
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/3db36f17

Branch: refs/heads/0.6.0
Commit: 3db36f1716834542e9ce8e01278e73b373fb0dde
Parents: 569dcc5
Author: David Toy <d@vidtoy.co.uk>
Authored: Fri Nov 1 10:33:41 2013 +0000
Committer: David Toy <d@vidtoy.co.uk>
Committed: Fri Nov 1 10:33:41 2013 +0000

----------------------------------------------------------------------
 .../java/brooklyn/demo/WideAreaCassandraCluster.java | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/3db36f17/examples/simple-nosql-cluster/src/main/java/brooklyn/demo/WideAreaCassandraCluster.java
----------------------------------------------------------------------
diff --git a/examples/simple-nosql-cluster/src/main/java/brooklyn/demo/WideAreaCassandraCluster.java
b/examples/simple-nosql-cluster/src/main/java/brooklyn/demo/WideAreaCassandraCluster.java
index b27a0ea..02a9451 100644
--- a/examples/simple-nosql-cluster/src/main/java/brooklyn/demo/WideAreaCassandraCluster.java
+++ b/examples/simple-nosql-cluster/src/main/java/brooklyn/demo/WideAreaCassandraCluster.java
@@ -18,6 +18,10 @@ package brooklyn.demo;
 import java.util.Arrays;
 import java.util.List;
 
+import brooklyn.catalog.Catalog;
+import brooklyn.catalog.CatalogConfig;
+import brooklyn.config.ConfigKey;
+import brooklyn.entity.basic.ConfigKeys;
 import brooklyn.entity.basic.AbstractApplication;
 import brooklyn.entity.basic.Entities;
 import brooklyn.entity.basic.StartableApplication;
@@ -34,15 +38,22 @@ import brooklyn.util.CommandLineUtil;
 
 import com.google.common.collect.Lists;
 
+@Catalog(name="Wide Area Cassandra Cluster Application", description="Deploy a Cassandra
cluster across multiple geographies.")
 public class WideAreaCassandraCluster extends AbstractApplication {
 
     public static final String DEFAULT_LOCATION_SPEC = "aws-ec2:us-east-1,rackspace-cloudservers-uk";
-
+	
+	@CatalogConfig(label="Initial Cluster Size (per location)", priority=2)
+    public static final ConfigKey<Integer> CASSANDRA_CLUSTER_SIZE = ConfigKeys.newConfigKey(
+        "cassandra.cluster.initialSize", "Initial size of the Cassandra clusterss", 2); 
    
+    
+    
+	
     @Override
     public void init() {
         addChild(EntitySpec.create(CassandraFabric.class)
                 .configure(CassandraCluster.CLUSTER_NAME, "Brooklyn")
-                .configure(CassandraCluster.INITIAL_SIZE, 2) // per location
+                .configure(CassandraCluster.INITIAL_SIZE, getConfig(CASSANDRA_CLUSTER_SIZE))
// per location
                 .configure(CassandraCluster.ENDPOINT_SNITCH_NAME, "brooklyn.entity.nosql.cassandra.customsnitch.MultiCloudSnitch")
                 .configure(CassandraNode.CUSTOM_SNITCH_JAR_URL, "classpath://brooklyn/entity/nosql/cassandra/cassandra-multicloud-snitch.jar")
                 .configure(CassandraFabric.MEMBER_SPEC, EntitySpec.create(CassandraCluster.class)


Mime
View raw message