Skip to content

Commit

Permalink
[FLINK-28735][scripts] Deprecate jobmanager.sh host/port parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
zentol committed Aug 24, 2022
1 parent 254b276 commit cb50765
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ bin/start-cluster.sh
#### 添加 JobManager

```bash
bin/jobmanager.sh ((start|start-foreground) [host] [webui-port])|stop|stop-all
bin/jobmanager.sh ((start|start-foreground) [args] [webui-port])|stop|stop-all
```
<a name="adding-a-taskmanager"></a>
Expand Down
6 changes: 3 additions & 3 deletions flink-dist/src/main/flink-bin/bin/jobmanager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
################################################################################

# Start/stop a Flink JobManager.
USAGE="Usage: jobmanager.sh ((start|start-foreground) [host] [webui-port] [args])|stop|stop-all"
USAGE="Usage: jobmanager.sh ((start|start-foreground) [args])|stop|stop-all"

STARTSTOP=$1

if [ -z $2 ] || [[ $2 == "-D" ]]; then
# start [-D ...]
args=("${@:2}")
elif [ -z $3 ] || [[ $3 == "-D" ]]; then
# start <host> [-D ...]
# legacy path: start <host> [-D ...]
HOST=$2
args=("${@:3}")
else
# start <host> <port> [-D ...]
# legacy path: start <host> <port> [-D ...]
HOST=$2
WEBUIPORT=$3
args=("${@:4}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,12 +700,18 @@ protected static Configuration loadConfiguration(
final int restPort = entrypointClusterConfiguration.getRestPort();

if (restPort >= 0) {
LOG.warn(
"The 'webui-port' parameter of 'jobmanager.sh' has been deprecated. Please use '-D {}=<port> instead.",
RestOptions.PORT);
configuration.setInteger(RestOptions.PORT, restPort);
}

final String hostname = entrypointClusterConfiguration.getHostname();

if (hostname != null) {
LOG.warn(
"The 'host' parameter of 'jobmanager.sh' has been deprecated. Please use '-D {}=<host> instead.",
JobManagerOptions.ADDRESS);
configuration.setString(JobManagerOptions.ADDRESS, hostname);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class CommandLineOptions {
.desc("Directory which contains the configuration file flink-conf.yml.")
.build();

/** @deprecated subsumed by dynamic properties */
@Deprecated
public static final Option REST_PORT_OPTION =
Option.builder("r")
.longOpt("webui-port")
Expand All @@ -49,6 +51,8 @@ public class CommandLineOptions {
.desc("use value for given property")
.build();

/** @deprecated subsumed by dynamic properties */
@Deprecated
public static final Option HOST_OPTION =
Option.builder("h")
.longOpt("host")
Expand Down

0 comments on commit cb50765

Please sign in to comment.