modules/common/cassandra-common-itests/src/test/java/org/rhq/cassandra/common/BootstrapDeployerTest.java | 13 ++++++---- modules/common/cassandra-common/src/main/java/org/rhq/cassandra/BootstrapDeployer.java | 4 ++- modules/common/cassandra-common/src/main/resources/cassandra-1.2.0-beta1/conf/cassandra.yaml | 4 +-- modules/common/cassandra-common/src/main/resources/deploy.xml | 10 ++++++- 4 files changed, 23 insertions(+), 8 deletions(-)
New commits: commit d9d06489d99cd33aa8f79448bf976ef72a52a91a Author: John Sanda jsanda@redhat.com Date: Wed Oct 31 15:20:36 2012 -0400
Updating test to set new deployment properties
diff --git a/modules/common/cassandra-common-itests/src/test/java/org/rhq/cassandra/common/BootstrapDeployerTest.java b/modules/common/cassandra-common-itests/src/test/java/org/rhq/cassandra/common/BootstrapDeployerTest.java index aafd644..0819a51 100644 --- a/modules/common/cassandra-common-itests/src/test/java/org/rhq/cassandra/common/BootstrapDeployerTest.java +++ b/modules/common/cassandra-common-itests/src/test/java/org/rhq/cassandra/common/BootstrapDeployerTest.java @@ -32,6 +32,7 @@ import static org.testng.Assert.assertTrue; import java.io.File; import java.util.List; import java.util.Map; +import java.util.Properties;
import org.testng.annotations.Listeners; import org.testng.annotations.Test; @@ -60,10 +61,14 @@ public class BootstrapDeployerTest { File clusterDir = new File(basedir, "cassandra"); int numNodes = 2;
- DeploymentOptions deploymentOptions = new DeploymentOptions(); - deploymentOptions.setClusterDir(clusterDir.getAbsolutePath()); - deploymentOptions.setNumNodes(numNodes); - deploymentOptions.setLoggingLevel("DEBUG"); + Properties properties = new Properties(); + properties.setProperty("rhq.cassandra.cluster.dir", clusterDir.getAbsolutePath()); + properties.setProperty("rhq.cassandra.logging.level", "DEBUG"); + properties.setProperty("rhq.cassandra.cluster.num-nodes", "2"); + properties.setProperty("rhq.cassandra.ring.delay", "1000"); + properties.setProperty("rhq.cassandra.node.num-tokens", "256"); + + DeploymentOptions deploymentOptions = new DeploymentOptions(properties);
BootstrapDeployer deployer = new BootstrapDeployer(); deployer.setDeploymentOptions(deploymentOptions); diff --git a/modules/common/cassandra-common/src/main/java/org/rhq/cassandra/BootstrapDeployer.java b/modules/common/cassandra-common/src/main/java/org/rhq/cassandra/BootstrapDeployer.java index 19aa4f8..646cb59 100644 --- a/modules/common/cassandra-common/src/main/java/org/rhq/cassandra/BootstrapDeployer.java +++ b/modules/common/cassandra-common/src/main/java/org/rhq/cassandra/BootstrapDeployer.java @@ -183,7 +183,7 @@ public class BootstrapDeployer { return; } catch (TTransportException e) { try { - Thread.sleep(3000); + Thread.sleep(1000); } catch (InterruptedException e1) { } }
commit a9efde3c65169d13f0a99cb3ef82d286dd99f8cf Author: John Sanda jsanda@redhat.com Date: Wed Oct 31 15:14:41 2012 -0400
do not use dashes in bundle property names
Converted the property name rhq.cassandra.node.num-tokens to rhq.cassandra.node.num_tokens since rhq:input-property does not like dashes in the name attribute. Also updating BootstrapDeployer to set num-tokens property to support overrides.
diff --git a/modules/common/cassandra-common/src/main/java/org/rhq/cassandra/BootstrapDeployer.java b/modules/common/cassandra-common/src/main/java/org/rhq/cassandra/BootstrapDeployer.java index d7efd3e..19aa4f8 100644 --- a/modules/common/cassandra-common/src/main/java/org/rhq/cassandra/BootstrapDeployer.java +++ b/modules/common/cassandra-common/src/main/java/org/rhq/cassandra/BootstrapDeployer.java @@ -121,6 +121,8 @@ public class BootstrapDeployer { props.put("cassandra.ring.delay", deploymentOptions.getRingDelay()); }
+ props.put("rhq.cassandra.node.num_tokens", deploymentOptions.getNumTokens()); + doLocalDeploy(props, bundleDir); startNode(nodeBasedir); if (i == 0) { diff --git a/modules/common/cassandra-common/src/main/resources/cassandra-1.2.0-beta1/conf/cassandra.yaml b/modules/common/cassandra-common/src/main/resources/cassandra-1.2.0-beta1/conf/cassandra.yaml index 377ba65..43779d6 100644 --- a/modules/common/cassandra-common/src/main/resources/cassandra-1.2.0-beta1/conf/cassandra.yaml +++ b/modules/common/cassandra-common/src/main/resources/cassandra-1.2.0-beta1/conf/cassandra.yaml @@ -21,7 +21,7 @@ cluster_name: @@cluster.name@@ # # If you already have a cluster with 1 token per node, and wish to migrate to # multiple tokens per node, see http://wiki.apache.org/cassandra/Operations -# num_tokens: 256 +num_tokens: @@rhq.cassandra.node.num_tokens@@
# If you haven't specified num_tokens, or have set it to the default of 1 then # you should always specify InitialToken when setting up a production @@ -34,7 +34,7 @@ cluster_name: @@cluster.name@@ # the heaviest-loaded existing node. If there is no load information # available, such as is the case with a new cluster, it will pick # a random token, which will lead to hot spots. -#initial_token: @@initial.token@@ +#initial_token:
# See http://wiki.apache.org/cassandra/HintedHandoff hinted_handoff_enabled: true diff --git a/modules/common/cassandra-common/src/main/resources/deploy.xml b/modules/common/cassandra-common/src/main/resources/deploy.xml index e07cc0e..3292086 100644 --- a/modules/common/cassandra-common/src/main/resources/deploy.xml +++ b/modules/common/cassandra-common/src/main/resources/deploy.xml @@ -5,6 +5,14 @@ version="${rhq.cassandra.bundle.version}" description="A bundle for deploying RHQ Cassandra nodes.">
+ <!-- + NOTE: the name attribute of an rhq:input-property does not support using a dash. + There is a convention where dashes are used in property names in rhq properties files + in the trailing part of a property name. If an rhq:input-property has a corresponding + property in cassandra.properties and contains a dash, the dash will be changed to an + underscore in this file. + --> + <rhq:input-property name="cluster.name" description="The name of the cluster. This is used to prevent machines in one logical cluster from joining another" required="true" @@ -59,7 +67,7 @@ defaultValue="127.0.0.1" type="string"/>
- <rhq:input-property name="rhq.cassandra.node.num-tokens" + <rhq:input-property name="rhq.cassandra.node.num_tokens" description="Defines the number of tokens randomly assigned to a node on the ring. The more tokens, relative to other nodes, the larger the proportion of data that this node will store. You probably want all nodes to have the same number of tokens assuming they have equal hardware capability." required="false" defaultValue="256"
rhq-commits@lists.fedorahosted.org