Package org.apache.flink.client.program
Class StreamContextEnvironment
- java.lang.Object
-
- org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
- org.apache.flink.client.program.StreamContextEnvironment
-
- All Implemented Interfaces:
AutoCloseable
@PublicEvolving public class StreamContextEnvironment extends StreamExecutionEnvironment
SpecialStreamExecutionEnvironment
that will be used in cases where the CLI client or testing utilities create aStreamExecutionEnvironment
that should be used whenStreamExecutionEnvironment.getExecutionEnvironment()
is called.
-
-
Field Summary
-
Fields inherited from class org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
cacheFile, checkpointCfg, config, configuration, transformations
-
-
Constructor Summary
Constructors Constructor Description StreamContextEnvironment(PipelineExecutorServiceLoader executorServiceLoader, Configuration configuration, ClassLoader userCodeClassLoader, boolean enforceSingleJobExecution, boolean suppressSysout)
StreamContextEnvironment(PipelineExecutorServiceLoader executorServiceLoader, Configuration clusterConfiguration, Configuration configuration, ClassLoader userCodeClassLoader, boolean enforceSingleJobExecution, boolean suppressSysout, boolean programConfigEnabled, Collection<String> programConfigWildcards)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JobExecutionResult
execute(StreamGraph streamGraph)
Triggers the program execution.JobClient
executeAsync(StreamGraph streamGraph)
Triggers the program execution asynchronously.static void
setAsContext(PipelineExecutorServiceLoader executorServiceLoader, Configuration clusterConfiguration, ClassLoader userCodeClassLoader, boolean enforceSingleJobExecution, boolean suppressSysout)
static void
unsetAsContext()
-
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 Detail
-
StreamContextEnvironment
public StreamContextEnvironment(PipelineExecutorServiceLoader executorServiceLoader, Configuration configuration, ClassLoader userCodeClassLoader, boolean enforceSingleJobExecution, boolean suppressSysout)
-
StreamContextEnvironment
@Internal public StreamContextEnvironment(PipelineExecutorServiceLoader executorServiceLoader, Configuration clusterConfiguration, Configuration configuration, ClassLoader userCodeClassLoader, boolean enforceSingleJobExecution, boolean suppressSysout, boolean programConfigEnabled, Collection<String> programConfigWildcards)
-
-
Method Detail
-
execute
public 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 classStreamExecutionEnvironment
- 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.
-
executeAsync
public JobClient executeAsync(StreamGraph streamGraph) 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.- Overrides:
executeAsync
in classStreamExecutionEnvironment
- Parameters:
streamGraph
- the stream graph representing the transformations- Returns:
- A
JobClient
that can be used to communicate with the submitted job, completed on submission succeeded. - Throws:
Exception
- which occurs during job execution.
-
setAsContext
public static void setAsContext(PipelineExecutorServiceLoader executorServiceLoader, Configuration clusterConfiguration, ClassLoader userCodeClassLoader, boolean enforceSingleJobExecution, boolean suppressSysout)
-
unsetAsContext
public static void unsetAsContext()
-
-