-
Notifications
You must be signed in to change notification settings - Fork 354
Create column family
jvalencia edited this page Nov 20, 2012
·
6 revisions
AstyanaxContext<Cluster> clusterContext = connectClusterContext(clusterName, port, hosts);
clusterContext.start();
ColumnFamilyDefinition cfDefinition = clusterContext.getEntity().makeColumnFamilyDefinition()
.setKeyspace(ks)
.setName(cfName)
.setComparatorType("UTF8Type")
.setKeyValidationClass("UTF8Type");
if (counter) {
cfDefinition.setDefaultValidationClass("CounterColumnType");
}
try {
clusterContext.getEntity().addColumnFamily(cfDefinition);
//clusterContext.getEntity().updateColumnFamily(cfDefinition);
return true;
} catch (ConnectionException exception) {
System.out.println(exception.getMessage());
return false;
}
A Netflix Original Production
Tech Blog | Twitter @NetflixOSS | Jobs
- Getting-Started
- Configuration
- Features
- Monitoring
- Thread Safety
- Timeouts
- Recipes
- Examples
- Javadoc
- Utilities
- Cassandra-Compatibility
- FAQ
- End-to-End Examples
- Astyanax Integration with Java Driver