Class LocalStreamEnvironment

  • All Implemented Interfaces:
    AutoCloseable

    @Public
    public class LocalStreamEnvironment
    extends StreamExecutionEnvironment
    The LocalStreamEnvironment is a StreamExecutionEnvironment that runs the program locally, multi-threaded, in the JVM where the environment is instantiated. It spawns an embedded Flink cluster in the background and executes the program on that cluster.
    • Constructor Detail

      • LocalStreamEnvironment

        public LocalStreamEnvironment()
        Creates a new mini cluster stream environment that uses the default configuration.
      • LocalStreamEnvironment

        public LocalStreamEnvironment​(@Nonnull
                                      org.apache.flink.configuration.Configuration configuration)
        Creates a new mini cluster stream environment that configures its local executor with the given configuration.
        Parameters:
        configuration - The configuration used to configure the local executor.
    • Method Detail

      • execute

        public org.apache.flink.api.common.JobExecutionResult execute​(StreamGraph streamGraph)
                                                               throws Exception
        Description copied from class: StreamExecutionEnvironment
        Triggers the program execution. The environment will execute all parts of the program that have resulted in a "sink" operation. Sink operations are for example printing results or forwarding them to a message queue.
        Overrides:
        execute in class StreamExecutionEnvironment
        Parameters:
        streamGraph - the stream graph representing the transformations
        Returns:
        The result of the job execution, containing elapsed time and accumulators.
        Throws:
        Exception - which occurs during job execution.