Class RecordQueryIntersectionPlan

    • Field Detail

      • LOGGER

        public static final org.slf4j.Logger LOGGER
    • Method Detail

      • isReverse

        public boolean isReverse()
        Description copied from interface: QueryPlan
        Indicates whether this plan will return values in "reverse" order from the natural order of results of this plan. The return value is true if the plan returns elements in descending order and false if the elements are returned in ascending order.
        Specified by:
        isReverse in interface QueryPlan<FDBQueriedRecord<Message>>
        Returns:
        true if this plan returns elements in reverse order
      • getChildren

        @Nonnull
        public List<RecordQueryPlan> getChildren()
        Description copied from interface: RecordQueryPlan
        Returns the (zero or more) 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 QueryPlans. At current, every RecordQueryPlan can only have other RecordQueryPlans 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.

        Specified by:
        getChildren in interface RecordQueryPlan
        Returns:
        the child plans
      • getQuantifiers

        @Nonnull
        @API(EXPERIMENTAL)
        public List<? extends Quantifier> getQuantifiers()
        Description copied from interface: RelationalExpression
        Return an iterator of references to the children of this planner expression. The iterators returned by different calls are guaranteed to be independent (i.e., advancing one will not advance another). However, they might point to the same object, as when 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.
        Specified by:
        getQuantifiers in interface RelationalExpression
        Returns:
        an iterator of references to the children of this planner expression
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • planHash

        public int planHash()
        Description copied from interface: PlanHashable
        Return a hash similar to hashCode, but with the additional guarantee that is is stable across JVMs.
        Specified by:
        planHash in interface PlanHashable
        Returns:
        a stable hash code
      • logPlanStructure

        public void logPlanStructure​(StoreTimer timer)
        Description copied from interface: QueryPlan
        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. index scan vs. full scan).
        Specified by:
        logPlanStructure in interface QueryPlan<FDBQueriedRecord<Message>>
        Parameters:
        timer - the counters to increment
      • getComplexity

        public int getComplexity()
        Description copied from interface: QueryPlan
        Returns an integer representing the "complexity" of the generated plan. Currently, this should simply be the number of plans in the plan tree with this plan as the root (i.e. the number of descendants of this plan, including itself).
        Specified by:
        getComplexity in interface QueryPlan<FDBQueriedRecord<Message>>
        Returns:
        the complexity of this plan
      • from

        @Nonnull
        public static RecordQueryIntersectionPlan from​(@Nonnull
                                                       RecordQueryPlan left,
                                                       @Nonnull
                                                       RecordQueryPlan right,
                                                       @Nonnull
                                                       KeyExpression comparisonKey)
        Construct a new union of two compatibly-ordered plans. The resulting plan will return all results that are returned by both the left or right child plans. Each plan should return results in the same order according to the provided comparisonKey. The two children should also either both return results in forward order, or they should both return results in reverse order. (That is, left.isReverse() should equal right.isReverse().)
        Parameters:
        left - the first plan to intersect
        right - the second plan to intersect
        comparisonKey - a key expression by which the results of both plans are ordered
        Returns:
        a new plan that will return the intersection of all results from both child plans
      • from

        @Nonnull
        public static RecordQueryIntersectionPlan from​(@Nonnull
                                                       List<RecordQueryPlan> children,
                                                       @Nonnull
                                                       KeyExpression comparisonKey)
        Construct a new union of two or more compatibly-ordered plans. The resulting plan will return all results that are returned by all of the child plans. Each plan should return results in the same order according to the provided comparisonKey. The children should also either all return results in forward order, or they should all return results in reverse order. (That is, QueryPlan.isReverse() should return the same value for each child.)
        Parameters:
        children - the list of plans to take the intersection of
        comparisonKey - a key expression by which the results of both plans are ordered
        Returns:
        a new plan that will return the intersection of all results from both child plans
      • rewritePlannerGraph

        @Nonnull
        public PlannerGraph rewritePlannerGraph​(@Nonnull
                                                List<? extends PlannerGraph> childGraphs)
        Description copied from interface: PlannerGraphRewritable
        Method to rewrite the planner graph.
        Specified by:
        rewritePlannerGraph in interface PlannerGraphRewritable
        Parameters:
        childGraphs - planner graphs of children expression that already have been computed
        Returns:
        a new planner graph that can combine the childGraphs in a meaningful way. Note that there is no obligation to use the childGraphs at all, this method can create a new independent planner graph completely from scratch.