Question

Hey guys I am trying to load a schema into a Cassandra 0.8.2 database via Hector.

I want to add a column family (in a particular keyspace) & specify its name, comparator type, key validation class, and default validation class via Hector.

I've looked through the documentation here: https://github.com/rantav/hector/blob/master/core/src/main/java/me/prettyprint/hector/api/factory/HFactory.java

for the function that to do this, but it seems I must have the Column Family already created (via the Cassandra CLI) to specify the default validation class, & key validation class when creating the Column Family via the CLI. Am I correct in this assumption? Am I missing any methods? Is it possible to alter the default validation class & key validation class of a Cassandra column family via Hector?

Was it helpful?

Solution

You can do that with hector. There is an example in CassandraClusterTest where you can see new column families being created with the validation class set. There are methods on BasicColumnFamilyDefinition to set the key validation class and comparator as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top