diff --git a/docs/layouts/shortcodes/generated/yarn_config_configuration.html b/docs/layouts/shortcodes/generated/yarn_config_configuration.html index 43182453610b3..41c32c77c9422 100644 --- a/docs/layouts/shortcodes/generated/yarn_config_configuration.html +++ b/docs/layouts/shortcodes/generated/yarn_config_configuration.html @@ -35,7 +35,7 @@
yarn.application-attempts
(none) - String + Integer Number of ApplicationMaster restarts. By default, the value will be set to 1. If high availability is enabled, then the default value will be 2. The restart number is also limited by YARN (configured via yarn.resourcemanager.am.max-attempts). Note that the entire Flink cluster will restart and the YARN Client will lose the connection. diff --git a/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNHighAvailabilityITCase.java b/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNHighAvailabilityITCase.java index b95fb469e42f3..498d60717ab18 100644 --- a/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNHighAvailabilityITCase.java +++ b/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNHighAvailabilityITCase.java @@ -329,7 +329,7 @@ private YarnClusterDescriptor setupYarnClusterDescriptor() { final Configuration flinkConfiguration = new Configuration(); flinkConfiguration.set(JobManagerOptions.TOTAL_PROCESS_MEMORY, MemorySize.ofMebiBytes(768)); flinkConfiguration.set(TaskManagerOptions.TOTAL_PROCESS_MEMORY, MemorySize.parse("1g")); - flinkConfiguration.set(YarnConfigOptions.APPLICATION_ATTEMPTS, "10"); + flinkConfiguration.set(YarnConfigOptions.APPLICATION_ATTEMPTS, 10); flinkConfiguration.set(HighAvailabilityOptions.HA_MODE, "zookeeper"); flinkConfiguration.set(HighAvailabilityOptions.HA_STORAGE_PATH, storageDir); flinkConfiguration.set( diff --git a/flink-yarn/src/main/java/org/apache/flink/yarn/configuration/YarnConfigOptions.java b/flink-yarn/src/main/java/org/apache/flink/yarn/configuration/YarnConfigOptions.java index e11163ab11064..06ab7e7437d85 100644 --- a/flink-yarn/src/main/java/org/apache/flink/yarn/configuration/YarnConfigOptions.java +++ b/flink-yarn/src/main/java/org/apache/flink/yarn/configuration/YarnConfigOptions.java @@ -90,9 +90,9 @@ public class YarnConfigOptions { *

>Note: This option returns a String since Integer options must have a static default * value. */ - public static final ConfigOption APPLICATION_ATTEMPTS = + public static final ConfigOption APPLICATION_ATTEMPTS = key("yarn.application-attempts") - .stringType() + .intType() .noDefaultValue() .withDescription( Description.builder()