Repository: flink
Updated Branches:
  refs/heads/release-1.5 347ec3848 -> 69ff5a744


[FLINK-8842] Change the Rest default port to 8081

This closes #5626.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/491f59ef
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/491f59ef
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/491f59ef

Branch: refs/heads/release-1.5
Commit: 491f59ef7592509a4c182dc28e7130bf6a8dbb7b
Parents: 347ec38
Author: Till Rohrmann <trohrm...@apache.org>
Authored: Fri Mar 2 20:19:38 2018 +0100
Committer: Till Rohrmann <trohrm...@apache.org>
Committed: Fri Mar 2 23:44:24 2018 +0100

----------------------------------------------------------------------
 .../apache/flink/configuration/RestOptions.java |  2 +-
 .../entrypoint/ClusterConfiguration.java        |  9 +++++++-
 .../runtime/entrypoint/ClusterEntrypoint.java   | 22 ++++++++++++++++++--
 3 files changed, 29 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/491f59ef/flink-core/src/main/java/org/apache/flink/configuration/RestOptions.java
----------------------------------------------------------------------
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 a66b27c..888be08 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
@@ -41,7 +41,7 @@ public class RestOptions {
         */
        public static final ConfigOption<Integer> REST_PORT =
                key("rest.port")
-                       .defaultValue(9065)
+                       .defaultValue(8081)
                        .withDescription("The port that the server listens on / 
the client connects to.");
 
        /**

http://git-wip-us.apache.org/repos/asf/flink/blob/491f59ef/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterConfiguration.java
----------------------------------------------------------------------
diff --git 
a/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterConfiguration.java
 
b/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterConfiguration.java
index dbec0b6..7f8b509 100644
--- 
a/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterConfiguration.java
+++ 
b/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterConfiguration.java
@@ -27,11 +27,18 @@ import org.apache.flink.util.Preconditions;
 public class ClusterConfiguration {
        private final String configDir;
 
-       public ClusterConfiguration(String configDir) {
+       private final int restPort;
+
+       public ClusterConfiguration(String configDir, int restPort) {
                this.configDir = Preconditions.checkNotNull(configDir);
+               this.restPort = restPort;
        }
 
        public String getConfigDir() {
                return configDir;
        }
+
+       public int getRestPort() {
+               return restPort;
+       }
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/491f59ef/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterEntrypoint.java
----------------------------------------------------------------------
diff --git 
a/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterEntrypoint.java
 
b/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterEntrypoint.java
index ba28670..19781f8 100755
--- 
a/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterEntrypoint.java
+++ 
b/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterEntrypoint.java
@@ -25,6 +25,7 @@ import org.apache.flink.configuration.ConfigOptions;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.GlobalConfiguration;
 import org.apache.flink.configuration.JobManagerOptions;
+import org.apache.flink.configuration.RestOptions;
 import org.apache.flink.configuration.WebOptions;
 import org.apache.flink.core.fs.FileSystem;
 import org.apache.flink.runtime.akka.AkkaUtils;
@@ -594,11 +595,28 @@ public abstract class ClusterEntrypoint implements 
FatalErrorHandler {
 
                final String configDir = parameterTool.get("configDir", "");
 
-               return new ClusterConfiguration(configDir);
+               final int restPort;
+
+               final String portKey = "webui-port";
+               if (parameterTool.has(portKey)) {
+                       restPort = Integer.valueOf(parameterTool.get(portKey));
+               } else {
+                       restPort = -1;
+               }
+
+               return new ClusterConfiguration(configDir, restPort);
        }
 
        protected static Configuration loadConfiguration(ClusterConfiguration 
clusterConfiguration) {
-               return 
GlobalConfiguration.loadConfiguration(clusterConfiguration.getConfigDir());
+               final Configuration configuration = 
GlobalConfiguration.loadConfiguration(clusterConfiguration.getConfigDir());
+
+               final int restPort = clusterConfiguration.getRestPort();
+
+               if (restPort >= 0) {
+                       configuration.setInteger(RestOptions.REST_PORT, 
restPort);
+               }
+
+               return configuration;
        }
 
        /**

Reply via email to