Class JobGraphGenerator

  • All Implemented Interfaces:
    org.apache.flink.util.Visitor<PlanNode>

    public class JobGraphGenerator
    extends Object
    implements org.apache.flink.util.Visitor<PlanNode>
    This component translates the optimizer's resulting OptimizedPlan to a JobGraph. The translation is not strictly a one-to-one, because some nodes from the OptimizedPlan are collapsed into one job vertex.

    This translation does not make any decisions or assumptions. All degrees-of-freedom in the execution of the job are made by the Optimizer, so that this translation becomes a deterministic mapping.

    The basic method of operation is a top down traversal over the plan graph. On the way down, job vertices are created for the plan nodes, on the way back up, the nodes connect their predecessors.

    • Constructor Detail

      • JobGraphGenerator

        public JobGraphGenerator()
        Creates a new job graph generator that uses the default values for its resource configuration.
      • JobGraphGenerator

        public JobGraphGenerator​(org.apache.flink.configuration.Configuration config)
    • Method Detail

      • compileJobGraph

        public org.apache.flink.runtime.jobgraph.JobGraph compileJobGraph​(OptimizedPlan program)
        Translates a OptimizedPlan into a JobGraph.
        Parameters:
        program - Optimized plan that is translated into a JobGraph.
        Returns:
        JobGraph generated from the plan.
      • compileJobGraph

        public org.apache.flink.runtime.jobgraph.JobGraph compileJobGraph​(OptimizedPlan program,
                                                                          org.apache.flink.api.common.JobID jobId)
      • preVisit

        public boolean preVisit​(PlanNode node)
        This methods implements the pre-visiting during a depth-first traversal. It create the job vertex and sets local strategy.
        Specified by:
        preVisit in interface org.apache.flink.util.Visitor<PlanNode>
        Parameters:
        node - The node that is currently processed.
        Returns:
        True, if the visitor should descend to the node's children, false if not.
        See Also:
        Visitor.preVisit(org.apache.flink.util.Visitable)
      • postVisit

        public void postVisit​(PlanNode node)
        This method implements the post-visit during the depth-first traversal. When the post visit happens, all of the descendants have been processed, so this method connects all of the current node's predecessors to the current node.
        Specified by:
        postVisit in interface org.apache.flink.util.Visitor<PlanNode>
        Parameters:
        node - The node currently processed during the post-visit.
        See Also:
        t