use of org.apache.cassandra.thrift.IndexType in project brisk by riptano.
the class SchemaLoader method indexCFMD.
private static CFMetaData indexCFMD(String ksName, String cfName, final Boolean withIdxType) {
return standardCFMD(ksName, cfName).columnMetadata(Collections.unmodifiableMap(new HashMap<ByteBuffer, ColumnDefinition>() {
{
ByteBuffer cName = ByteBuffer.wrap("birthdate".getBytes(Charsets.UTF_8));
IndexType keys = withIdxType ? IndexType.KEYS : null;
put(cName, new ColumnDefinition(cName, LongType.instance, keys, null));
}
}));
}
use of org.apache.cassandra.thrift.IndexType in project eiger by wlloyd.
the class ColumnDefinition method fromAvro.
public static ColumnDefinition fromAvro(org.apache.cassandra.db.migration.avro.ColumnDef cd) {
IndexType index_type = cd.index_type == null ? null : Enum.valueOf(IndexType.class, cd.index_type.name());
String index_name = cd.index_name == null ? null : cd.index_name.toString();
try {
AbstractType validatorType = TypeParser.parse(cd.validation_class);
return new ColumnDefinition(ByteBufferUtil.clone(cd.name), validatorType, index_type, getStringMap(cd.index_options), index_name);
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
}
Aggregations