Skip to content

Instantly share code, notes, and snippets.

@jsanda
Last active December 17, 2015 02:09
Show Gist options
  • Save jsanda/5534011 to your computer and use it in GitHub Desktop.
Save jsanda/5534011 to your computer and use it in GitHub Desktop.
require 'java'
import org.rhq.cassandra.schema.SchemaManager
if $project.properties['db'] == 'dev'
$self.log 'PERFORMING STORAGE NODE SETUP TO LATEST SCHEMA'
username = $project.properties.fetch('rhq.dev.cassandra.username', 'cassandra')
password = $project.properties.fetch('rhq.dev.cassandra.password', 'cassandra')
seeds = $project.properties.fetch('rhq.dev.cassandra.seeds', '127.0.0.1|9160|9142')
schemaManager = SchemaManager.new(username, password, seeds)
schemaManager.resetSchema
else
$self.log 'SKIPPING SCHEMA SETUP FOR STORAGE NODE'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment