Class TestStreamEnvironment

    • Method Detail

      • setAsContext

        public static void setAsContext​(MiniCluster miniCluster,
                                        int parallelism,
                                        Collection<Path> jarFiles,
                                        Collection<URL> classpaths)
        Sets the streaming context environment to a TestStreamEnvironment that runs its programs on the given cluster with the given default parallelism and the specified jar files and class paths.
        Parameters:
        miniCluster - The MiniCluster to execute jobs on.
        parallelism - The default parallelism for the test programs.
        jarFiles - Additional jar files to execute the job with
        classpaths - Additional class paths to execute the job with
      • setAsContext

        public void setAsContext()
      • setAsContext

        public static void setAsContext​(MiniCluster miniCluster,
                                        int parallelism)
        Sets the streaming context environment to a TestStreamEnvironment that runs its programs on the given cluster with the given default parallelism.
        Parameters:
        miniCluster - The MiniCluster to execute jobs on.
        parallelism - The default parallelism for the test programs.
      • unsetAsContext

        public static void unsetAsContext()
        Resets the streaming context environment to null.
      • execute

        public JobExecutionResult execute​(String jobName)
                                   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.

        The program execution will be logged and displayed with the provided name

        Overrides:
        execute in class StreamExecutionEnvironment
        Parameters:
        jobName - Desired name of the job
        Returns:
        The result of the job execution, containing elapsed time and accumulators.
        Throws:
        Exception - which occurs during job execution.
      • executeAsync

        public JobClient executeAsync​(String jobName)
                               throws Exception
        Description copied from class: StreamExecutionEnvironment
        Triggers the program execution asynchronously. 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.

        The program execution will be logged and displayed with the provided name

        Overrides:
        executeAsync in class StreamExecutionEnvironment
        Parameters:
        jobName - desired name of the job
        Returns:
        A JobClient that can be used to communicate with the submitted job, completed on submission succeeded.
        Throws:
        Exception - which occurs during job execution.