You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2016/02/01 18:46:38 UTC

[08/50] brooklyn-library git commit: Add catalog configuration for initial size in CumulusRDFApplication

Add catalog configuration for initial size in CumulusRDFApplication


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

Branch: refs/heads/0.6.0
Commit: 37d02f225a395433fe013b2a5a7d405764d544e9
Parents: 3b104fc
Author: Andrew Kennedy <an...@cloudsoftcorp.com>
Authored: Thu Oct 31 17:27:18 2013 +0000
Committer: Andrew Kennedy <an...@cloudsoftcorp.com>
Committed: Thu Oct 31 17:34:19 2013 +0000

----------------------------------------------------------------------
 .../src/main/java/brooklyn/demo/CumulusRDFApplication.java    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/37d02f22/examples/simple-nosql-cluster/src/main/java/brooklyn/demo/CumulusRDFApplication.java
----------------------------------------------------------------------
diff --git a/examples/simple-nosql-cluster/src/main/java/brooklyn/demo/CumulusRDFApplication.java b/examples/simple-nosql-cluster/src/main/java/brooklyn/demo/CumulusRDFApplication.java
index b7a2d7a..879fe66 100644
--- a/examples/simple-nosql-cluster/src/main/java/brooklyn/demo/CumulusRDFApplication.java
+++ b/examples/simple-nosql-cluster/src/main/java/brooklyn/demo/CumulusRDFApplication.java
@@ -128,14 +128,14 @@ public class CumulusRDFApplication extends AbstractApplication {
         if (getConfig(MULTI_REGION_FABRIC)) {
             cassandra = 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, clusterSpec));
         } else {
             cassandra = addChild(EntitySpec.create(clusterSpec)
                     .configure(CassandraCluster.CLUSTER_NAME, "Brooklyn")
-                    .configure(CassandraCluster.INITIAL_SIZE, 2));
+                    .configure(CassandraCluster.INITIAL_SIZE, getConfig(CASSANDRA_CLUSTER_SIZE)));
         }
 
         // Tomcat web-app server
@@ -154,7 +154,7 @@ public class CumulusRDFApplication extends AbstractApplication {
                 // Process the YAML template given in the application config
                 String url = Entities.getRequiredUrlConfig(CumulusRDFApplication.this, CUMULUS_RDF_CONFIG_URL);
                 Map<String, Object> config = MutableMap.<String, Object>of("cassandraHostname", endpoint.getHostText(), "cassandraThriftPort", endpoint.getPort());
-                String contents = TemplateProcessor.processTemplateContents(new ResourceUtils(this).getResourceAsString(url), config);
+                String contents = TemplateProcessor.processTemplateContents(new ResourceUtils(CumulusRDFApplication.this).getResourceAsString(url), config);
 
                 // Copy the file contents to the remote machine
                 return DynamicTasks.queue(SshEffectorTasks.put("/tmp/cumulus.yaml").contents(contents)).get();
@@ -198,6 +198,7 @@ public class CumulusRDFApplication extends AbstractApplication {
         addLocations(locations);
 
         // The web application only needs to run in one location, use the first
+        // TODO use a multi-region web cluster
         Collection<? extends Location> first = MutableList.copyOf(Iterables.limit(locations, 1));
 
         setAttribute(Attributes.SERVICE_STATE, Lifecycle.STARTING);