@API(value=STABLE) public interface RecordQueryPlan extends QueryPlan<FDBQueriedRecord<Message>>
Modifier and Type | Method and Description |
---|---|
default ExpressionRef<RelationalPlannerExpression> |
asNestedWith(NestedContext nestedContext,
ExpressionRef<RelationalPlannerExpression> thisRef)
Produce an exactly equivalent version of the
PlannerExpression tree rooted at this
RelationalPlannerExpression as if all operations were nested inside the given NestedContext . |
default ExpressionRef<RelationalPlannerExpression> |
asUnnestedWith(NestedContext nestedContext,
ExpressionRef<RelationalPlannerExpression> thisRef)
Produce an exactly equivalent version of the
PlannerExpression tree rooted at this
RelationalPlannerExpression with all operations placed inside the field given by the NestedContext . |
default <M extends Message> |
execute(FDBRecordStoreBase<M> store)
Execute this query plan.
|
default <M extends Message> |
execute(FDBRecordStoreBase<M> store,
EvaluationContext context)
Execute this query plan.
|
<M extends Message> |
execute(FDBRecordStoreBase<M> store,
EvaluationContext context,
byte[] continuation,
ExecuteProperties executeProperties)
Execute this query plan.
|
default RecordCursor<FDBQueriedRecord<Message>> |
execute(FDBRecordStore store,
EvaluationContext context,
byte[] continuation,
ExecuteProperties executeProperties)
Execute this query plan.
|
List<RecordQueryPlan> |
getChildren()
Returns the (zero or more)
RecordQueryPlan children of this plan. |
default List<? extends QueryPlan<?>> |
getQueryPlanChildren()
Returns the (zero or more) child
QueryPlan s of this plan. |
execute, execute, getComplexity, getUsedIndexes, hasFullRecordScan, hasIndexScan, hasRecordScan, isReverse, logPlanStructure
combineHashes, iterablePlanHash, objectPlanHash, objectsPlanHash, planHash, planHash, planHash, planHashUnordered, stringHashUnordered
fromRecordQuery
acceptPropertyVisitor, bindTo, equalsWithoutChildren, getPlannerExpressionChildren
@Nonnull <M extends Message> RecordCursor<FDBQueriedRecord<M>> execute(@Nonnull FDBRecordStoreBase<M> store, @Nonnull EvaluationContext context, @Nullable byte[] continuation, @Nonnull ExecuteProperties executeProperties)
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 default RecordCursor<FDBQueriedRecord<Message>> execute(@Nonnull FDBRecordStore store, @Nonnull EvaluationContext context, @Nullable byte[] continuation, @Nonnull ExecuteProperties executeProperties)
QueryPlan
execute
in interface QueryPlan<FDBQueriedRecord<Message>>
store
- record store from which to fetch itemscontext
- evaluation context containing parameter bindingscontinuation
- continuation from a previous execution of this same planexecuteProperties
- limits on execution@Nonnull default <M extends Message> RecordCursor<FDBQueriedRecord<M>> execute(@Nonnull FDBRecordStoreBase<M> store)
M
- type used to represent stored recordsstore
- record store from which to fetch records@Nonnull default <M extends Message> RecordCursor<FDBQueriedRecord<M>> execute(@Nonnull FDBRecordStoreBase<M> store, @Nonnull EvaluationContext context)
M
- type used to represent stored recordsstore
- record store to accesscontext
- evaluation context containing parameter bindings@API(value=UNSTABLE) @Nonnull List<RecordQueryPlan> getChildren()
RecordQueryPlan
children of this plan.
Warning: This part of the API is undergoing active development. At some point in the future,
the return type of this method will change to allow it to return a list of generic QueryPlan
s.
At current, every RecordQueryPlan
can only have other RecordQueryPlan
s as children.
However, this is not guaranteed to be the case in the future. This method has been marked as
API.Status#UNSTABLE
as of version 2.5.
@Nonnull default List<? extends QueryPlan<?>> getQueryPlanChildren()
QueryPlan
QueryPlan
s of this plan. These children may or may not
return elements of the same type as their parent plan.
Warning: This part of the API is currently undergoing active development. At some point in
the future, this will be renamed getChildren()
. This cannot be done at current, however,
as it would require an incompatible change to getChildren()
. That method
has been marked API.Status#UNSTABLE
as of version 2.5.
getQueryPlanChildren
in interface QueryPlan<FDBQueriedRecord<Message>>
@Nullable @API(value=EXPERIMENTAL) default ExpressionRef<RelationalPlannerExpression> asNestedWith(@Nonnull NestedContext nestedContext, @Nonnull ExpressionRef<RelationalPlannerExpression> thisRef)
RelationalPlannerExpression
PlannerExpression
tree rooted at this
RelationalPlannerExpression
as if all operations were nested inside the given NestedContext
. That
is, transform all predicates, index scans, and other operations to the form that they would have if they were
nested within the field given by the parent field of the given nested context. If it is not possible to produce
such an expression, return null
.
With RelationalPlannerExpression.asUnnestedWith(NestedContext, ExpressionRef)
, this method should obey the contract that, for any
expression
and nestedContext
,
expression.asNestedWith(nestedContext, ref).asUnnestedWith(nestedContext, ref)
is either equal to
expression
(according to the equals()
comparison) or null
.
For example, if this expression is a filter on the predicate field("a").matches(field("b).equals(3))
,
with an inner FullUnorderedScanExpression
, and the nestedContext
is built around
field("a")
, then this method would return a reference containing a logical filter on the predicate
field("b").equals(3
) with an inner FullUnorderedScanExpression
.
The thisRef
parameter has two uses. For some implementations of asNestedWith()
, the expression
does not need to be changed, and so it is more efficient to return the containing reference than to build a
new one. Additionally, it is used to generate a reference of the appropriate type using the
ExpressionRef.getNewRefWith(PlannerExpression)
.
asNestedWith
in interface RelationalPlannerExpression
nestedContext
- a context describing the field to use for nestingthisRef
- the reference that contains this relational planner expression@Nullable @API(value=DEPRECATED) default ExpressionRef<RelationalPlannerExpression> asUnnestedWith(@Nonnull NestedContext nestedContext, @Nonnull ExpressionRef<RelationalPlannerExpression> thisRef)
RelationalPlannerExpression
PlannerExpression
tree rooted at this
RelationalPlannerExpression
with all operations placed inside the field given by the NestedContext
.
That is, put all predicates, index scans, and other operations within the given nested field. If it is not possible
to produce such an expression, return null
.
With RelationalPlannerExpression.asNestedWith(NestedContext, ExpressionRef)
, this method should obey the contract that, for any
expression
and nestedContext
,
expression.asNestedWith(nestedContext, ref).asUnnestedWith(nestedContext, ref)
is either equal to
expression
(according to the equals()
comparison) or null
.
For example, if this expression is a logical filter on the predicate field("b).equals(3)
, with an inner
FullUnorderedScanExpression
, and the nestedContext
is built around field("a")
, then this
method would return a reference containing a logical filter on the predicate
field("a").matches(field("b").equals(3))
with an inner FullUnorderedScanExpression
.
The thisRef
parameter has two uses. For some implementations of asUnnestedWith()
, the expression
does not need to be changed, and so it is more efficient to return the containing reference than to build a
new one. Additionally, it is used to generate a reference of the appropriate type using the
ExpressionRef.getNewRefWith(PlannerExpression)
.
asUnnestedWith
in interface RelationalPlannerExpression
nestedContext
- a context describing the field to use for unnestingthisRef
- the reference that contains this expression