use of org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentFactory in project flink by apache.
the class TestStreamEnvironment method setAsContext.
/**
* 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.
*
* @param miniCluster The MiniCluster to execute jobs on.
* @param parallelism The default parallelism for the test programs.
* @param jarFiles Additional jar files to execute the job with
* @param classpaths Additional class paths to execute the job with
*/
public static void setAsContext(final MiniCluster miniCluster, final int parallelism, final Collection<Path> jarFiles, final Collection<URL> classpaths) {
StreamExecutionEnvironmentFactory factory = conf -> {
TestStreamEnvironment env = new TestStreamEnvironment(miniCluster, conf, parallelism, jarFiles, classpaths);
randomizeConfiguration(miniCluster, conf);
env.configure(conf, env.getUserClassloader());
return env;
};
initializeContextEnvironment(factory);
}
Aggregations