public class TestStreamEnvironment extends StreamExecutionEnvironment
StreamExecutionEnvironment
that executes its jobs on LocalFlinkMiniCluster
.cacheFile, DEFAULT_JOB_NAME, isChainingEnabled, transformations
Constructor and Description |
---|
TestStreamEnvironment(LocalFlinkMiniCluster miniCluster,
int parallelism) |
TestStreamEnvironment(LocalFlinkMiniCluster miniCluster,
int parallelism,
Collection<Path> jarFiles,
Collection<URL> classPaths) |
Modifier and Type | Method and Description |
---|---|
JobExecutionResult |
execute(String jobName)
Triggers the program execution.
|
static void |
setAsContext(LocalFlinkMiniCluster cluster,
int parallelism)
Sets the streaming context environment to a TestStreamEnvironment that runs its programs on
the given cluster with the given default parallelism.
|
static void |
setAsContext(LocalFlinkMiniCluster cluster,
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.
|
static void |
unsetAsContext()
Resets the streaming context environment to null.
|
addDefaultKryoSerializer, addDefaultKryoSerializer, addOperator, addSource, addSource, addSource, addSource, clean, createInput, createInput, createLocalEnvironment, createLocalEnvironment, createLocalEnvironment, createLocalEnvironmentWithWebUI, createRemoteEnvironment, createRemoteEnvironment, createRemoteEnvironment, disableOperatorChaining, enableCheckpointing, enableCheckpointing, enableCheckpointing, enableCheckpointing, execute, fromCollection, fromCollection, fromCollection, fromCollection, fromElements, fromElements, fromParallelCollection, fromParallelCollection, generateSequence, getBufferTimeout, getCachedFiles, getCheckpointConfig, getCheckpointingMode, getCheckpointInterval, getConfig, getDefaultLocalParallelism, getExecutionEnvironment, getExecutionPlan, getMaxParallelism, getNumberOfExecutionRetries, getParallelism, getRestartStrategy, getStateBackend, getStreamGraph, getStreamTimeCharacteristic, initializeContextEnvironment, isChainingEnabled, isForceCheckpointing, readFile, readFile, readFile, readFile, readFileStream, readTextFile, readTextFile, registerCachedFile, registerCachedFile, registerType, registerTypeWithKryoSerializer, registerTypeWithKryoSerializer, resetContextEnvironment, setBufferTimeout, setDefaultLocalParallelism, setMaxParallelism, setNumberOfExecutionRetries, setParallelism, setRestartStrategy, setStateBackend, setStreamTimeCharacteristic, socketTextStream, socketTextStream, socketTextStream, socketTextStream, socketTextStream
public TestStreamEnvironment(LocalFlinkMiniCluster miniCluster, int parallelism, Collection<Path> jarFiles, Collection<URL> classPaths)
public TestStreamEnvironment(LocalFlinkMiniCluster miniCluster, int parallelism)
public JobExecutionResult execute(String jobName) throws Exception
StreamExecutionEnvironment
The program execution will be logged and displayed with the provided name
execute
in class StreamExecutionEnvironment
jobName
- Desired name of the jobException
- which occurs during job execution.public static void setAsContext(LocalFlinkMiniCluster cluster, int parallelism, Collection<Path> jarFiles, Collection<URL> classpaths)
cluster
- The test cluster to run the test program on.parallelism
- The default parallelism for the test programs.jarFiles
- Additional jar files to execute the job withclasspaths
- Additional class paths to execute the job withpublic static void setAsContext(LocalFlinkMiniCluster cluster, int parallelism)
cluster
- The test cluster to run the test program on.parallelism
- The default parallelism for the test programs.public static void unsetAsContext()
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.