示例#1
0
        /// <summary>
        /// Create the keyspace
        /// </summary>
        /// <param name="keyspace"></param>
        public void createKeySpace(String keyspace)
        {
            KsDef keyspaceDefinition = new KsDef();

            keyspaceDefinition.Name = keyspace;
            keyspaceDefinition.Replication_factor = 1;
            keyspaceDefinition.Strategy_class     = "org.apache.cassandra.locator.SimpleStrategy";
            keyspaceDefinition.Strategy_options   = new Dictionary <string, string>();
            keyspaceDefinition.Strategy_options.Add("replication_factor", "1");
            keyspaceDefinition.Cf_defs = new List <CfDef>();

            client.system_add_keyspace(keyspaceDefinition);
            waitForCreation(keyspace);
        }
示例#2
0
 public override void Execute(Apache.Cassandra.Cassandra.Client cassandraClient)
 {
     Output = cassandraClient.system_add_keyspace(keyspaceDefinition.ToCassandraKsDef());
 }