Class DummyStreamExecutionEnvironment
- All Implemented Interfaces:
AutoCloseable
StreamExecutionEnvironment, which holds a real StreamExecutionEnvironment, shares all configurations of the real environment, and disables all
configuration setting methods.
When translating relational plan to execution plan in the Planner, the generated
Transformations will be added into StreamExecutionEnvironment's buffer, and they will be
cleared only when StreamExecutionEnvironment.execute() method is called. Each TableEnvironment instance holds an immutable StreamExecutionEnvironment instance. If there are
multiple translations (not all for `execute`, e.g. `explain` and then `execute`) in one
TableEnvironment instance, the transformation buffer is dirty, and execution result may be
incorrect.
This dummy StreamExecutionEnvironment is only used for buffering the transformations generated in the planner. A new dummy StreamExecutionEnvironment instance should be created for each translation, and this could avoid dirty the transformation buffer of the real StreamExecutionEnvironment instance.
All set methods (e.g. `setXX`, `enableXX`, `disableXX`, etc) are disabled to prohibit changing configuration, all get methods (e.g. `getXX`, `isXX`, etc) will be delegated to the real StreamExecutionEnvironment. `execute`, `getStreamGraph`, `getExecutionPlan` methods are also disabled, while `addOperator` method is enabled to allow the planner to add the generated transformations to the dummy StreamExecutionEnvironment.
This class could be removed once the StreamTableSource interface and StreamTableSink interface are reworked.
NOTE: Please remove com.esotericsoftware.kryo item in the whitelist of
checkCodeDependencies() method in test_table_shaded_dependencies.sh end-to-end test when
this class is removed.
-
Field Summary
Fields inherited from class org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
cacheFile, checkpointCfg, config, configuration, transformations -
Constructor Summary
ConstructorsConstructorDescriptionDummyStreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment realExecEnv) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.flink.streaming.api.environment.StreamExecutionEnvironmentorg.apache.flink.streaming.api.environment.StreamExecutionEnvironmentenableCheckpointing(long interval) org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentenableCheckpointing(long interval, org.apache.flink.core.execution.CheckpointingMode mode) org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentenableCheckpointing(long interval, org.apache.flink.streaming.api.CheckpointingMode mode) org.apache.flink.api.common.JobExecutionResultexecute()org.apache.flink.api.common.JobExecutionResultorg.apache.flink.api.common.JobExecutionResultexecute(org.apache.flink.streaming.api.graph.StreamGraph streamGraph) longList<org.apache.flink.api.java.tuple.Tuple2<String,org.apache.flink.api.common.cache.DistributedCache.DistributedCacheEntry>> org.apache.flink.streaming.api.environment.CheckpointConfigorg.apache.flink.core.execution.CheckpointingModeorg.apache.flink.streaming.api.CheckpointingModelongorg.apache.flink.api.common.ExecutionConfigorg.apache.flink.configuration.ReadableConfigintintorg.apache.flink.streaming.api.graph.StreamGraphbooleanvoidregisterCachedFile(String filePath, String name) voidregisterCachedFile(String filePath, String name, boolean executable) org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentsetBufferTimeout(long timeoutMillis) org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentsetMaxParallelism(int maxParallelism) org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentsetParallelism(int parallelism) 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, enableChangelogStateBackend, executeAsync, executeAsync, executeAsync, fromCollection, fromCollection, fromCollection, fromCollection, fromData, fromData, fromData, fromData, fromData, fromElements, fromElements, fromParallelCollection, fromParallelCollection, fromSequence, fromSource, fromSource, generateSequence, generateStreamGraph, getDefaultLocalParallelism, getDefaultSavepointDirectory, getExecutionEnvironment, getExecutionEnvironment, getJobListeners, getStreamGraph, getTransformations, getUserClassloader, initializeContextEnvironment, invalidateClusterDataset, isChainingOfOperatorsWithDifferentMaxParallelismEnabled, isChangelogStateBackendEnabled, isForceUnalignedCheckpoints, isUnalignedCheckpointsEnabled, listCompletedClusterDatasets, readFile, readFile, readFile, readFile, readFileStream, registerCacheTransformation, registerCollectIterator, registerJobListener, registerSlotSharingGroup, resetContextEnvironment, setDefaultLocalParallelism, setDefaultSavepointDirectory, setDefaultSavepointDirectory, setDefaultSavepointDirectory, setRuntimeMode, socketTextStream, socketTextStream, socketTextStream, socketTextStream, socketTextStream
-
Constructor Details
-
DummyStreamExecutionEnvironment
public DummyStreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment realExecEnv)
-
-
Method Details
-
getConfig
public org.apache.flink.api.common.ExecutionConfig getConfig()- Overrides:
getConfigin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
getConfiguration
public org.apache.flink.configuration.ReadableConfig getConfiguration()- Overrides:
getConfigurationin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
getCachedFiles
public List<org.apache.flink.api.java.tuple.Tuple2<String,org.apache.flink.api.common.cache.DistributedCache.DistributedCacheEntry>> getCachedFiles()- Overrides:
getCachedFilesin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
setParallelism
public org.apache.flink.streaming.api.environment.StreamExecutionEnvironment setParallelism(int parallelism) - Overrides:
setParallelismin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
setMaxParallelism
public org.apache.flink.streaming.api.environment.StreamExecutionEnvironment setMaxParallelism(int maxParallelism) - Overrides:
setMaxParallelismin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
getParallelism
public int getParallelism()- Overrides:
getParallelismin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
getMaxParallelism
public int getMaxParallelism()- Overrides:
getMaxParallelismin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
setBufferTimeout
public org.apache.flink.streaming.api.environment.StreamExecutionEnvironment setBufferTimeout(long timeoutMillis) - Overrides:
setBufferTimeoutin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
getBufferTimeout
public long getBufferTimeout()- Overrides:
getBufferTimeoutin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
disableOperatorChaining
public org.apache.flink.streaming.api.environment.StreamExecutionEnvironment disableOperatorChaining()- Overrides:
disableOperatorChainingin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
isChainingEnabled
public boolean isChainingEnabled()- Overrides:
isChainingEnabledin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
getCheckpointConfig
public org.apache.flink.streaming.api.environment.CheckpointConfig getCheckpointConfig()- Overrides:
getCheckpointConfigin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
enableCheckpointing
public org.apache.flink.streaming.api.environment.StreamExecutionEnvironment enableCheckpointing(long interval) - Overrides:
enableCheckpointingin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
enableCheckpointing
public org.apache.flink.streaming.api.environment.StreamExecutionEnvironment enableCheckpointing(long interval, org.apache.flink.streaming.api.CheckpointingMode mode) - Overrides:
enableCheckpointingin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
enableCheckpointing
public org.apache.flink.streaming.api.environment.StreamExecutionEnvironment enableCheckpointing(long interval, org.apache.flink.core.execution.CheckpointingMode mode) - Overrides:
enableCheckpointingin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
getCheckpointInterval
public long getCheckpointInterval()- Overrides:
getCheckpointIntervalin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
getCheckpointingMode
public org.apache.flink.streaming.api.CheckpointingMode getCheckpointingMode()- Overrides:
getCheckpointingModein classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
getCheckpointingConsistencyMode
public org.apache.flink.core.execution.CheckpointingMode getCheckpointingConsistencyMode()- Overrides:
getCheckpointingConsistencyModein classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
execute
- Overrides:
executein classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment- Throws:
Exception
-
execute
- Overrides:
executein classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment- Throws:
Exception
-
execute
public org.apache.flink.api.common.JobExecutionResult execute(org.apache.flink.streaming.api.graph.StreamGraph streamGraph) throws Exception - Overrides:
executein classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment- Throws:
Exception
-
registerCachedFile
- Overrides:
registerCachedFilein classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
registerCachedFile
- Overrides:
registerCachedFilein classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
getStreamGraph
public org.apache.flink.streaming.api.graph.StreamGraph getStreamGraph()- Overrides:
getStreamGraphin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-
getExecutionPlan
- Overrides:
getExecutionPlanin classorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment
-