You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by mx...@apache.org on 2015/06/08 19:10:01 UTC

flink git commit: [FLINK-2174] allow comments in 'slaves' file

Repository: flink
Updated Branches:
  refs/heads/master ee7c41738 -> e0d60ddbd


[FLINK-2174] allow comments in 'slaves' file

This closes #796.


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

Branch: refs/heads/master
Commit: e0d60ddbd102420e61fb84be4e3813767737c7fb
Parents: ee7c417
Author: mjsax <mj...@informatik.hu-berlin.de>
Authored: Fri Jun 5 20:35:45 2015 +0200
Committer: Maximilian Michels <mx...@apache.org>
Committed: Mon Jun 8 19:06:54 2015 +0200

----------------------------------------------------------------------
 flink-dist/src/main/flink-bin/bin/config.sh                 | 9 +++------
 .../src/main/flink-bin/bin/start-cluster-streaming.sh       | 4 ++--
 flink-dist/src/main/flink-bin/bin/start-cluster.sh          | 4 ++--
 flink-dist/src/main/flink-bin/bin/stop-cluster.sh           | 4 ++--
 4 files changed, 9 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/e0d60ddb/flink-dist/src/main/flink-bin/bin/config.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/config.sh b/flink-dist/src/main/flink-bin/bin/config.sh
index def4f09..341144c 100755
--- a/flink-dist/src/main/flink-bin/bin/config.sh
+++ b/flink-dist/src/main/flink-bin/bin/config.sh
@@ -219,12 +219,9 @@ INTERNAL_HADOOP_CLASSPATHS="$HADOOP_CLASSPATH:$HADOOP_CONF_DIR:$YARN_CONF_DIR"
 # Auxilliary function which extracts the name of host from a line which
 # also potentialy includes topology information and the taskManager type
 extractHostName() {
-    # extract first part of string (before any whitespace characters)
-    SLAVE=$1
-    # Remove types and possible comments
-    if [[ "$SLAVE" =~ ^([0-9a-zA-Z/.-]+).*$ ]]; then
-            SLAVE=${BASH_REMATCH[1]}
-    fi
+    # handle comments: extract first part of string (before first # character)
+    SLAVE=`echo $1 | cut -d'#' -f 1`
+
     # Extract the hostname from the network hierarchy
     if [[ "$SLAVE" =~ ^.*/([0-9a-zA-Z.-]+)$ ]]; then
             SLAVE=${BASH_REMATCH[1]}

http://git-wip-us.apache.org/repos/asf/flink/blob/e0d60ddb/flink-dist/src/main/flink-bin/bin/start-cluster-streaming.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/start-cluster-streaming.sh b/flink-dist/src/main/flink-bin/bin/start-cluster-streaming.sh
index 86a87cd..da13029 100755
--- a/flink-dist/src/main/flink-bin/bin/start-cluster-streaming.sh
+++ b/flink-dist/src/main/flink-bin/bin/start-cluster-streaming.sh
@@ -41,8 +41,8 @@ GOON=true
 while $GOON
 do
     read line || GOON=false
-    if [ -n "$line" ]; then
-        HOST=$( extractHostName $line)
+    HOST=$( extractHostName $line)
+    if [ -n "$HOST" ]; then
         ssh -n $FLINK_SSH_OPTS $HOST -- "nohup /bin/bash -l $FLINK_BIN_DIR/taskmanager.sh start streaming &"
     fi
 done < "$HOSTLIST"

http://git-wip-us.apache.org/repos/asf/flink/blob/e0d60ddb/flink-dist/src/main/flink-bin/bin/start-cluster.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/start-cluster.sh b/flink-dist/src/main/flink-bin/bin/start-cluster.sh
index 3d38d98..36f5bc3 100755
--- a/flink-dist/src/main/flink-bin/bin/start-cluster.sh
+++ b/flink-dist/src/main/flink-bin/bin/start-cluster.sh
@@ -41,8 +41,8 @@ GOON=true
 while $GOON
 do
     read line || GOON=false
-    if [ -n "$line" ]; then
-        HOST=$( extractHostName $line)
+    HOST=$( extractHostName $line)
+    if [ -n "$HOST" ]; then
         ssh -n $FLINK_SSH_OPTS $HOST -- "nohup /bin/bash -l $FLINK_BIN_DIR/taskmanager.sh start batch &"
     fi
 done < "$HOSTLIST"

http://git-wip-us.apache.org/repos/asf/flink/blob/e0d60ddb/flink-dist/src/main/flink-bin/bin/stop-cluster.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/stop-cluster.sh b/flink-dist/src/main/flink-bin/bin/stop-cluster.sh
index d9fe6f6..cf2bf9b 100755
--- a/flink-dist/src/main/flink-bin/bin/stop-cluster.sh
+++ b/flink-dist/src/main/flink-bin/bin/stop-cluster.sh
@@ -39,8 +39,8 @@ GOON=true
 while $GOON
 do
     read line || GOON=false
-    if [ -n "$line" ]; then
-        HOST=$( extractHostName $line)
+    HOST=$( extractHostName $line)
+    if [ -n "$HOST" ]; then
         ssh -n $FLINK_SSH_OPTS $HOST -- "nohup /bin/bash $FLINK_BIN_DIR/taskmanager.sh stop &"
     fi
 done < $HOSTLIST