Example on creating a new KeySpace

Mar 14, 2012 at 8:01 AM

I hope there is some more documentation you guys can bring up ahead.

Your product is very flexing as compared to FOUR other .NET clients I have tried so far. 

If you can post a sample here or on the main documentation for creating new KeySpaces.


Thank you

Mar 15, 2012 at 12:45 AM

You can show sample in follwoing code.

KsDef and CfDef are class in thrift api.


using(Context = new CassandraContext(host, port, "system"))
    var cfDef = new CfDef();
    cfDef.Keyspace = "ks1";
    cfDef.Name = "cf1";
    cfDef.Column_type = "Standard";
    cfDef.Comparator_type = "IntegerType";

    var cfDefList = new List<CfDef>();
    var ksDef = new KsDef();
    ksDef.Name = "ks1";
    ksDef.Strategy_class = "org.apache.cassandra.locator.SimpleStrategy";
    ksDef.Replication_factor = 1;
    ksDef.Cf_defs = cfDefList;

Mar 15, 2012 at 6:24 AM

Thank you. Just what was needed :)