Class LuceneIndexMaintainer
java.lang.Object
com.apple.foundationdb.record.provider.foundationdb.IndexMaintainer
com.apple.foundationdb.record.provider.foundationdb.indexes.StandardIndexMaintainer
com.apple.foundationdb.record.lucene.LuceneIndexMaintainer
Index maintainer for Lucene Indexes backed by FDB. The insert, update, and delete functionality
coupled with the scan functionality is implemented here.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
static final String
protected static final String
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 -
Method Summary
Modifier and TypeMethodDescriptionaddedRangeWithKey
(Tuple primaryKey) boolean
canDeleteWhere
(QueryToKeyMatcher matcher, Key.Evaluated evaluated) boolean
boolean
canEvaluateRecordFunction
(IndexRecordFunction<?> function) protected FDBDirectoryManager
deleteWhere
(Transaction tr, Tuple prefix) evaluateAggregateFunction
(IndexAggregateFunction function, TupleRange range, IsolationLevel isolationLevel) <T,
M extends Message>
CompletableFuture<T>evaluateRecordFunction
(EvaluationContext context, IndexRecordFunction<T> function, FDBRecord<M> record) protected FDBDirectory
getDirectory
(Tuple groupingKey, Integer partitionId) boolean
void
mergeIndexForTesting
(Tuple groupingKey, Integer partitionId, AgilityContext agilityContext) performOperation
(IndexOperation operation) scan
(IndexScanType scanType, TupleRange range, byte[] continuation, ScanProperties scanProperties) scan
(IndexScanBounds scanBounds, byte[] continuation, ScanProperties scanProperties) The scan takes Lucene aQuery
as scan bounds.<M extends Message>
CompletableFuture<Void>update
(FDBIndexableRecord<M> oldRecord, FDBIndexableRecord<M> newRecord) validateEntries
(byte[] continuation, ScanProperties scanProperties) Methods inherited from class com.apple.foundationdb.record.provider.foundationdb.indexes.StandardIndexMaintainer
addUniquenessViolation, canDeleteGroup, canDeleteWhere, checkKeyValueSizes, checkUniqueness, clearUniquenessViolations, commonKeys, decodeValue, evaluateIndex, filteredIndexEntries, getExecutor, getGroupedCount, getGroupingCount, getTimer, indexEntryKey, makeMutable, removeUniquenessViolationsAsync, saveIndexEntryAsKeyValue, scan, scanRemoteFetchByValue, scanUniquenessViolations, skipUpdateForUnchangedKeys, trimTooLargeTuple, unpackKeyValue, unpackKeyValue, unpackRemoteFetchRecord, updateIndexKeys, updateIndexKeysFunction, updateOneKeyAsync, updateWhileWriteOnly, validateMissingEntries, validateOrphanEntries
Methods inherited from class com.apple.foundationdb.record.provider.foundationdb.IndexMaintainer
getIndexSubspace, getSecondarySubspace, scanRemoteFetch, unsupportedAggregateFunction, unsupportedRecordFunction
-
Field Details
-
PRIMARY_KEY_FIELD_NAME
- See Also:
-
PRIMARY_KEY_SEARCH_NAME
- See Also:
-
PRIMARY_KEY_BINARY_POINT_NAME
- See Also:
-
-
Constructor Details
-
LuceneIndexMaintainer
-
-
Method Details
-
getAutoCompleteAnalyzerSelector
-
scan
@Nonnull public RecordCursor<IndexEntry> scan(@Nonnull IndexScanType scanType, @Nonnull TupleRange range, @Nullable byte[] continuation, @Nonnull ScanProperties scanProperties) - Specified by:
scan
in classIndexMaintainer
-
scan
@Nonnull public RecordCursor<IndexEntry> scan(@Nonnull IndexScanBounds scanBounds, @Nullable byte[] continuation, @Nonnull ScanProperties scanProperties) The scan takes Lucene aQuery
as scan bounds.- Overrides:
scan
in classIndexMaintainer
- Parameters:
scanBounds
- thetype
of Lucene scan and associatedQuery
continuation
- any continuation from a previous scan invocationscanProperties
- skip, limit and other properties of the scan- Returns:
- RecordCursor of index entries reconstituted from Lucene documents
-
mergeIndex
- Overrides:
mergeIndex
in classStandardIndexMaintainer
-
mergeIndexForTesting
public void mergeIndexForTesting(@Nonnull Tuple groupingKey, @Nullable Integer partitionId, @Nonnull AgilityContext agilityContext) throws IOException - Throws:
IOException
-
getPartitioner
-
rebalancePartitions
-
update
@Nonnull public <M extends Message> CompletableFuture<Void> update(@Nullable FDBIndexableRecord<M> oldRecord, @Nullable FDBIndexableRecord<M> newRecord) - Overrides:
update
in classStandardIndexMaintainer
-
validateEntries
@Nonnull public RecordCursor<InvalidIndexEntry> validateEntries(@Nullable byte[] continuation, @Nullable ScanProperties scanProperties) - Overrides:
validateEntries
in classStandardIndexMaintainer
-
canEvaluateRecordFunction
- Overrides:
canEvaluateRecordFunction
in classStandardIndexMaintainer
-
evaluateRecordFunction
@Nonnull public <T,M extends Message> CompletableFuture<T> evaluateRecordFunction(@Nonnull EvaluationContext context, @Nonnull IndexRecordFunction<T> function, @Nonnull FDBRecord<M> record) - Overrides:
evaluateRecordFunction
in classStandardIndexMaintainer
-
canEvaluateAggregateFunction
- Overrides:
canEvaluateAggregateFunction
in classStandardIndexMaintainer
-
evaluateAggregateFunction
@Nonnull public CompletableFuture<Tuple> evaluateAggregateFunction(@Nonnull IndexAggregateFunction function, @Nonnull TupleRange range, @Nonnull IsolationLevel isolationLevel) - Overrides:
evaluateAggregateFunction
in classStandardIndexMaintainer
-
isIdempotent
public boolean isIdempotent()- Overrides:
isIdempotent
in classStandardIndexMaintainer
-
addedRangeWithKey
- Overrides:
addedRangeWithKey
in classStandardIndexMaintainer
-
canDeleteWhere
- Overrides:
canDeleteWhere
in classStandardIndexMaintainer
-
deleteWhere
- Overrides:
deleteWhere
in classStandardIndexMaintainer
-
performOperation
@Nonnull public CompletableFuture<IndexOperationResult> performOperation(@Nonnull IndexOperation operation) - Overrides:
performOperation
in classStandardIndexMaintainer
-
getDirectory
-
getDirectoryManager
-
createDirectoryManager
-
getIndexScrubbingTools
@Nullable public IndexScrubbingTools<?> getIndexScrubbingTools(IndexScrubbingTools.ScrubbingType type) - Overrides:
getIndexScrubbingTools
in classIndexMaintainer
-