public class DummyStreamExecutionEnvironment
extends org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
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.
| Constructor and Description |
|---|
DummyStreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment realExecEnv) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDefaultKryoSerializer(Class<?> type,
Class<? extends com.esotericsoftware.kryo.Serializer<?>> serializerClass) |
<T extends com.esotericsoftware.kryo.Serializer<?> & Serializable> |
addDefaultKryoSerializer(Class<?> type,
T serializer) |
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment |
disableOperatorChaining() |
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment |
enableCheckpointing() |
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment |
enableCheckpointing(long interval) |
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment |
enableCheckpointing(long interval,
org.apache.flink.streaming.api.CheckpointingMode mode) |
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment |
enableCheckpointing(long interval,
org.apache.flink.streaming.api.CheckpointingMode mode,
boolean force) |
org.apache.flink.api.common.JobExecutionResult |
execute() |
org.apache.flink.api.common.JobExecutionResult |
execute(org.apache.flink.streaming.api.graph.StreamGraph streamGraph) |
org.apache.flink.api.common.JobExecutionResult |
execute(String jobName) |
long |
getBufferTimeout() |
List<org.apache.flink.api.java.tuple.Tuple2<String,org.apache.flink.api.common.cache.DistributedCache.DistributedCacheEntry>> |
getCachedFiles() |
org.apache.flink.streaming.api.environment.CheckpointConfig |
getCheckpointConfig() |
org.apache.flink.streaming.api.CheckpointingMode |
getCheckpointingMode() |
long |
getCheckpointInterval() |
org.apache.flink.api.common.ExecutionConfig |
getConfig() |
String |
getExecutionPlan() |
int |
getMaxParallelism() |
int |
getNumberOfExecutionRetries() |
int |
getParallelism() |
org.apache.flink.api.common.restartstrategy.RestartStrategies.RestartStrategyConfiguration |
getRestartStrategy() |
org.apache.flink.runtime.state.StateBackend |
getStateBackend() |
org.apache.flink.streaming.api.graph.StreamGraph |
getStreamGraph() |
org.apache.flink.streaming.api.graph.StreamGraph |
getStreamGraph(String jobName) |
org.apache.flink.streaming.api.TimeCharacteristic |
getStreamTimeCharacteristic() |
boolean |
isChainingEnabled() |
boolean |
isForceCheckpointing() |
void |
registerCachedFile(String filePath,
String name) |
void |
registerCachedFile(String filePath,
String name,
boolean executable) |
void |
registerType(Class<?> type) |
void |
registerTypeWithKryoSerializer(Class<?> type,
Class<? extends com.esotericsoftware.kryo.Serializer> serializerClass) |
<T extends com.esotericsoftware.kryo.Serializer<?> & Serializable> |
registerTypeWithKryoSerializer(Class<?> type,
T serializer) |
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment |
setBufferTimeout(long timeoutMillis) |
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment |
setMaxParallelism(int maxParallelism) |
void |
setNumberOfExecutionRetries(int numberOfExecutionRetries) |
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment |
setParallelism(int parallelism) |
void |
setRestartStrategy(org.apache.flink.api.common.restartstrategy.RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration) |
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment |
setStateBackend(org.apache.flink.runtime.state.StateBackend backend) |
void |
setStreamTimeCharacteristic(org.apache.flink.streaming.api.TimeCharacteristic characteristic) |
addOperator, addSource, addSource, addSource, addSource, clean, clearJobListeners, configure, createInput, createInput, createLocalEnvironment, createLocalEnvironment, createLocalEnvironment, createLocalEnvironment, createLocalEnvironmentWithWebUI, createRemoteEnvironment, createRemoteEnvironment, createRemoteEnvironment, executeAsync, executeAsync, executeAsync, fromCollection, fromCollection, fromCollection, fromCollection, fromElements, fromElements, fromParallelCollection, fromParallelCollection, fromSequence, fromSource, fromSource, generateSequence, getConfiguration, getDefaultLocalParallelism, getExecutionEnvironment, getExecutionEnvironment, getJobListeners, getStreamGraph, getUserClassloader, initializeContextEnvironment, isForceUnalignedCheckpoints, isUnalignedCheckpointsEnabled, readFile, readFile, readFile, readFile, readFileStream, readTextFile, readTextFile, registerJobListener, resetContextEnvironment, setDefaultLocalParallelism, setRuntimeMode, socketTextStream, socketTextStream, socketTextStream, socketTextStream, socketTextStreampublic DummyStreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment realExecEnv)
public org.apache.flink.api.common.ExecutionConfig getConfig()
getConfig in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic List<org.apache.flink.api.java.tuple.Tuple2<String,org.apache.flink.api.common.cache.DistributedCache.DistributedCacheEntry>> getCachedFiles()
getCachedFiles in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.streaming.api.environment.StreamExecutionEnvironment setParallelism(int parallelism)
setParallelism in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.streaming.api.environment.StreamExecutionEnvironment setMaxParallelism(int maxParallelism)
setMaxParallelism in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic int getParallelism()
getParallelism in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic int getMaxParallelism()
getMaxParallelism in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.streaming.api.environment.StreamExecutionEnvironment setBufferTimeout(long timeoutMillis)
setBufferTimeout in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic long getBufferTimeout()
getBufferTimeout in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.streaming.api.environment.StreamExecutionEnvironment disableOperatorChaining()
disableOperatorChaining in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic boolean isChainingEnabled()
isChainingEnabled in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.streaming.api.environment.CheckpointConfig getCheckpointConfig()
getCheckpointConfig in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.streaming.api.environment.StreamExecutionEnvironment enableCheckpointing(long interval)
enableCheckpointing in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.streaming.api.environment.StreamExecutionEnvironment enableCheckpointing(long interval,
org.apache.flink.streaming.api.CheckpointingMode mode)
enableCheckpointing in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.streaming.api.environment.StreamExecutionEnvironment enableCheckpointing(long interval,
org.apache.flink.streaming.api.CheckpointingMode mode,
boolean force)
enableCheckpointing in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.streaming.api.environment.StreamExecutionEnvironment enableCheckpointing()
enableCheckpointing in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic long getCheckpointInterval()
getCheckpointInterval in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic boolean isForceCheckpointing()
isForceCheckpointing in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.streaming.api.CheckpointingMode getCheckpointingMode()
getCheckpointingMode in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.streaming.api.environment.StreamExecutionEnvironment setStateBackend(org.apache.flink.runtime.state.StateBackend backend)
setStateBackend in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.runtime.state.StateBackend getStateBackend()
getStateBackend in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic void setRestartStrategy(org.apache.flink.api.common.restartstrategy.RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration)
setRestartStrategy in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.api.common.restartstrategy.RestartStrategies.RestartStrategyConfiguration getRestartStrategy()
getRestartStrategy in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic void setNumberOfExecutionRetries(int numberOfExecutionRetries)
setNumberOfExecutionRetries in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic int getNumberOfExecutionRetries()
getNumberOfExecutionRetries in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic <T extends com.esotericsoftware.kryo.Serializer<?> & Serializable> void addDefaultKryoSerializer(Class<?> type, T serializer)
addDefaultKryoSerializer in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic void addDefaultKryoSerializer(Class<?> type, Class<? extends com.esotericsoftware.kryo.Serializer<?>> serializerClass)
addDefaultKryoSerializer in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic <T extends com.esotericsoftware.kryo.Serializer<?> & Serializable> void registerTypeWithKryoSerializer(Class<?> type, T serializer)
registerTypeWithKryoSerializer in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic void registerTypeWithKryoSerializer(Class<?> type, Class<? extends com.esotericsoftware.kryo.Serializer> serializerClass)
registerTypeWithKryoSerializer in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic void registerType(Class<?> type)
registerType in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic void setStreamTimeCharacteristic(org.apache.flink.streaming.api.TimeCharacteristic characteristic)
setStreamTimeCharacteristic in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.streaming.api.TimeCharacteristic getStreamTimeCharacteristic()
getStreamTimeCharacteristic in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.api.common.JobExecutionResult execute()
throws Exception
execute in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentExceptionpublic org.apache.flink.api.common.JobExecutionResult execute(String jobName) throws Exception
execute in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentExceptionpublic org.apache.flink.api.common.JobExecutionResult execute(org.apache.flink.streaming.api.graph.StreamGraph streamGraph)
throws Exception
execute in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentExceptionpublic void registerCachedFile(String filePath, String name)
registerCachedFile in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic void registerCachedFile(String filePath, String name, boolean executable)
registerCachedFile in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.streaming.api.graph.StreamGraph getStreamGraph()
getStreamGraph in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic org.apache.flink.streaming.api.graph.StreamGraph getStreamGraph(String jobName)
getStreamGraph in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentpublic String getExecutionPlan()
getExecutionPlan in class org.apache.flink.streaming.api.environment.StreamExecutionEnvironmentCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.