Search in sources :

Example 1 with PlannableIndexTypes

use of com.apple.foundationdb.record.query.plan.PlannableIndexTypes in project fdb-record-layer by FoundationDB.

the class FDBSortQueryIndexSelectionTest method hooks.

// used through reflection
@SuppressWarnings("unused")
private static Stream<Arguments> hooks() {
    return Stream.of(Arguments.of(NO_HOOK, PlannableIndexTypes.DEFAULT), Arguments.of((RecordMetaDataHook) metadata -> {
        String indexName = "MySimpleRecord$num_value_3_indexed";
        KeyExpression root = metadata.getIndex(indexName).getRootExpression();
        metadata.removeIndex(indexName);
        metadata.addIndex("MySimpleRecord", new Index(indexName, root, "FAKE_TYPE"));
        metadata.getIndex(indexName).setSubspaceKey(indexName + "_2");
    }, new PlannableIndexTypes(Sets.newHashSet(IndexTypes.VALUE, IndexTypes.VERSION, "FAKE_TYPE"), PlannableIndexTypes.DEFAULT.getRankTypes(), PlannableIndexTypes.DEFAULT.getTextTypes())));
}
Also used : KeyExpression(com.apple.foundationdb.record.metadata.expressions.KeyExpression) Index(com.apple.foundationdb.record.metadata.Index) PlannableIndexTypes(com.apple.foundationdb.record.query.plan.PlannableIndexTypes) PlanMatchers.hasTupleString(com.apple.foundationdb.record.query.plan.match.PlanMatchers.hasTupleString)

Aggregations

Index (com.apple.foundationdb.record.metadata.Index)1 KeyExpression (com.apple.foundationdb.record.metadata.expressions.KeyExpression)1 PlannableIndexTypes (com.apple.foundationdb.record.query.plan.PlannableIndexTypes)1 PlanMatchers.hasTupleString (com.apple.foundationdb.record.query.plan.match.PlanMatchers.hasTupleString)1