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 2018/08/01 07:57:08 UTC

[flink] branch release-1.5 updated (6346179 -> 61ec26b)

This is an automated email from the ASF dual-hosted git repository.

trohrmann pushed a change to branch release-1.5
in repository https://gitbox.apache.org/repos/asf/flink.git.


    from 6346179  [FLINK-9986][build] Only include commit info in .version.properties file
     new e5155ac  [FLINK-9988][rest] Add deprecated keys for server bind address
     new 61ec26b  [FLINK-9988][rest] Add RestOptionTest for deprecated BIND_ADDRESS keys

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/flink/configuration/RestOptions.java    |  1 +
 .../flink/configuration/RestOptionsTest.java       | 37 ++++++++++++----------
 2 files changed, 21 insertions(+), 17 deletions(-)
 copy flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/job/metrics/JobVertexMetricsHeadersTest.java => flink-core/src/test/java/org/apache/flink/configuration/RestOptionsTest.java (52%)


[flink] 01/02: [FLINK-9988][rest] Add deprecated keys for server bind address

Posted by tr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

trohrmann pushed a commit to branch release-1.5
in repository https://gitbox.apache.org/repos/asf/flink.git

commit e5155ac394ea6a7993d91ad307bee0536ad00352
Author: zentol <ch...@apache.org>
AuthorDate: Fri Jul 27 17:43:01 2018 +0200

    [FLINK-9988][rest] Add deprecated keys for server bind address
---
 flink-core/src/main/java/org/apache/flink/configuration/RestOptions.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/flink-core/src/main/java/org/apache/flink/configuration/RestOptions.java b/flink-core/src/main/java/org/apache/flink/configuration/RestOptions.java
index 1b2c39e..5ac5a55 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/RestOptions.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/RestOptions.java
@@ -34,6 +34,7 @@ public class RestOptions {
 	public static final ConfigOption<String> BIND_ADDRESS =
 		key("rest.bind-address")
 			.noDefaultValue()
+			.withDeprecatedKeys(WebOptions.ADDRESS.key(), "jobmanager.web.address")
 			.withDescription("The address that the server binds itself.");
 
 	/**


[flink] 02/02: [FLINK-9988][rest] Add RestOptionTest for deprecated BIND_ADDRESS keys

Posted by tr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

trohrmann pushed a commit to branch release-1.5
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 61ec26b714bdc4ea91a12b2c51708d71401b5e98
Author: Till Rohrmann <tr...@apache.org>
AuthorDate: Tue Jul 31 14:58:20 2018 +0200

    [FLINK-9988][rest] Add RestOptionTest for deprecated BIND_ADDRESS keys
    
    This closes #6441.
---
 .../apache/flink/configuration/RestOptions.java    |  2 +-
 .../flink/configuration/RestOptionsTest.java       | 55 ++++++++++++++++++++++
 2 files changed, 56 insertions(+), 1 deletion(-)

diff --git a/flink-core/src/main/java/org/apache/flink/configuration/RestOptions.java b/flink-core/src/main/java/org/apache/flink/configuration/RestOptions.java
index 5ac5a55..3c24158 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/RestOptions.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/RestOptions.java
@@ -34,7 +34,7 @@ public class RestOptions {
 	public static final ConfigOption<String> BIND_ADDRESS =
 		key("rest.bind-address")
 			.noDefaultValue()
-			.withDeprecatedKeys(WebOptions.ADDRESS.key(), "jobmanager.web.address")
+			.withDeprecatedKeys(WebOptions.ADDRESS.key(), ConfigConstants.DEFAULT_JOB_MANAGER_WEB_FRONTEND_ADDRESS.key())
 			.withDescription("The address that the server binds itself.");
 
 	/**
diff --git a/flink-core/src/test/java/org/apache/flink/configuration/RestOptionsTest.java b/flink-core/src/test/java/org/apache/flink/configuration/RestOptionsTest.java
new file mode 100644
index 0000000..9c9e6b9
--- /dev/null
+++ b/flink-core/src/test/java/org/apache/flink/configuration/RestOptionsTest.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.configuration;
+
+import org.apache.flink.util.TestLogger;
+
+import org.junit.Test;
+
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Tests for the {@link RestOptions}.
+ */
+public class RestOptionsTest extends TestLogger {
+
+	@Test
+	public void testBindAddressFirstDeprecatedKey() {
+		final Configuration configuration = new Configuration();
+		final String expectedAddress = "foobar";
+		configuration.setString("web.address", expectedAddress);
+
+		final String actualAddress = configuration.getString(RestOptions.BIND_ADDRESS);
+
+		assertThat(actualAddress, is(equalTo(expectedAddress)));
+	}
+
+	@Test
+	public void testBindAddressSecondDeprecatedKey() {
+		final Configuration configuration = new Configuration();
+		final String expectedAddress = "foobar";
+		configuration.setString("jobmanager.web.address", expectedAddress);
+
+		final String actualAddress = configuration.getString(RestOptions.BIND_ADDRESS);
+
+		assertThat(actualAddress, is(equalTo(expectedAddress)));
+	}
+}