@API(value=UNSTABLE) public class NoOpIndexMaintainer extends IndexMaintainer
state
Modifier | Constructor and Description |
---|---|
protected |
NoOpIndexMaintainer(IndexMaintainerState state) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Boolean> |
addedRangeWithKey(Tuple primaryKey)
Whether this key has been added to some range within the
RangeSet
associated with this index. |
boolean |
canDeleteWhere(QueryToKeyMatcher matcher,
Key.Evaluated evaluated)
Get whether this index scan delete records matching a particular key query.
|
boolean |
canEvaluateAggregateFunction(IndexAggregateFunction function)
Get whether this index can be used to evaluate the given aggregate function.
|
boolean |
canEvaluateRecordFunction(IndexRecordFunction<?> function)
Return
true if this index be used to evaluate the given record function. |
CompletableFuture<Void> |
deleteWhere(Transaction tr,
Tuple prefix)
Clear index storage associated with the given key prefix.
|
CompletableFuture<Tuple> |
evaluateAggregateFunction(IndexAggregateFunction function,
TupleRange range,
IsolationLevel isolationLevel)
Evaluate an aggregate function over the given range using this index.
|
<T,M extends Message> |
evaluateRecordFunction(EvaluationContext context,
IndexRecordFunction<T> function,
FDBRecord<M> record)
Evaluate a record function on the given record.
|
boolean |
isIdempotent()
Whether updating or removing a record on this index is idempotent.
|
CompletableFuture<IndexOperationResult> |
performOperation(IndexOperation operation)
Perform a type-specific operation on index.
|
RecordCursor<IndexEntry> |
scan(IndexScanType scanType,
TupleRange range,
byte[] continuation,
ScanProperties scanProperties)
Scan entries in the index.
|
RecordCursor<IndexEntry> |
scanUniquenessViolations(TupleRange range,
byte[] continuation,
ScanProperties scanProperties)
Scans through the list of uniqueness violations within the database.
|
<M extends Message> |
update(FDBIndexableRecord<M> oldRecord,
FDBIndexableRecord<M> newRecord)
Update associated index for a changed record.
|
void |
updateUniquenessViolations(Tuple valueKey,
Tuple primaryKey,
Tuple existingKey,
boolean remove)
Remove or add a uniqueness violation within the database.
|
RecordCursor<InvalidIndexEntry> |
validateEntries(byte[] continuation,
ScanProperties scanProperties)
Validates the integrity of the index entries.
|
getIndexSubspace, getSecondarySubspace, unsupportedAggregateFunction, unsupportedRecordFunction
protected NoOpIndexMaintainer(IndexMaintainerState state)
@Nonnull public RecordCursor<IndexEntry> scan(@Nonnull IndexScanType scanType, @Nonnull TupleRange range, @Nullable byte[] continuation, @Nonnull ScanProperties scanProperties)
IndexMaintainer
scan
in class IndexMaintainer
scanType
- the type
of scan to performrange
- the range to scancontinuation
- any continuation from a previous scan invocationscanProperties
- skip, limit and other properties of the scan@Nonnull public <M extends Message> CompletableFuture<Void> update(@Nullable FDBIndexableRecord<M> oldRecord, @Nullable FDBIndexableRecord<M> newRecord)
IndexMaintainer
update
in class IndexMaintainer
M
- type of messageoldRecord
- the previous stored record or null
if a new record is being creatednewRecord
- the new record or null
if an old record is being deleted@Nonnull public void updateUniquenessViolations(@Nonnull Tuple valueKey, @Nonnull Tuple primaryKey, @Nullable Tuple existingKey, boolean remove)
IndexMaintainer
updateUniquenessViolations
in class IndexMaintainer
valueKey
- the indexed key that is (apparently) not uniqueprimaryKey
- the primary key of one record that is causing a violationexistingKey
- the primary key of another record that is causing a violation (or null
if none specified)remove
- true
if removing the violation and false
if adding it@Nonnull public RecordCursor<IndexEntry> scanUniquenessViolations(@Nonnull TupleRange range, @Nullable byte[] continuation, @Nonnull ScanProperties scanProperties)
IndexMaintainer
IndexEntry
instances where the
getKey()
will return the primary key
of the record causing a problem and getValue()
will return the index value that is being duplicated.scanUniquenessViolations
in class IndexMaintainer
range
- range of tuples to readcontinuation
- any continuation from a previous invocationscanProperties
- row limit and other scan properties@Nonnull public RecordCursor<InvalidIndexEntry> validateEntries(@Nullable byte[] continuation, @Nullable ScanProperties scanProperties)
IndexMaintainer
IndexValidator
.validateEntries
in class IndexMaintainer
continuation
- any continuation from a previous validation invocationscanProperties
- skip, limit and other properties of the validation (use default values if null
)public boolean canEvaluateRecordFunction(@Nonnull IndexRecordFunction<?> function)
IndexMaintainer
true
if this index be used to evaluate the given record function.canEvaluateRecordFunction
in class IndexMaintainer
function
- requested functiontrue
if this index can be used to evaluate the given function@Nonnull public <T,M extends Message> CompletableFuture<T> evaluateRecordFunction(@Nonnull EvaluationContext context, @Nonnull IndexRecordFunction<T> function, @Nonnull FDBRecord<M> record)
IndexMaintainer
evaluateRecordFunction
in class IndexMaintainer
T
- the result type of the functionM
- the message type of the recordcontext
- context for evaluationfunction
- the record function to apply to the given recordrecord
- record against which to evaluatepublic boolean canEvaluateAggregateFunction(@Nonnull IndexAggregateFunction function)
IndexMaintainer
canEvaluateAggregateFunction
in class IndexMaintainer
function
- the requested aggregate functiontrue
if this index be used to evaluate the given aggregate function@Nonnull public CompletableFuture<Tuple> evaluateAggregateFunction(@Nonnull IndexAggregateFunction function, @Nonnull TupleRange range, @Nonnull IsolationLevel isolationLevel)
IndexMaintainer
evaluateAggregateFunction
in class IndexMaintainer
function
- the aggregate function to evaluaterange
- the range over which to accumulate the aggregateisolationLevel
- the isolation level at which to perform the scanpublic boolean isIdempotent()
IndexMaintainer
isIdempotent
in class IndexMaintainer
@Nonnull public CompletableFuture<Boolean> addedRangeWithKey(@Nonnull Tuple primaryKey)
IndexMaintainer
RangeSet
associated with this index. This is used within the context of seeing if one should update a non-idempotent
write-only index with a new key. If the key is in some range, then it means that one should update the index
as it is based off of stale data. If the key is not in some range, then it means that one should not update
the index, as the rebuild job will handle it later.addedRangeWithKey
in class IndexMaintainer
primaryKey
- the record key of the record to checktrue
if some range contains the record and false
otherwisepublic boolean canDeleteWhere(@Nonnull QueryToKeyMatcher matcher, @Nonnull Key.Evaluated evaluated)
IndexMaintainer
canDeleteWhere
in class IndexMaintainer
matcher
- the key queryevaluated
- parameters to the key querytrue
if this index accommodate a whereRecordsWhere
public CompletableFuture<Void> deleteWhere(Transaction tr, @Nonnull Tuple prefix)
IndexMaintainer
deleteWhere
in class IndexMaintainer
tr
- transaction in which to access the databaseprefix
- prefix of primary key to clearpublic CompletableFuture<IndexOperationResult> performOperation(@Nonnull IndexOperation operation)
IndexMaintainer
performOperation
in class IndexMaintainer
operation
- the requested operation