Class VersionIndexMaintainer
- 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.VersionIndexMaintainer
-
@API(EXPERIMENTAL) public class VersionIndexMaintainer extends StandardIndexMaintainer
Implementation ofIndexMaintainer
for the "version" index type. Here, the keys of the index are required to have exactly one column that is of typeVersion
. If records are added to this index with a completeFDBRecordVersion
associated with it, then the given version is used. If it is associated with an incompleteRecordVersion
, then it will set the key in such a way that the global version is filled in when the record is committed. If one only ever serializes records with incompleteRecordVersion
s, then this index guarantees that the version column is strictly monotonically increasing with time.
-
-
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 Modifier Constructor Description protected
VersionIndexMaintainer(IndexMaintainerState state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RecordCursor<IndexEntry>
scan(IndexScanType scanType, TupleRange range, byte[] continuation, ScanProperties scanProperties)
Scan entries in the index.protected <M extends Message>
CompletableFuture<Void>updateOneKeyAsync(FDBIndexableRecord<M> savedRecord, boolean remove, IndexEntry indexEntry)
Store a single key in the index.-
Methods inherited from class com.apple.foundationdb.record.provider.foundationdb.indexes.StandardIndexMaintainer
addedRangeWithKey, addUniquenessViolation, canDeleteWhere, canDeleteWhere, canEvaluateAggregateFunction, canEvaluateRecordFunction, checkKeyValueSizes, checkUniqueness, commonKeys, decodeValue, deleteWhere, evaluateAggregateFunction, evaluateIndex, evaluateRecordFunction, filteredIndexEntries, getExecutor, getGroupedCount, getGroupingCount, getTimer, indexEntryKey, isIdempotent, makeMutable, performOperation, removeUniquenessViolationsAsync, saveIndexEntryAsKeyValue, scan, scanUniquenessViolations, skipUpdateForUnchangedKeys, trimTooLargeTuple, unpackKeyValue, unpackKeyValue, update, updateIndexKeys, updateIndexKeysFunction, validateEntries, validateMissingEntries, validateOrphanEntries
-
Methods inherited from class com.apple.foundationdb.record.provider.foundationdb.IndexMaintainer
getIndexSubspace, getSecondarySubspace, unsupportedAggregateFunction, unsupportedRecordFunction
-
-
-
-
Constructor Detail
-
VersionIndexMaintainer
protected VersionIndexMaintainer(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
-
updateOneKeyAsync
protected <M extends Message> CompletableFuture<Void> updateOneKeyAsync(@Nonnull FDBIndexableRecord<M> savedRecord, boolean remove, @Nonnull IndexEntry indexEntry)
Description copied from class:StandardIndexMaintainer
Store a single key in the index.- Overrides:
updateOneKeyAsync
in classStandardIndexMaintainer
- Type Parameters:
M
- the message type of the record- Parameters:
savedRecord
- the record being indexedremove
-true
if removing from indexindexEntry
- the entry for the index to be updated- Returns:
- a future completed when the key is updated
-
-