public static ColumnFamily ToColumnFamilyFromCfDef(CfDef cfdef) { ColumnFamily cf = new ColumnFamily(); cf.Name = cfdef.Name; cf.Keyspace = cfdef.Keyspace; return(cf); }
public static CfDef ToCfDefFromColumnFamily(ColumnFamily cf) { CfDef cfdef = new CfDef(); cfdef.Name = cf.Name; cfdef.Keyspace = cf.Keyspace; return(cfdef); }
/// <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)); } }