Package org.apache.flink.streaming.util
Class TestStreamEnvironment
java.lang.Object
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
org.apache.flink.streaming.util.TestStreamEnvironment
- All Implemented Interfaces:
AutoCloseable
public class TestStreamEnvironment
extends org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
A
StreamExecutionEnvironment that executes its jobs on MiniCluster.-
Field Summary
Fields inherited from class org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
cacheFile, checkpointCfg, config, configuration, transformations -
Constructor Summary
ConstructorsConstructorDescriptionTestStreamEnvironment(org.apache.flink.runtime.minicluster.MiniCluster miniCluster, int parallelism) TestStreamEnvironment(org.apache.flink.runtime.minicluster.MiniCluster miniCluster, org.apache.flink.configuration.Configuration config, int parallelism, Collection<org.apache.flink.core.fs.Path> jarFiles, Collection<URL> classPaths) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.flink.api.common.JobExecutionResultorg.apache.flink.core.execution.JobClientexecuteAsync(String jobName) org.apache.flink.api.common.JobExecutionResultvoidstatic voidsetAsContext(org.apache.flink.runtime.minicluster.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.static voidsetAsContext(org.apache.flink.runtime.minicluster.MiniCluster miniCluster, int parallelism, Collection<org.apache.flink.core.fs.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 voidResets the streaming context environment to null.Methods inherited from class org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
addOperator, addSource, addSource, addSource, addSource, areExplicitEnvironmentsAllowed, clean, clearJobListeners, close, configure, configure, createInput, createInput, createLocalEnvironment, createLocalEnvironment, createLocalEnvironment, createLocalEnvironment, createLocalEnvironmentWithWebUI, createRemoteEnvironment, createRemoteEnvironment, createRemoteEnvironment, disableOperatorChaining, enableChangelogStateBackend, enableCheckpointing, enableCheckpointing, enableCheckpointing, execute, execute, executeAsync, executeAsync, fromCollection, fromCollection, fromCollection, fromCollection, fromData, fromData, fromData, fromData, fromData, fromElements, fromElements, fromParallelCollection, fromParallelCollection, fromSequence, fromSource, fromSource, generateSequence, generateStreamGraph, getBufferTimeout, getCachedFiles, getCheckpointConfig, getCheckpointingConsistencyMode, getCheckpointingMode, getCheckpointInterval, getConfig, getConfiguration, getDefaultLocalParallelism, getDefaultSavepointDirectory, getExecutionEnvironment, getExecutionEnvironment, getExecutionPlan, getJobListeners, getMaxParallelism, getParallelism, getStreamGraph, getStreamGraph, getTransformations, getUserClassloader, initializeContextEnvironment, invalidateClusterDataset, isChainingEnabled, isChainingOfOperatorsWithDifferentMaxParallelismEnabled, isChangelogStateBackendEnabled, isForceUnalignedCheckpoints, isUnalignedCheckpointsEnabled, listCompletedClusterDatasets, readFile, readFile, readFile, readFile, readFileStream, registerCachedFile, registerCachedFile, registerCacheTransformation, registerCollectIterator, registerJobListener, registerSlotSharingGroup, resetContextEnvironment, setBufferTimeout, setDefaultLocalParallelism, setDefaultSavepointDirectory, setDefaultSavepointDirectory, setDefaultSavepointDirectory, setMaxParallelism, setParallelism, setRuntimeMode, socketTextStream, socketTextStream, socketTextStream, socketTextStream, socketTextStream
-
Constructor Details
-
TestStreamEnvironment
public TestStreamEnvironment(org.apache.flink.runtime.minicluster.MiniCluster miniCluster, org.apache.flink.configuration.Configuration config, int parallelism, Collection<org.apache.flink.core.fs.Path> jarFiles, Collection<URL> classPaths) -
TestStreamEnvironment
public TestStreamEnvironment(org.apache.flink.runtime.minicluster.MiniCluster miniCluster, int parallelism)
-
-
Method Details
-
setAsContext
public static void setAsContext(org.apache.flink.runtime.minicluster.MiniCluster miniCluster, int parallelism, Collection<org.apache.flink.core.fs.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 withclasspaths- Additional class paths to execute the job with
-
setAsContext
public void setAsContext() -
setAsContext
public static void setAsContext(org.apache.flink.runtime.minicluster.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
- Overrides:
executein classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment- Throws:
Exception
-
executeAsync
- Overrides:
executeAsyncin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment- Throws:
Exception
-
getLastJobExecutionResult
public org.apache.flink.api.common.JobExecutionResult getLastJobExecutionResult()
-