Example #1
0
 /// <summary>
 /// Creates a column family in the keyspace. If it doesn't exist, it will be created, then the call will sleep
 /// until all nodes have acknowledged the schema change
 /// </summary>
 /// <param name="keyspace"></param>
 /// <param name="cf"></param>
 public void createColumnFamily(String keyspace, ColumnFamily cf)
 {
     if (cf.Keyspace == null)
     {
         cf.Keyspace = keyspace;
     }
     client.set_keyspace(keyspace);
     if (getKeyspace(keyspace) == null)
     {
         throw new InvalidRequestException();
     }
     //add the cf
     if (!cfExists(keyspace, cf.Name))
     {
         //default read repair chance to 0.1
         cf.ReadRepairChance = 0.1d;
         client.system_add_column_family(ThriftUtility.ToCfDefFromColumnFamily(cf));
     }
 }
Example #2
0
 public override void Execute(Apache.Cassandra.Cassandra.Client cassandraClient, ILog logger)
 {
     Output = cassandraClient.system_add_column_family(columnFamilyDefinition.ToCassandraCfDef(keyspace));
 }