public static KsDef toThrift(KSMetaData ksm)
{
List<CfDef> cfDefs = new ArrayList<CfDef>();
for (CFMetaData cfm : ksm.cfMetaData().values())
cfDefs.add(CFMetaData.convertToThrift(cfm));
KsDef ksdef = new KsDef(ksm.name, ksm.strategyClass.getName(), cfDefs);
ksdef.setStrategy_options(ksm.strategyOptions);
if (ksm.strategyOptions != null && ksm.strategyOptions.containsKey("replication_factor"))
ksdef.setReplication_factor(Integer.parseInt(ksm.strategyOptions.get("replication_factor")));
ksdef.durable_writes = ksm.durable_writes;
return ksdef;
}