@Public public class ExecutionConfig extends Object implements Serializable
ExecutionMode
of the program: Batch or Pipelined.
The default execution mode is ExecutionMode.PIPELINED
CodeAnalysisMode
of the program: Enable hinting/optimizing or disable
the "static code analyzer". The static code analyzer pre-interprets user-defined functions in order to
get implementation insights for program improvements that can be printed to the log or
automatically applied.Modifier and Type | Class and Description |
---|---|
static class |
ExecutionConfig.GlobalJobParameters
Abstract class for a custom user configuration object registered at the execution config.
|
static class |
ExecutionConfig.SerializableSerializer<T extends com.esotericsoftware.kryo.Serializer<?> & Serializable> |
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_KEY |
static int |
PARALLELISM_AUTO_MAX
The constant to use for the parallelism, if the system should use the number
of currently available slots.
|
Constructor and Description |
---|
ExecutionConfig() |
Modifier and Type | Method and Description |
---|---|
void |
addDefaultKryoSerializer(Class<?> type,
Class<? extends com.esotericsoftware.kryo.Serializer<?>> serializerClass)
Adds a new Kryo default serializer to the Runtime.
|
<T extends com.esotericsoftware.kryo.Serializer<?> & Serializable> |
addDefaultKryoSerializer(Class<?> type,
T serializer)
Adds a new Kryo default serializer to the Runtime.
|
boolean |
canEqual(Object obj) |
void |
disableAutoTypeRegistration()
Control whether Flink is automatically registering all types in the user programs with
Kryo.
|
ExecutionConfig |
disableClosureCleaner()
Disables the ClosureCleaner.
|
void |
disableForceAvro() |
void |
disableForceKryo()
Disable use of Kryo serializer for all POJOs.
|
ExecutionConfig |
disableObjectReuse()
Disables reusing objects that Flink internally uses for deserialization and passing
data to user-code functions.
|
ExecutionConfig |
disableSysoutLogging()
Disables the printing of progress update messages to
System.out |
ExecutionConfig |
enableClosureCleaner()
Enables the ClosureCleaner.
|
void |
enableForceAvro()
Force Flink to use the AvroSerializer for POJOs.
|
void |
enableForceKryo()
Force TypeExtractor to use Kryo serializer for POJOS even though we could analyze as POJO.
|
ExecutionConfig |
enableObjectReuse()
Enables reusing objects that Flink internally uses for deserialization and passing
data to user-code functions.
|
ExecutionConfig |
enableSysoutLogging()
Enables the printing of progress update messages to
System.out |
boolean |
equals(Object obj) |
long |
getAutoWatermarkInterval()
Returns the interval of the automatic watermark emission.
|
CodeAnalysisMode |
getCodeAnalysisMode()
Returns the
CodeAnalysisMode of the program. |
LinkedHashMap<Class<?>,Class<? extends com.esotericsoftware.kryo.Serializer<?>>> |
getDefaultKryoSerializerClasses()
Returns the registered default Kryo Serializer classes.
|
LinkedHashMap<Class<?>,ExecutionConfig.SerializableSerializer<?>> |
getDefaultKryoSerializers()
Returns the registered default Kryo Serializers.
|
ExecutionMode |
getExecutionMode()
Gets the execution mode used to execute the program.
|
long |
getExecutionRetryDelay()
Deprecated.
Should no longer be used because it is subsumed by RestartStrategyConfiguration
|
ExecutionConfig.GlobalJobParameters |
getGlobalJobParameters() |
int |
getNumberOfExecutionRetries()
Deprecated.
Should no longer be used because it is subsumed by RestartStrategyConfiguration
|
int |
getParallelism()
Gets the parallelism with which operation are executed by default.
|
LinkedHashSet<Class<?>> |
getRegisteredKryoTypes()
Returns the registered Kryo types.
|
LinkedHashSet<Class<?>> |
getRegisteredPojoTypes()
Returns the registered POJO types.
|
LinkedHashMap<Class<?>,Class<? extends com.esotericsoftware.kryo.Serializer<?>>> |
getRegisteredTypesWithKryoSerializerClasses()
Returns the registered types with their Kryo Serializer classes.
|
LinkedHashMap<Class<?>,ExecutionConfig.SerializableSerializer<?>> |
getRegisteredTypesWithKryoSerializers()
Returns the registered types with Kryo Serializers.
|
RestartStrategies.RestartStrategyConfiguration |
getRestartStrategy()
Returns the restart strategy which has been set for the current job.
|
int |
hashCode() |
boolean |
isAutoTypeRegistrationDisabled() |
boolean |
isClosureCleanerEnabled()
Returns whether the ClosureCleaner is enabled.
|
boolean |
isForceAvroEnabled() |
boolean |
isForceKryoEnabled() |
boolean |
isObjectReuseEnabled()
Returns whether object reuse has been enabled or disabled.
|
boolean |
isSysoutLoggingEnabled()
Gets whether progress update messages should be printed to
System.out |
void |
registerKryoType(Class<?> type)
Registers the given type with the serialization stack.
|
void |
registerPojoType(Class<?> type)
Registers the given type with the serialization stack.
|
void |
registerTypeWithKryoSerializer(Class<?> type,
Class<? extends com.esotericsoftware.kryo.Serializer<?>> serializerClass)
Registers the given Serializer via its class as a serializer for the given type at the KryoSerializer
|
<T extends com.esotericsoftware.kryo.Serializer<?> & Serializable> |
registerTypeWithKryoSerializer(Class<?> type,
T serializer)
Registers the given type with a Kryo Serializer.
|
ExecutionConfig |
setAutoWatermarkInterval(long interval)
Sets the interval of the automatic watermark emission.
|
void |
setCodeAnalysisMode(CodeAnalysisMode codeAnalysisMode)
Sets the
CodeAnalysisMode of the program. |
void |
setExecutionMode(ExecutionMode executionMode)
Sets the execution mode to execute the program.
|
ExecutionConfig |
setExecutionRetryDelay(long executionRetryDelay)
Deprecated.
This method will be replaced by
setRestartStrategy(org.apache.flink.api.common.restartstrategy.RestartStrategies.RestartStrategyConfiguration) . The
RestartStrategies.FixedDelayRestartStrategyConfiguration contains the delay between
successive execution attempts. |
void |
setGlobalJobParameters(ExecutionConfig.GlobalJobParameters globalJobParameters)
Register a custom, serializable user configuration object.
|
ExecutionConfig |
setNumberOfExecutionRetries(int numberOfExecutionRetries)
Deprecated.
This method will be replaced by
setRestartStrategy(org.apache.flink.api.common.restartstrategy.RestartStrategies.RestartStrategyConfiguration) . The
RestartStrategies.FixedDelayRestartStrategyConfiguration contains the number of
execution retries. |
ExecutionConfig |
setParallelism(int parallelism)
Sets the parallelism for operations executed through this environment.
|
void |
setRestartStrategy(RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration)
Sets the restart strategy to be used for recovery.
|
public static final String CONFIG_KEY
public static final int PARALLELISM_AUTO_MAX
public ExecutionConfig enableClosureCleaner()
public ExecutionConfig disableClosureCleaner()
enableClosureCleaner()
public boolean isClosureCleanerEnabled()
enableClosureCleaner()
@PublicEvolving public ExecutionConfig setAutoWatermarkInterval(long interval)
interval
- The interval between watermarks in milliseconds.@PublicEvolving public long getAutoWatermarkInterval()
setAutoWatermarkInterval(long)
public int getParallelism()
-1
, if the environment's default parallelism should be used.public ExecutionConfig setParallelism(int parallelism)
This method overrides the default parallelism for this environment. The local execution environment uses by default a value equal to the number of hardware contexts (CPU cores / threads). When executing the program via the command line client from a JAR file, the default parallelism is the one configured for that setup.
parallelism
- The parallelism to use@PublicEvolving public void setRestartStrategy(RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration)
ExecutionConfig config = env.getConfig();
config.setRestartStrategy(RestartStrategies.fixedDelayRestart(
10, // number of retries
1000 // delay between retries));
restartStrategyConfiguration
- Configuration defining the restart strategy to use@PublicEvolving public RestartStrategies.RestartStrategyConfiguration getRestartStrategy()
@Deprecated public int getNumberOfExecutionRetries()
-1
indicates that the system default value (as defined in the configuration)
should be used.@Deprecated public long getExecutionRetryDelay()
@Deprecated public ExecutionConfig setNumberOfExecutionRetries(int numberOfExecutionRetries)
setRestartStrategy(org.apache.flink.api.common.restartstrategy.RestartStrategies.RestartStrategyConfiguration)
. The
RestartStrategies.FixedDelayRestartStrategyConfiguration
contains the number of
execution retries.-1
indicates that the system
default value (as defined in the configuration) should be used.numberOfExecutionRetries
- The number of times the system will try to re-execute failed tasks.@Deprecated public ExecutionConfig setExecutionRetryDelay(long executionRetryDelay)
setRestartStrategy(org.apache.flink.api.common.restartstrategy.RestartStrategies.RestartStrategyConfiguration)
. The
RestartStrategies.FixedDelayRestartStrategyConfiguration
contains the delay between
successive execution attempts.executionRetryDelay
- The number of milliseconds the system will wait to retry.public void setExecutionMode(ExecutionMode executionMode)
ExecutionMode.PIPELINED
.executionMode
- The execution mode to use.public ExecutionMode getExecutionMode()
ExecutionMode.PIPELINED
.public void enableForceKryo()
public void disableForceKryo()
public boolean isForceKryoEnabled()
public void enableForceAvro()
public void disableForceAvro()
public boolean isForceAvroEnabled()
public ExecutionConfig enableObjectReuse()
public ExecutionConfig disableObjectReuse()
public boolean isObjectReuseEnabled()
@PublicEvolving public void setCodeAnalysisMode(CodeAnalysisMode codeAnalysisMode)
CodeAnalysisMode
of the program. Specifies to which extent user-defined
functions are analyzed in order to give the Flink optimizer an insight of UDF internals
and inform the user about common implementation mistakes. The static code analyzer pre-interprets
user-defined functions in order to get implementation insights for program improvements
that can be printed to the log, automatically applied, or disabled.codeAnalysisMode
- see CodeAnalysisMode
@PublicEvolving public CodeAnalysisMode getCodeAnalysisMode()
CodeAnalysisMode
of the program.public ExecutionConfig enableSysoutLogging()
System.out
public ExecutionConfig disableSysoutLogging()
System.out
public boolean isSysoutLoggingEnabled()
System.out
public ExecutionConfig.GlobalJobParameters getGlobalJobParameters()
public void setGlobalJobParameters(ExecutionConfig.GlobalJobParameters globalJobParameters)
globalJobParameters
- Custom user configuration objectpublic <T extends com.esotericsoftware.kryo.Serializer<?> & Serializable> void addDefaultKryoSerializer(Class<?> type, T serializer)
type
- The class of the types serialized with the given serializer.serializer
- The serializer to use.public void addDefaultKryoSerializer(Class<?> type, Class<? extends com.esotericsoftware.kryo.Serializer<?>> serializerClass)
type
- The class of the types serialized with the given serializer.serializerClass
- The class of the serializer to use.public <T extends com.esotericsoftware.kryo.Serializer<?> & Serializable> void registerTypeWithKryoSerializer(Class<?> type, T serializer)
type
- The class of the types serialized with the given serializer.serializer
- The serializer to use.public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends com.esotericsoftware.kryo.Serializer<?>> serializerClass)
type
- The class of the types serialized with the given serializer.serializerClass
- The class of the serializer to use.public void registerPojoType(Class<?> type)
type
- The class of the type to register.public void registerKryoType(Class<?> type)
type
- The class of the type to register.public LinkedHashMap<Class<?>,ExecutionConfig.SerializableSerializer<?>> getRegisteredTypesWithKryoSerializers()
public LinkedHashMap<Class<?>,Class<? extends com.esotericsoftware.kryo.Serializer<?>>> getRegisteredTypesWithKryoSerializerClasses()
public LinkedHashMap<Class<?>,ExecutionConfig.SerializableSerializer<?>> getDefaultKryoSerializers()
public LinkedHashMap<Class<?>,Class<? extends com.esotericsoftware.kryo.Serializer<?>>> getDefaultKryoSerializerClasses()
public LinkedHashSet<Class<?>> getRegisteredKryoTypes()
public LinkedHashSet<Class<?>> getRegisteredPojoTypes()
public boolean isAutoTypeRegistrationDisabled()
public void disableAutoTypeRegistration()
public boolean canEqual(Object obj)
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.