You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tr...@apache.org on 2020/06/24 14:32:50 UTC
[flink] branch release-1.11 updated: [FLINK-18426] Remove
incompatible deprecated keys from ClusterOptions
This is an automated email from the ASF dual-hosted git repository.
trohrmann pushed a commit to branch release-1.11
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.11 by this push:
new 62c7265 [FLINK-18426] Remove incompatible deprecated keys from ClusterOptions
62c7265 is described below
commit 62c7265522fcf1b708b4906d5d74e40188a80f28
Author: Till Rohrmann <tr...@apache.org>
AuthorDate: Wed Jun 24 10:31:33 2020 +0200
[FLINK-18426] Remove incompatible deprecated keys from ClusterOptions
ClusterOptions.INITIAL_REGISTRATION_TIMEOUT, MAX_REGISTRATION_TIMEOUT and REFUSED_REGISTRATION_DELAY
have incompatible deprecated options of type Duration associated. This causes the system to fail
if they are specified. Since the deprecated keys have not been used for a very long time, this commit
will remove the deprecated keys from the ClusterOptions.
This closes #12763.
---
.../apache/flink/configuration/ClusterOptions.java | 3 ---
.../RetryingRegistrationConfigurationTest.java | 21 +++++++++++++++++++++
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/flink-core/src/main/java/org/apache/flink/configuration/ClusterOptions.java b/flink-core/src/main/java/org/apache/flink/configuration/ClusterOptions.java
index 857933a..051447a 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/ClusterOptions.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/ClusterOptions.java
@@ -34,14 +34,12 @@ public class ClusterOptions {
public static final ConfigOption<Long> INITIAL_REGISTRATION_TIMEOUT = ConfigOptions
.key("cluster.registration.initial-timeout")
.defaultValue(100L)
- .withDeprecatedKeys("taskmanager.initial-registration-pause", "taskmanager.registration.initial-backoff")
.withDescription("Initial registration timeout between cluster components in milliseconds.");
@Documentation.Section(Documentation.Sections.EXPERT_FAULT_TOLERANCE)
public static final ConfigOption<Long> MAX_REGISTRATION_TIMEOUT = ConfigOptions
.key("cluster.registration.max-timeout")
.defaultValue(30000L)
- .withDeprecatedKeys("taskmanager.max-registration-pause", "taskmanager.registration.max-backoff")
.withDescription("Maximum registration timeout between cluster components in milliseconds.");
@Documentation.Section(Documentation.Sections.EXPERT_FAULT_TOLERANCE)
@@ -54,7 +52,6 @@ public class ClusterOptions {
public static final ConfigOption<Long> REFUSED_REGISTRATION_DELAY = ConfigOptions
.key("cluster.registration.refused-registration-delay")
.defaultValue(30000L)
- .withDeprecatedKeys("taskmanager.refused-registration-pause", "taskmanager.registration.refused-backoff")
.withDescription("The pause made after the registration attempt was refused in milliseconds.");
@Documentation.Section(Documentation.Sections.EXPERT_FAULT_TOLERANCE)
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/registration/RetryingRegistrationConfigurationTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/registration/RetryingRegistrationConfigurationTest.java
index 86b009d..fc471dd 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/registration/RetryingRegistrationConfigurationTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/registration/RetryingRegistrationConfigurationTest.java
@@ -20,10 +20,13 @@ package org.apache.flink.runtime.registration;
import org.apache.flink.configuration.ClusterOptions;
import org.apache.flink.configuration.Configuration;
+import org.apache.flink.configuration.TaskManagerOptions;
import org.apache.flink.util.TestLogger;
import org.junit.Test;
+import java.time.Duration;
+
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
@@ -54,4 +57,22 @@ public class RetryingRegistrationConfigurationTest extends TestLogger {
assertThat(retryingRegistrationConfiguration.getErrorDelayMillis(), is(errorRegistrationDelay));
}
+ @Test
+ public void testConfigurationWithDeprecatedOptions() {
+ final Configuration configuration = new Configuration();
+
+ final Duration refusedRegistrationBackoff = Duration.ofMinutes(42L);
+ final Duration registrationMaxBackoff = Duration.ofSeconds(1L);
+ final Duration initialRegistrationBackoff = Duration.ofHours(1337L);
+
+ configuration.set(TaskManagerOptions.REFUSED_REGISTRATION_BACKOFF, refusedRegistrationBackoff);
+ configuration.set(TaskManagerOptions.REGISTRATION_MAX_BACKOFF, registrationMaxBackoff);
+ configuration.set(TaskManagerOptions.INITIAL_REGISTRATION_BACKOFF, initialRegistrationBackoff);
+
+ final RetryingRegistrationConfiguration retryingRegistrationConfiguration = RetryingRegistrationConfiguration.fromConfiguration(configuration);
+
+ assertThat(retryingRegistrationConfiguration.getInitialRegistrationTimeoutMillis(), is(ClusterOptions.INITIAL_REGISTRATION_TIMEOUT.defaultValue()));
+ assertThat(retryingRegistrationConfiguration.getRefusedDelayMillis(), is(ClusterOptions.REFUSED_REGISTRATION_DELAY.defaultValue()));
+ assertThat(retryingRegistrationConfiguration.getMaxRegistrationTimeoutMillis(), is(ClusterOptions.MAX_REGISTRATION_TIMEOUT.defaultValue()));
+ }
}