Created
July 16, 2012 07:19
-
-
Save bartprokop/3121324 to your computer and use it in GitHub Desktop.
Creating namespace with Cassandra
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String... args) { | |
Cluster cluster = HFactory | |
.getOrCreateCluster("test-cluster", "localhost:9160"); | |
ColumnFamilyDefinition cfDef = HFactory | |
.createColumnFamilyDefinition("MyKeyspace", "ColumnFamilyName", ComparatorType.BYTESTYPE); | |
KeyspaceDefinition newKeyspace = HFactory | |
.createKeyspaceDefinition("MyKeyspace", ThriftKsDef.DEF_STRATEGY_CLASS, 1, | |
Arrays.asList(cfDef)); | |
cluster.addKeyspace(newKeyspace, true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment