예제 #1
0
        public static ColumnFamily ToColumnFamilyFromCfDef(CfDef cfdef)
        {
            ColumnFamily cf = new ColumnFamily();

            cf.Name     = cfdef.Name;
            cf.Keyspace = cfdef.Keyspace;
            return(cf);
        }
예제 #2
0
        public static CfDef ToCfDefFromColumnFamily(ColumnFamily cf)
        {
            CfDef cfdef = new CfDef();

            cfdef.Name     = cf.Name;
            cfdef.Keyspace = cf.Keyspace;
            return(cfdef);
        }
예제 #3
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));
     }
 }