flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhue...@apache.org
Subject [2/3] flink git commit: [FLINK-1832] [scripts] fix start scripts for Cygwin and paths with spaces.
Date Wed, 08 Apr 2015 07:53:15 GMT
[FLINK-1832] [scripts] fix start scripts for Cygwin and paths with spaces.

This closes #575


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

Branch: refs/heads/master
Commit: cc7eda1a4d6f0015228e91bfe67b2331dd0d298e
Parents: ae6ff29
Author: Fabian Hueske <fhueske@apache.org>
Authored: Tue Apr 7 20:59:44 2015 +0200
Committer: Fabian Hueske <fhueske@apache.org>
Committed: Wed Apr 8 09:51:22 2015 +0200

----------------------------------------------------------------------
 flink-dist/src/main/flink-bin/bin/config.sh     | 15 ++++++++++++---
 flink-dist/src/main/flink-bin/bin/flink         | 20 ++------------------
 flink-dist/src/main/flink-bin/bin/jobmanager.sh | 19 ++-----------------
 .../src/main/flink-bin/bin/taskmanager.sh       | 19 ++-----------------
 flink-dist/src/main/flink-bin/bin/webclient.sh  | 18 ++----------------
 5 files changed, 20 insertions(+), 71 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/cc7eda1a/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 66e0b80..def4f09 100755
--- a/flink-dist/src/main/flink-bin/bin/config.sh
+++ b/flink-dist/src/main/flink-bin/bin/config.sh
@@ -17,6 +17,18 @@
 # limitations under the License.
 ################################################################################
 
