Why not just a text file of CQL commands. Both the cassandra maven plugin and
cqlsh support being passed a file of CQL commands. We can do the same.
XML/JSON/etc. just means more code to maintain and validate.
I would want to break down the scripts into steps and isolate potential failure. A single
CQL file would just run top to bottom.
We will need some minimal capability for executing statements dynamically.
When the installer runs and the schema is created, the replication factor
will be set according to the cluster size. And if it is a single node
cluster, then we will set gc_grace_seconds on each table to zero. With a
single node, tombstones can be GC'd immediately. We can support this kind of
stuff with simple tokenization though.
I would not consider this kind of functionality schema management. This goes more into the
area of configuration. For one, the users can add or remove nodes at any time. The schema
management should not apply an update more than once, otherwise we can create a lot of
confusion. The only goal of the schema management tool is to get the Cassandra schema
updated from RHQ release to RHQ release. The actual configuration should be left to the
other components of the application. So tasks like updating the gc grace period are
configuration related and should be executed post schema installation/upgrade.