@API(value=MAINTAINED) public class RecordQueryFilterPlan extends Object
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOGGER |
Constructor and Description |
---|
RecordQueryFilterPlan(ExpressionRef<RecordQueryPlan> inner,
QueryComponent filter) |
RecordQueryFilterPlan(RecordQueryPlan inner,
List<QueryComponent> filters) |
RecordQueryFilterPlan(RecordQueryPlan inner,
QueryComponent filter) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
boolean |
equalsWithoutChildren(RelationalExpression otherExpression) |
protected <M extends Message> |
evalFilter(FDBRecordStoreBase<M> store,
EvaluationContext context,
FDBRecord<M> record) |
protected <M extends Message> |
evalFilterAsync(FDBRecordStoreBase<M> store,
EvaluationContext context,
FDBRecord<M> record) |
<M extends Message> |
execute(FDBRecordStoreBase<M> store,
EvaluationContext context,
byte[] continuation,
ExecuteProperties executeProperties)
Execute this query plan.
|
RecordQueryPlan |
getChild() |
int |
getComplexity()
Returns an integer representing the "complexity" of the generated plan.
|
QueryComponent |
getFilter() |
RecordQueryPlan |
getInner() |
Iterator<? extends ExpressionRef<? extends RelationalExpression>> |
getPlannerExpressionChildren()
Return an iterator of references to the children of this planner expression.
|
Set<String> |
getUsedIndexes()
Returns a set of names of the indexes used by this plan (and its sub-plans).
|
protected boolean |
hasAsyncFilter() |
boolean |
hasFullRecordScan()
Indicates whether this plan (or one of its components) must perform a scan over all records in the store directly
rather than going through a secondary index.
|
int |
hashCode() |
boolean |
hasIndexScan(String indexName)
Indicates whether this plan scans the given index.
|
boolean |
hasRecordScan()
Indicates whether this plan (or one of its components) scans at least a subset of the record range directly
rather than going through a secondary index.
|
boolean |
isReverse()
Indicates whether this plan will return values in "reverse" order from the
natural order of results of this plan.
|
void |
logPlanStructure(StoreTimer timer)
Adds one to an appropriate
StoreTimer counter for each plan and subplan of this plan, allowing tracking
of which plans are being chosen (e.g. |
int |
planHash()
Return a hash similar to
hashCode , but with the additional guarantee that is is stable across JVMs. |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getChildren, getRelationalChildCount, hasLoadBykeys
execute, execute, execute, getQueryPlanChildren
execute, execute
combineHashes, iterablePlanHash, objectPlanHash, objectsPlanHash, planHash, planHash, planHashUnordered, stringHashUnordered
acceptPropertyVisitor, bindTo, fromRecordQuery, show
public RecordQueryFilterPlan(@Nonnull RecordQueryPlan inner, @Nonnull QueryComponent filter)
public RecordQueryFilterPlan(@Nonnull ExpressionRef<RecordQueryPlan> inner, @Nonnull QueryComponent filter)
public RecordQueryFilterPlan(@Nonnull RecordQueryPlan inner, @Nonnull List<QueryComponent> filters)
protected boolean hasAsyncFilter()
@Nullable protected <M extends Message> Boolean evalFilter(@Nonnull FDBRecordStoreBase<M> store, @Nonnull EvaluationContext context, @Nullable FDBRecord<M> record)
@Nullable protected <M extends Message> CompletableFuture<Boolean> evalFilterAsync(@Nonnull FDBRecordStoreBase<M> store, @Nonnull EvaluationContext context, @Nullable FDBRecord<M> record)
public boolean isReverse()
QueryPlan
true
if the plan
returns elements in descending order and false
if the elements are
returned in ascending order.isReverse
in interface QueryPlan<FDBQueriedRecord<Message>>
true
if this plan returns elements in reverse order@Nonnull @API(value=EXPERIMENTAL) public Iterator<? extends ExpressionRef<? extends RelationalExpression>> getPlannerExpressionChildren()
RelationalExpression
Collections.emptyIterator()
is returned. The returned iterator should
be treated as an immutable object and may throw an exception if Iterator.remove()
is called.
The iterator must return its elements in a consistent order.getPlannerExpressionChildren
in interface RelationalExpression
public boolean equalsWithoutChildren(@Nonnull RelationalExpression otherExpression)
public int planHash()
PlanHashable
hashCode
, but with the additional guarantee that is is stable across JVMs.@Nonnull public QueryComponent getFilter()
@Nonnull public <M extends Message> RecordCursor<FDBQueriedRecord<M>> execute(@Nonnull FDBRecordStoreBase<M> store, @Nonnull EvaluationContext context, @Nullable byte[] continuation, @Nonnull ExecuteProperties executeProperties)
RecordQueryPlan
execute
in interface RecordQueryPlan
M
- type used to represent stored recordsstore
- record store from which to fetch recordscontext
- evaluation context containing parameter bindingscontinuation
- continuation from a previous execution of this same planexecuteProperties
- limits on execution@Nonnull public RecordQueryPlan getInner()
public boolean hasRecordScan()
QueryPlan
hasRecordScan
in interface QueryPlan<FDBQueriedRecord<Message>>
hasRecordScan
in interface RecordQueryPlanWithChild
hasRecordScan
in interface RecordQueryPlanWithChildren
true
if this plan (or one of its components) scans at least a subset of the records directlypublic boolean hasFullRecordScan()
QueryPlan
hasRecordScan
for the comparison between two methods.hasFullRecordScan
in interface QueryPlan<FDBQueriedRecord<Message>>
hasFullRecordScan
in interface RecordQueryPlanWithChild
hasFullRecordScan
in interface RecordQueryPlanWithChildren
true
if this plan (or one of its components) must perform a scan over all records in the
store directlypublic boolean hasIndexScan(@Nonnull String indexName)
QueryPlan
hasIndexScan
in interface QueryPlan<FDBQueriedRecord<Message>>
hasIndexScan
in interface RecordQueryPlanWithChild
hasIndexScan
in interface RecordQueryPlanWithChildren
indexName
- the name of the index to check fortrue
if this plan (or one of its children) scans the given index@Nonnull public Set<String> getUsedIndexes()
QueryPlan
getUsedIndexes
in interface QueryPlan<FDBQueriedRecord<Message>>
getUsedIndexes
in interface RecordQueryPlanWithChild
getUsedIndexes
in interface RecordQueryPlanWithChildren
@Nonnull public RecordQueryPlan getChild()
getChild
in interface RecordQueryPlanWithChild
public void logPlanStructure(StoreTimer timer)
QueryPlan
StoreTimer
counter for each plan and subplan of this plan, allowing tracking
of which plans are being chosen (e.g. index scan vs. full scan).logPlanStructure
in interface QueryPlan<FDBQueriedRecord<Message>>
timer
- the counters to incrementpublic int getComplexity()
QueryPlan
getComplexity
in interface QueryPlan<FDBQueriedRecord<Message>>