Class PlannerGraphProperty

    • Field Detail

      • FOR_EXPLAIN

        public static final int FOR_EXPLAIN
        Indicates if this property is computed for the purpose of creating an explain of the execution plan.
        See Also:
        Constant Field Values
      • RENDER_SINGLE_GROUPS

        public static final int RENDER_SINGLE_GROUPS
        Indicates if ExpressionRef instances that contain exactly one variation are rendered.
        See Also:
        Constant Field Values
      • REMOVE_LOGICAL_EXPRESSIONS

        public static final int REMOVE_LOGICAL_EXPRESSIONS
        See Also:
        Constant Field Values
    • Method Detail

      • show

        @Nonnull
        public static String show​(boolean renderSingleGroups,
                                  @Nonnull
                                  RelationalExpression relationalExpression)
        Show the planner expression that is passed in as a graph rendered in your default browser.
        Parameters:
        renderSingleGroups - iff true group references with just one member are not rendered
        relationalExpression - the planner expression to be rendered.
        Returns:
        the word "done" (IntelliJ really likes a return of String).
      • show

        @Nonnull
        public static String show​(boolean renderSingleGroups,
                                  @Nonnull
                                  GroupExpressionRef<? extends RelationalExpression> rootReference)
        Show the planner expression that is passed in as a graph rendered in your default browser.
        Parameters:
        renderSingleGroups - iff true group references with just one member are not rendered
        rootReference - the planner expression to be rendered.
        Returns:
        the word "done" (IntelliJ really likes a return of String).
      • show

        @Nonnull
        public static String show​(int flags,
                                  @Nonnull
                                  RelationalExpression relationalExpression)
        Show the planner expression that is passed in as a graph rendered in your default browser.
        Parameters:
        flags - iff true group references with just one member are not rendered
        relationalExpression - the planner expression to be rendered.
        Returns:
        the word "done" (IntelliJ really likes a return of String).
      • show

        @Nonnull
        public static String show​(int flags,
                                  @Nonnull
                                  GroupExpressionRef<? extends RelationalExpression> rootReference)
        Show the planner expression that is passed in as a graph rendered in your default browser.
        Parameters:
        flags - rendering options
        rootReference - the planner expression to be rendered.
        Returns:
        the word "done" (IntelliJ really likes a return of String).
      • show

        @Nonnull
        public static String show​(boolean renderSingleGroups,
                                  @Nonnull
                                  GroupExpressionRef<? extends RelationalExpression> queryPlanRootReference,
                                  @Nonnull
                                  Set<MatchCandidate> matchCandidates)
        Show the planner expression that and all the match candidates rendered in your default browser. This also shows PartialMatches between references if they exist.
        Parameters:
        renderSingleGroups - iff true group references with just one member are not rendered
        queryPlanRootReference - the planner expression to be rendered.
        matchCandidates - a set of candidates for matching which should also be shown
        Returns:
        the word "done" (IntelliJ really likes a return of String).
      • createHtmlLauncher

        @Nonnull
        public static URI createHtmlLauncher​(@Nonnull
                                             String dotString)
                                      throws Exception
        For debugging only! This method locates a template html launcher file from the resources folder and writes a specific launcher html file into a temp directory. If wanted the caller can open the html in a browser of choice.
        Parameters:
        dotString - -- a serialized planner graph
        Returns:
        a URI pointing to an html file in a temp location which renders the graph
        Throws:
        Exception - -- thrown from methods called in here.
      • explain

        @Nonnull
        public static String explain​(@Nonnull
                                     RelationalExpression relationalExpression)
        Generate the explain of the planner expression that is passed in.
        Parameters:
        relationalExpression - the planner expression to be explained.
        Returns:
        the explain of the planner expression handing in as a string in GML format.
      • explain

        @Nonnull
        public static String explain​(@Nonnull
                                     RelationalExpression relationalExpression,
                                     @Nonnull
                                     Map<String,​Attribute> additionalDescriptionMap)
        Generate the explain of the planner expression that is passed in.
        Parameters:
        relationalExpression - the planner expression to be explained.
        additionalDescriptionMap - a map used to generate names and descriptions for operators.
        Returns:
        the explain of the planner expression handing in as a string in GML format.
      • exportToGml

        @Nonnull
        public static String exportToGml​(@Nonnull
                                         PlannerGraph plannerGraph,
                                         @Nonnull
                                         Map<String,​Attribute> additionalInfoMap)
        Creates a serialized format of this graph as a gml-compatible definition.
        Parameters:
        plannerGraph - the planner graph to be exported
        additionalInfoMap - a map used to generate names and descriptions for operators.
        Returns:
        the graph as string in gml format.
      • forInternalShow

        public static PlannerGraphProperty forInternalShow​(boolean renderSingleGroups)
      • forInternalShow

        public static PlannerGraphProperty forInternalShow​(boolean renderSingleGroups,
                                                           boolean removePlans)
      • isForExplain

        public boolean isForExplain()
      • renderSingleGroups

        public boolean renderSingleGroups()
      • removePlansIfPossible

        public boolean removePlansIfPossible()
      • removeLogicalExpressions

        public boolean removeLogicalExpressions()
      • evaluateAtExpression

        @Nonnull
        public PlannerGraph evaluateAtExpression​(@Nonnull
                                                 RelationalExpression expression,
                                                 @Nonnull
                                                 List<PlannerGraph> childGraphs)
        Description copied from interface: PlannerProperty
        Evaluate the property at the given expression, using the results of evaluating the property at its children. Called on nodes in the graph in visit post-order of the depth-first traversal of the graph. That is, as each expression is visited (after all of its children have been visited, if applicable), evaluateAtExpression() is called on that expression.
        Specified by:
        evaluateAtExpression in interface PlannerProperty<PlannerGraph>
        Parameters:
        expression - the cursor to visit
        childGraphs - the results of the property evaluated at the children of expression
        Returns:
        the value of property at the given expression
      • evaluateAtRef

        @Nonnull
        public PlannerGraph evaluateAtRef​(@Nonnull
                                          ExpressionRef<? extends RelationalExpression> ref,
                                          @Nonnull
                                          List<PlannerGraph> memberResults)
        Description copied from interface: PlannerProperty
        Evaluate the property at the given reference, using the results of evaluating the property at its members. Called on nodes in the graph in visit post-order of the depth-first traversal of the graph. That is, as each reference is visited (after all of its members have been visited, if applicable), evaluateAtRef() is called on that reference.
        Specified by:
        evaluateAtRef in interface PlannerProperty<PlannerGraph>
        Parameters:
        ref - the expression reference to visit
        memberResults - the results of the property evaluated at the members of ref
        Returns:
        the value of property at the given reference