Class ValueIndexMaintainer
- java.lang.Object
-
- com.apple.foundationdb.record.provider.foundationdb.IndexMaintainer
-
- com.apple.foundationdb.record.provider.foundationdb.indexes.StandardIndexMaintainer
-
- com.apple.foundationdb.record.provider.foundationdb.indexes.ValueIndexMaintainer
-
@API(STABLE) public class ValueIndexMaintainer extends StandardIndexMaintainer
An index maintainer for an ordinary index by value, implementing ordered enumeration of records within a range of indexed values. When more than one field is indexed, records are ordered lexicographically.
-
-
Field Summary
-
Fields inherited from class com.apple.foundationdb.record.provider.foundationdb.indexes.StandardIndexMaintainer
TOO_LARGE_VALUE_MESSAGE_LIMIT
-
Fields inherited from class com.apple.foundationdb.record.provider.foundationdb.IndexMaintainer
state
-
-
Constructor Summary
Constructors Constructor Description ValueIndexMaintainer(IndexMaintainerState state)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canEvaluateAggregateFunction(IndexAggregateFunction function)
Get whether this index can be used to evaluate the given aggregate function.CompletableFuture<Tuple>
evaluateAggregateFunction(IndexAggregateFunction function, TupleRange range, IsolationLevel isolationLevel)
Evaluate an aggregate function over the given range using this index.RecordCursor<IndexEntry>
scan(IndexScanType scanType, TupleRange range, byte[] continuation, ScanProperties scanProperties)
Scan entries in the index.protected static KeyExpression
ungroupedAggregateOperand(KeyExpression key)
RecordCursor<InvalidIndexEntry>
validateEntries(byte[] continuation, ScanProperties scanProperties)
Validate entries in the index.-
Methods inherited from class com.apple.foundationdb.record.provider.foundationdb.indexes.StandardIndexMaintainer
addedRangeWithKey, addUniquenessViolation, canDeleteWhere, canDeleteWhere, canEvaluateRecordFunction, checkKeyValueSizes, checkUniqueness, commonKeys, decodeValue, deleteWhere, evaluateIndex, evaluateRecordFunction, filteredIndexEntries, getExecutor, getGroupedCount, getGroupingCount, getTimer, indexEntryKey, isIdempotent, makeMutable, performOperation, removeUniquenessViolationsAsync, saveIndexEntryAsKeyValue, scan, scanUniquenessViolations, skipUpdateForUnchangedKeys, trimTooLargeTuple, unpackKeyValue, unpackKeyValue, update, updateIndexKeys, updateIndexKeysFunction, updateOneKeyAsync, validateMissingEntries, validateOrphanEntries
-
Methods inherited from class com.apple.foundationdb.record.provider.foundationdb.IndexMaintainer
getIndexSubspace, getSecondarySubspace, unsupportedAggregateFunction, unsupportedRecordFunction
-
-
-
-
Constructor Detail
-
ValueIndexMaintainer
public ValueIndexMaintainer(IndexMaintainerState state)
-
-
Method Detail
-
scan
@Nonnull public RecordCursor<IndexEntry> scan(@Nonnull IndexScanType scanType, @Nonnull TupleRange range, @Nullable byte[] continuation, @Nonnull ScanProperties scanProperties)
Description copied from class:IndexMaintainer
Scan entries in the index.- Specified by:
scan
in classIndexMaintainer
- Parameters:
scanType
- thetype
of scan to performrange
- the range to scancontinuation
- any continuation from a previous scan invocationscanProperties
- skip, limit and other properties of the scan- Returns:
- a cursor over index entries in the given range
-
validateEntries
@Nonnull public RecordCursor<InvalidIndexEntry> validateEntries(@Nullable byte[] continuation, @Nullable ScanProperties scanProperties)
Validate entries in the index. It scans the index and checks if the record associated with each index entry exists.- Overrides:
validateEntries
in classStandardIndexMaintainer
- Parameters:
continuation
- any continuation from a previous validation invocationscanProperties
- skip, limit and other properties of the validation (use default values ifnull
)- Returns:
- a cursor over index entries that have no associated records
-
canEvaluateAggregateFunction
public boolean canEvaluateAggregateFunction(@Nonnull IndexAggregateFunction function)
Description copied from class:IndexMaintainer
Get whether this index can be used to evaluate the given aggregate function.- Overrides:
canEvaluateAggregateFunction
in classStandardIndexMaintainer
- Parameters:
function
- the requested aggregate function- Returns:
true
if this index be used to evaluate the given aggregate function
-
ungroupedAggregateOperand
protected static KeyExpression ungroupedAggregateOperand(@Nonnull KeyExpression key)
-
evaluateAggregateFunction
@Nonnull public CompletableFuture<Tuple> evaluateAggregateFunction(@Nonnull IndexAggregateFunction function, @Nonnull TupleRange range, @Nonnull IsolationLevel isolationLevel)
Description copied from class:IndexMaintainer
Evaluate an aggregate function over the given range using this index.- Overrides:
evaluateAggregateFunction
in classStandardIndexMaintainer
- Parameters:
function
- the aggregate function to evaluaterange
- the range over which to accumulate the aggregateisolationLevel
- the isolation level at which to perform the scan- Returns:
- a future that completes with the aggregate result
-
-