use of org.apache.cassandra.cql3.statements.schema.IndexTarget in project cassandra by apache.
the class SchemaLoader method customIndexCFMD.
public static TableMetadata.Builder customIndexCFMD(String ksName, String cfName) {
TableMetadata.Builder builder = TableMetadata.builder(ksName, cfName).addPartitionKeyColumn("key", AsciiType.instance).addClusteringColumn("c1", AsciiType.instance).addRegularColumn("value", LongType.instance).compression(getCompressionParameters());
IndexMetadata index = IndexMetadata.fromIndexTargets(Collections.singletonList(new IndexTarget(new ColumnIdentifier("value", true), IndexTarget.Type.VALUES)), cfName + "_value_index", IndexMetadata.Kind.CUSTOM, Collections.singletonMap(IndexTarget.CUSTOM_INDEX_OPTION_NAME, StubIndex.class.getName()));
builder.indexes(Indexes.of(index));
return builder;
}
Aggregations