Class Plan

  • All Implemented Interfaces:
    Pipeline, Visitable<Operator<?>>

    @Internal
    public class Plan
    extends Object
    implements Visitable<Operator<?>>, Pipeline
    This class represents Flink programs, in the form of dataflow plans.

    The dataflow is referenced by the data sinks, from which all connected operators of the data flow can be reached via backwards traversal.

    • Field Detail

      • sinks

        protected final List<GenericDataSinkBase<?>> sinks
        A collection of all sinks in the plan. Since the plan is traversed from the sinks to the sources, this collection must contain all the sinks.
      • jobName

        protected String jobName
        The name of the job.
      • defaultParallelism

        protected int defaultParallelism
        The default parallelism to use for nodes that have no explicitly specified parallelism.
      • executionConfig

        protected ExecutionConfig executionConfig
        Config object for runtime execution parameters.
    • Constructor Detail

      • Plan

        public Plan​(Collection<? extends GenericDataSinkBase<?>> sinks,
                    String jobName)
        Creates a new dataflow plan with the given name, describing the data flow that ends at the given data sinks.

        If not all of the sinks of a data flow are given to the plan, the flow might not be translated entirely.

        Parameters:
        sinks - The collection will the sinks of the job's data flow.
        jobName - The name to display for the job.
      • Plan

        public Plan​(Collection<? extends GenericDataSinkBase<?>> sinks,
                    String jobName,
                    int defaultParallelism)
        Creates a new program plan with the given name and default parallelism, describing the data flow that ends at the given data sinks.

        If not all of the sinks of a data flow are given to the plan, the flow might not be translated entirely.

        Parameters:
        sinks - The collection will the sinks of the job's data flow.
        jobName - The name to display for the job.
        defaultParallelism - The default parallelism for the job.
      • Plan

        public Plan​(GenericDataSinkBase<?> sink,
                    String jobName)
        Creates a new program plan with the given name, containing initially a single data sink.

        If not all of the sinks of a data flow are given, the flow might not be translated entirely, but only the parts of the flow reachable by traversing backwards from the given data sinks.

        Parameters:
        sink - The data sink of the data flow.
        jobName - The name to display for the job.
      • Plan

        public Plan​(GenericDataSinkBase<?> sink,
                    String jobName,
                    int defaultParallelism)
        Creates a new program plan with the given name and default parallelism, containing initially a single data sink.

        If not all of the sinks of a data flow are given, the flow might not be translated entirely, but only the parts of the flow reachable by traversing backwards from the given data sinks.

        Parameters:
        sink - The data sink of the data flow.
        jobName - The name to display for the job.
        defaultParallelism - The default parallelism for the job.
      • Plan

        public Plan​(Collection<? extends GenericDataSinkBase<?>> sinks)
        Creates a new program plan, describing the data flow that ends at the given data sinks. The display name for the job is generated using a timestamp.

        If not all of the sinks of a data flow are given, the flow might not be translated entirely, but only the parts of the flow reachable by traversing backwards from the given data sinks.

        Parameters:
        sinks - The collection will the sinks of the data flow.
      • Plan

        public Plan​(Collection<? extends GenericDataSinkBase<?>> sinks,
                    int defaultParallelism)
        Creates a new program plan with the given default parallelism, describing the data flow that ends at the given data sinks. The display name for the job is generated using a timestamp.

        If not all of the sinks of a data flow are given, the flow might not be translated entirely, but only the parts of the flow reachable by traversing backwards from the given data sinks.

        Parameters:
        sinks - The collection will the sinks of the data flow.
        defaultParallelism - The default parallelism for the job.
      • Plan

        public Plan​(GenericDataSinkBase<?> sink)
        Creates a new program plan with single data sink. The display name for the job is generated using a timestamp.

        If not all of the sinks of a data flow are given to the plan, the flow might not be translated entirely.

        Parameters:
        sink - The data sink of the data flow.
      • Plan

        public Plan​(GenericDataSinkBase<?> sink,
                    int defaultParallelism)
        Creates a new program plan with single data sink and the given default parallelism. The display name for the job is generated using a timestamp.

        If not all of the sinks of a data flow are given to the plan, the flow might not be translated entirely.

        Parameters:
        sink - The data sink of the data flow.
        defaultParallelism - The default parallelism for the job.
    • Method Detail

      • addDataSink

        public void addDataSink​(GenericDataSinkBase<?> sink)
        Adds a data sink to the set of sinks in this program.
        Parameters:
        sink - The data sink to add.
      • getDataSinks

        public Collection<? extends GenericDataSinkBase<?>> getDataSinks()
        Gets all the data sinks of this job.
        Returns:
        All sinks of the program.
      • getJobName

        public String getJobName()
        Gets the name of this job.
        Returns:
        The name of the job.
      • setJobName

        public void setJobName​(String jobName)
        Sets the jobName for this Plan.
        Parameters:
        jobName - The jobName to set.
      • getJobId

        public JobID getJobId()
        Gets the ID of the job that the dataflow plan belongs to. If this ID is not set, then the dataflow represents its own independent job.
        Returns:
        The ID of the job that the dataflow plan belongs to.
      • setJobId

        public void setJobId​(JobID jobId)
        Sets the ID of the job that the dataflow plan belongs to. If this ID is set to null, then the dataflow represents its own independent job.
        Parameters:
        jobId - The ID of the job that the dataflow plan belongs to.
      • getDefaultParallelism

        public int getDefaultParallelism()
        Gets the default parallelism for this job. That degree is always used when an operator is not explicitly given a parallelism.
        Returns:
        The default parallelism for the plan.
      • setDefaultParallelism

        public void setDefaultParallelism​(int defaultParallelism)
        Sets the default parallelism for this plan. That degree is always used when an operator is not explicitly given a parallelism.
        Parameters:
        defaultParallelism - The default parallelism for the plan.
      • getPostPassClassName

        public String getPostPassClassName()
        Gets the optimizer post-pass class for this job. The post-pass typically creates utility classes for data types and is specific to a particular data model (record, tuple, Scala, ...)
        Returns:
        The name of the class implementing the optimizer post-pass.
      • getExecutionConfig

        public ExecutionConfig getExecutionConfig()
        Gets the execution config object.
        Returns:
        The execution config object.
      • setExecutionConfig

        public void setExecutionConfig​(ExecutionConfig executionConfig)
        Sets the runtime config object defining execution parameters.
        Parameters:
        executionConfig - The execution config to use.
      • getMaximumParallelism

        public int getMaximumParallelism()
      • setJobConfiguration

        public void setJobConfiguration​(Configuration jobConfiguration)
      • getJobConfiguration

        public Configuration getJobConfiguration()