You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by gr...@apache.org on 2017/03/09 18:03:36 UTC

flink git commit: [FLINK-5838] [scripts] Print shell script usage

Repository: flink
Updated Branches:
  refs/heads/master 33cd97953 -> 3fcc4e37c


[FLINK-5838] [scripts] Print shell script usage

If jobmanager.sh, taskmanager.sh, or zookeeper.sh are called without
arguments then argument list for the call to flink-daemon.sh is
misaligned and the usage for flink-daemon displayed to the user.

Adds a check to each script to check for a valid action and otherwise
displays the proper usage string.

This closes #3352


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

Branch: refs/heads/master
Commit: 3fcc4e37c282a07e09c19934e71c141beefd8073
Parents: 33cd979
Author: Greg Hogan <co...@greghogan.com>
Authored: Fri Feb 17 14:38:31 2017 -0500
Committer: Greg Hogan <co...@greghogan.com>
Committed: Thu Mar 9 11:46:57 2017 -0500

----------------------------------------------------------------------
 flink-dist/src/main/flink-bin/bin/jobmanager.sh  | 5 +++++
 flink-dist/src/main/flink-bin/bin/taskmanager.sh | 5 +++++
 flink-dist/src/main/flink-bin/bin/zookeeper.sh   | 5 +++++
 3 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/3fcc4e37/flink-dist/src/main/flink-bin/bin/jobmanager.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/jobmanager.sh b/flink-dist/src/main/flink-bin/bin/jobmanager.sh
index 98b6195..5c3ac71 100755
--- a/flink-dist/src/main/flink-bin/bin/jobmanager.sh
+++ b/flink-dist/src/main/flink-bin/bin/jobmanager.sh
@@ -25,6 +25,11 @@ EXECUTIONMODE=$2
 HOST=$3 # optional when starting multiple instances
 WEBUIPORT=$4 # optional when starting multiple instances
 
+if [[ $STARTSTOP != "start" ]] && [[ $STARTSTOP != "start-foreground" ]] && [[ $STARTSTOP != "stop" ]] && [[ $STARTSTOP != "stop-all" ]]; then
+  echo $USAGE
+  exit 1
+fi
+
 bin=`dirname "$0"`
 bin=`cd "$bin"; pwd`
 

http://git-wip-us.apache.org/repos/asf/flink/blob/3fcc4e37/flink-dist/src/main/flink-bin/bin/taskmanager.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/taskmanager.sh b/flink-dist/src/main/flink-bin/bin/taskmanager.sh
index d143837..d4e9838 100755
--- a/flink-dist/src/main/flink-bin/bin/taskmanager.sh
+++ b/flink-dist/src/main/flink-bin/bin/taskmanager.sh
@@ -22,6 +22,11 @@ USAGE="Usage: taskmanager.sh start|start-foreground|stop|stop-all)"
 
 STARTSTOP=$1
 
+if [[ $STARTSTOP != "start" ]] && [[ $STARTSTOP != "start-foreground" ]] && [[ $STARTSTOP != "stop" ]] && [[ $STARTSTOP != "stop-all" ]]; then
+  echo $USAGE
+  exit 1
+fi
+
 bin=`dirname "$0"`
 bin=`cd "$bin"; pwd`
 

http://git-wip-us.apache.org/repos/asf/flink/blob/3fcc4e37/flink-dist/src/main/flink-bin/bin/zookeeper.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/zookeeper.sh b/flink-dist/src/main/flink-bin/bin/zookeeper.sh
index 596bfd2..ca72bb7 100755
--- a/flink-dist/src/main/flink-bin/bin/zookeeper.sh
+++ b/flink-dist/src/main/flink-bin/bin/zookeeper.sh
@@ -23,6 +23,11 @@ USAGE="Usage: zookeeper.sh ((start|start-foreground) peer-id)|stop|stop-all"
 STARTSTOP=$1
 PEER_ID=$2
 
+if [[ $STARTSTOP != "start" ]] && [[ $STARTSTOP != "start-foreground" ]] && [[ $STARTSTOP != "stop" ]] && [[ $STARTSTOP != "stop-all" ]]; then
+  echo $USAGE
+  exit 1
+fi
+
 bin=`dirname "$0"`
 bin=`cd "$bin"; pwd`