modules/core/dbutils/pom.xml | 36 +++++++++++++++++++++---------------
1 file changed, 21 insertions(+), 15 deletions(-)
New commits:
commit 5da62839eb8a1971474fa9d9f9e9a76d910d599d
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu May 30 22:58:33 2013 -0400
disable C* schema updates by default
This commit introduces a few changes:
* Cassandra schema updates are not applied by default
* You have to set -Dstorage-schema in order for C* schema updates to be applied
* Cassandra schema updates are only run when the dbsetup-upgrade or dbreset
properties are set
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 06cf148..33f18e0 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -272,27 +272,33 @@
<id>dbsetup-storage</id>
<phase>test</phase>
<configuration>
- <target if="dbsetup">
+ <target>
<script language="groovy">
import org.rhq.cassandra.schema.SchemaManager
- if (project.getProperty('db') ==
'dev') {
- self.log('PERFORMING STORAGE NODE SETUP
TO LATEST SCHEMA')
- username =
project.getProperty('rhq.dev.cassandra.username') ?: "cassandra"
- password =
project.getProperty('rhq.dev.cassandra.password') ?: "cassandra"
- seeds =
project.getProperty('rhq.dev.cassandra.seeds') ?: "127.0.0.1|7199|9142"
+ if
(project.getProperty('dbsetup-upgrade') || project.getProperty('dbreset'))
{
+ if
(project.getProperty('storage-schema')) {
+ if (project.getProperty('db') ==
'dev') {
+ self.log('PERFORMING STORAGE NODE
SETUP TO LATEST SCHEMA')
+ username =
project.getProperty('rhq.dev.cassandra.username') ?: "cassandra"
+ password =
project.getProperty('rhq.dev.cassandra.password') ?: "cassandra"
+ seeds =
project.getProperty('rhq.dev.cassandra.seeds') ?: "127.0.0.1|7199|9142"
- schemaManager = new SchemaManager(username,
password, seeds)
+ schemaManager = new
SchemaManager(username, password, seeds)
- if (project.getProperty('dbreset') ==
'true') {
- self.log('Dropping schema')
- schemaManager.drop()
- }
+ if
(project.getProperty('dbreset') == 'true') {
+ self.log('Dropping schema')
+ schemaManager.drop()
+ }
- self.log('Install schema')
- schemaManager.install()
- } else {
- self.log('SKIPPING SCHEMA SETUP FOR
STORAGE NODE')
+ self.log('Install schema')
+ schemaManager.install()
+ } else {
+ self.log('SKIPPING SCHEMA UPDATES FOR
STORAGE NODE')
+ self.log('Schema updates will only be
applied to the dev-container storage node')
+ self.log('Run to with -Ddb=dev or
-Pdev for to activate storage node schema changes')
+ }
+ }
}
</script>
</target>
Show replies by date