@API(value=INTERNAL) public class IndexFunctionHelper extends Object
IndexRecordFunction
and IndexAggregateFunction
.Modifier and Type | Method and Description |
---|---|
static Optional<IndexAggregateFunction> |
bindAggregateFunction(FDBRecordStore store,
IndexAggregateFunction function,
List<String> recordTypeNames) |
static IndexAggregateFunction |
count(KeyExpression by) |
static IndexAggregateFunction |
countUpdates(KeyExpression by) |
static KeyExpression |
getGroupedKey(KeyExpression key) |
static KeyExpression |
getGroupingKey(KeyExpression key) |
protected static KeyExpression |
getGroupingSubkey(GroupingKeyExpression grouping,
int start,
int end) |
static Stream<Index> |
indexesForRecordTypes(FDBRecordStore store,
List<String> recordTypeNames)
The indexes that apply to exactly the given types, no more, no less.
|
static Optional<IndexMaintainer> |
indexMaintainerForAggregateFunction(FDBRecordStore store,
IndexAggregateFunction function,
List<String> recordTypeNames) |
static Optional<IndexMaintainer> |
indexMaintainerForRecordFunction(FDBRecordStore store,
IndexRecordFunction<?> function,
FDBRecord<?> record)
Find an index that can evaluate the given function against the given record.
|
static Optional<IndexMaintainer> |
indexMaintainerForRecordFunction(FDBRecordStore store,
IndexRecordFunction<?> function,
List<String> recordTypeNames)
Find an index that can evaluate the given function against all of the given record types.
|
static boolean |
isGroupPrefix(KeyExpression functionOperand,
KeyExpression indexRoot)
Is the operand for this function compatible with this index?
The grouped part must match.
|
public static Optional<IndexMaintainer> indexMaintainerForRecordFunction(@Nonnull FDBRecordStore store, @Nonnull IndexRecordFunction<?> function, @Nonnull FDBRecord<?> record)
store
- the record store containing the recordfunction
- the function to evaluaterecord
- the record to evaluate againstOptional.empty()
public static Optional<IndexMaintainer> indexMaintainerForRecordFunction(@Nonnull FDBRecordStore store, @Nonnull IndexRecordFunction<?> function, @Nonnull List<String> recordTypeNames)
store
- the record store containing the record typesfunction
- the function to evaluaterecordTypeNames
- the names of all the record types for which the function will be evaluatedOptional.empty()
public static Optional<IndexMaintainer> indexMaintainerForAggregateFunction(@Nonnull FDBRecordStore store, @Nonnull IndexAggregateFunction function, @Nonnull List<String> recordTypeNames)
public static Stream<Index> indexesForRecordTypes(@Nonnull FDBRecordStore store, @Nonnull List<String> recordTypeNames)
store
- the store containing the record typesrecordTypeNames
- the names of the record types for which indexes are neededpublic static boolean isGroupPrefix(@Nonnull KeyExpression functionOperand, @Nonnull KeyExpression indexRoot)
functionOperand
- the operand to the functionindexRoot
- the index's expressiontrue
if the operand is compatible with the indexpublic static KeyExpression getGroupedKey(@Nonnull KeyExpression key)
public static KeyExpression getGroupingKey(@Nonnull KeyExpression key)
protected static KeyExpression getGroupingSubkey(GroupingKeyExpression grouping, int start, int end)
public static IndexAggregateFunction count(@Nonnull KeyExpression by)
public static IndexAggregateFunction countUpdates(@Nonnull KeyExpression by)
public static Optional<IndexAggregateFunction> bindAggregateFunction(@Nonnull FDBRecordStore store, @Nonnull IndexAggregateFunction function, @Nonnull List<String> recordTypeNames)