+constructFlinkClassPath() {
+
+    for jarfile in "$FLINK_LIB_DIR"/*.jar ; do
+        if [[ $FLINK_CLASSPATH = "" ]]; then
+            FLINK_CLASSPATH=$jarfile;
+        else
+            FLINK_CLASSPATH=$FLINK_CLASSPATH:$jarfile
+        fi
+    done
+
+    echo $FLINK_CLASSPATH
+}
 
 # These are used to mangle paths that are passed to java when using 
 # cygwin. Cygwin paths are like linux paths, i.e. /path/to/somewhere
@@ -189,9 +201,6 @@ fi
 # KEY_JOBM_HEAP_MB and KEY_TASKM_HEAP_MB for that!
 JVM_ARGS=""
 
-# Default classpath 
-CLASSPATH=`manglePathList $( echo $FLINK_LIB_DIR/*.jar . | sed 's/ /:/g' )`
-
 # Check if deprecated HADOOP_HOME is set.
 if [ -n "$HADOOP_HOME" ]; then
     # HADOOP_HOME is set. Check if its a Hadoop 1.x or 2.x HADOOP_HOME path

http://git-wip-us.apache.org/repos/asf/flink/blob/cc7eda1a/flink-dist/src/main/flink-bin/bin/flink
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/flink b/flink-dist/src/main/flink-bin/bin/flink
old mode 100755
new mode 100644
index 7247260..094ddf4
--- a/flink-dist/src/main/flink-bin/bin/flink
+++ b/flink-dist/src/main/flink-bin/bin/flink
@@ -27,23 +27,7 @@ if [ "$FLINK_IDENT_STRING" = "" ]; then
         FLINK_IDENT_STRING="$USER"
 fi
 
-
-# auxiliary function to construct a lightweight classpath for the
-# Flink CLI client
-constructCLIClientClassPath() {
-
-	for jarfile in $FLINK_LIB_DIR/*.jar ; do
-		if [[ $CC_CLASSPATH = "" ]]; then
-			CC_CLASSPATH=$jarfile;
-		else
-			CC_CLASSPATH=$CC_CLASSPATH:$jarfile
-		fi
-	done
-
-	echo $CC_CLASSPATH
-}
-
-CC_CLASSPATH=`manglePathList $(constructCLIClientClassPath)`
+CC_CLASSPATH=`constructFlinkClassPath`
 
 log=$FLINK_LOG_DIR/flink-$FLINK_IDENT_STRING-flink-client-$HOSTNAME.log
 log_setting="-Dlog.file="$log" -Dlog4j.configuration=file:"$FLINK_CONF_DIR"/log4j-cli.properties
-Dlogback.configurationFile=file:"$FLINK_CONF_DIR"/logback.xml"
@@ -51,4 +35,4 @@ log_setting="-Dlog.file="$log" -Dlog4j.configuration=file:"$FLINK_CONF_DIR"/log4
 export FLINK_CONF_DIR
 
 # Add HADOOP_CLASSPATH to allow the usage of Hadoop file systems
-$JAVA_RUN $JVM_ARGS $log_setting -classpath $CC_CLASSPATH:$INTERNAL_HADOOP_CLASSPATHS org.apache.flink.client.CliFrontend
$*
+$JAVA_RUN $JVM_ARGS "$log_setting" -classpath "`manglePathList "$CC_CLASSPATH:$INTERNAL_HADOOP_CLASSPATHS"`"
org.apache.flink.client.CliFrontend $*

http://git-wip-us.apache.org/repos/asf/flink/blob/cc7eda1a/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 0298f01..93e5ee3 100755
--- a/flink-dist/src/main/flink-bin/bin/jobmanager.sh
+++ b/flink-dist/src/main/flink-bin/bin/jobmanager.sh
@@ -32,26 +32,11 @@ if [ "$JAVA_VERSION" -lt 18 ]; then
     JVM_ARGS="$JVM_ARGS -XX:MaxPermSize=256m"
 fi
 
-
-
 if [ "$FLINK_IDENT_STRING" = "" ]; then
     FLINK_IDENT_STRING="$USER"
 fi
 
-# auxilliary function to construct a the classpath for the jobManager
-constructJobManagerClassPath() {
-    for jarfile in "$FLINK_LIB_DIR"/*.jar ; do
-        if [[ $FLINK_JM_CLASSPATH = "" ]]; then
-            FLINK_JM_CLASSPATH=$jarfile;
-        else
-            FLINK_JM_CLASSPATH=$FLINK_JM_CLASSPATH:$jarfile
-        fi
-    done
-
-    echo $FLINK_JM_CLASSPATH
-}
-
-FLINK_JM_CLASSPATH=`manglePathList "$(constructJobManagerClassPath)"`
+FLINK_JM_CLASSPATH=`constructFlinkClassPath`
 
 log=$FLINK_LOG_DIR/flink-$FLINK_IDENT_STRING-jobmanager-$HOSTNAME.log
 out=$FLINK_LOG_DIR/flink-$FLINK_IDENT_STRING-jobmanager-$HOSTNAME.out
@@ -95,7 +80,7 @@ case $STARTSTOP in
         rotateLogFile $out
 
         echo Starting job manager
-        $JAVA_RUN $JVM_ARGS ${FLINK_ENV_JAVA_OPTS} "${log_setting[@]}" -classpath "$FLINK_JM_CLASSPATH:$INTERNAL_HADOOP_CLASSPATHS"
org.apache.flink.runtime.jobmanager.JobManager --executionMode $EXECUTIONMODE --configDir
"$FLINK_CONF_DIR"  > "$out" 2>&1 < /dev/null &
+        $JAVA_RUN $JVM_ARGS ${FLINK_ENV_JAVA_OPTS} "${log_setting[@]}" -classpath "`manglePathList
"$FLINK_JM_CLASSPATH:$INTERNAL_HADOOP_CLASSPATHS"`" org.apache.flink.runtime.jobmanager.JobManager
--executionMode $EXECUTIONMODE --configDir "$FLINK_CONF_DIR"  > "$out" 2>&1 <
/dev/null &
         echo $! > $pid
 
     ;;

http://git-wip-us.apache.org/repos/asf/flink/blob/cc7eda1a/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 73f4439..557ea2b 100755
--- a/flink-dist/src/main/flink-bin/bin/taskmanager.sh
+++ b/flink-dist/src/main/flink-bin/bin/taskmanager.sh
@@ -29,22 +29,7 @@ if [ "$FLINK_IDENT_STRING" = "" ]; then
     FLINK_IDENT_STRING="$USER"
 fi
 
-# auxilliary function to construct a lightweight classpath for the
-# Flink TaskManager
-constructTaskManagerClassPath() {
-
-    for jarfile in "$FLINK_LIB_DIR"/*.jar ; do
-        if [[ $FLINK_TM_CLASSPATH = "" ]]; then
-            FLINK_TM_CLASSPATH=$jarfile;
-        else
-            FLINK_TM_CLASSPATH=$FLINK_TM_CLASSPATH:$jarfile
-        fi
-    done
-
-    echo $FLINK_TM_CLASSPATH
-}
-
-FLINK_TM_CLASSPATH=`manglePathList "$(constructTaskManagerClassPath)"`
+FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
 log=$FLINK_LOG_DIR/flink-$FLINK_IDENT_STRING-taskmanager-$HOSTNAME.log
 out=$FLINK_LOG_DIR/flink-$FLINK_IDENT_STRING-taskmanager-$HOSTNAME.out
@@ -83,7 +68,7 @@ case $STARTSTOP in
         rotateLogFile $out
 
         echo Starting task manager on host $HOSTNAME
-        $JAVA_RUN $JVM_ARGS ${FLINK_ENV_JAVA_OPTS} "${log_setting[@]}" -classpath "$FLINK_TM_CLASSPATH:$INTERNAL_HADOOP_CLASSPATHS"
org.apache.flink.runtime.taskmanager.TaskManager --configDir "$FLINK_CONF_DIR" > "$out"
2>&1 < /dev/null &
+        $JAVA_RUN $JVM_ARGS ${FLINK_ENV_JAVA_OPTS} "${log_setting[@]}" -classpath "`manglePathList
"$FLINK_TM_CLASSPATH:$INTERNAL_HADOOP_CLASSPATHS"`" org.apache.flink.runtime.taskmanager.TaskManager
--configDir "$FLINK_CONF_DIR" > "$out" 2>&1 < /dev/null &
         echo $! > $pid
 
     ;;

http://git-wip-us.apache.org/repos/asf/flink/blob/cc7eda1a/flink-dist/src/main/flink-bin/bin/webclient.sh
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/bin/webclient.sh b/flink-dist/src/main/flink-bin/bin/webclient.sh
index adc573c..8a07275 100755
--- a/flink-dist/src/main/flink-bin/bin/webclient.sh
+++ b/flink-dist/src/main/flink-bin/bin/webclient.sh
@@ -32,21 +32,7 @@ fi
 
 JVM_ARGS="$JVM_ARGS -Xmx512m"
 
-# auxilliary function to construct the classpath for the webclient
-constructWebclientClassPath() {
-
-	for jarfile in "$FLINK_LIB_DIR"/*.jar ; do
-		if [[ $FLINK_WEBCLIENT_CLASSPATH = "" ]]; then
-			FLINK_WEBCLIENT_CLASSPATH=$jarfile;
-		else
-			FLINK_WEBCLIENT_CLASSPATH=$FLINK_WEBCLIENT_CLASSPATH:$jarfile
-		fi
-	done
-
-	echo $FLINK_WEBCLIENT_CLASSPATH
-}
-
-FLINK_WEBCLIENT_CLASSPATH=`manglePathList "$(constructWebclientClassPath)"`
+FLINK_WEBCLIENT_CLASSPATH=`constructFlinkClassPath`
 
 log=$FLINK_LOG_DIR/flink-$FLINK_IDENT_STRING-webclient-$HOSTNAME.log
 out=$FLINK_LOG_DIR/flink-$FLINK_IDENT_STRING-webclient-$HOSTNAME.out
@@ -64,7 +50,7 @@ case $STARTSTOP in
                         fi
                 fi
                 echo Starting Flink webclient
-		$JAVA_RUN $JVM_ARGS "${log_setting[@]}" -classpath "$FLINK_WEBCLIENT_CLASSPATH:$INTERNAL_HADOOP_CLASSPATHS"
org.apache.flink.client.WebFrontend --configDir "$FLINK_CONF_DIR" > "$out" 2>&1
< /dev/null &
+		$JAVA_RUN $JVM_ARGS "${log_setting[@]}" -classpath "`manglePathList "$FLINK_WEBCLIENT_CLASSPATH:$INTERNAL_HADOOP_CLASSPATHS"`"
org.apache.flink.client.WebFrontend --configDir "$FLINK_CONF_DIR" > "$out" 2>&1
< /dev/null &
 		echo $! > $pid
 	;;
 


Mime
View raw message