You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flume.apache.org by hs...@apache.org on 2013/08/15 03:24:48 UTC
git commit: FLUME-2161. Flume does not support spaces in -X java-opt
command line args
Updated Branches:
refs/heads/trunk 507ff1371 -> 37e56e85b
FLUME-2161. Flume does not support spaces in -X java-opt command line args
(Mike Percy via Hari Shreedharan)
Project: http://git-wip-us.apache.org/repos/asf/flume/repo
Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/37e56e85
Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/37e56e85
Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/37e56e85
Branch: refs/heads/trunk
Commit: 37e56e85b08869e01dce98b95879a09f1bf57a92
Parents: 507ff13
Author: Hari Shreedharan <hs...@apache.org>
Authored: Wed Aug 14 18:23:51 2013 -0700
Committer: Hari Shreedharan <hs...@apache.org>
Committed: Wed Aug 14 18:23:51 2013 -0700
----------------------------------------------------------------------
bin/flume-ng | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flume/blob/37e56e85/bin/flume-ng
----------------------------------------------------------------------
diff --git a/bin/flume-ng b/bin/flume-ng
index 65cc985..3a8a10d 100755
--- a/bin/flume-ng
+++ b/bin/flume-ng
@@ -224,7 +224,7 @@ run_flume() {
if [ ${CLEAN_FLAG} -ne 0 ]; then
set -x
fi
- $EXEC $JAVA_HOME/bin/java $JAVA_OPTS -cp "$FLUME_CLASSPATH" \
+ $EXEC $JAVA_HOME/bin/java $JAVA_OPTS "${arr_java_props[@]}" -cp "$FLUME_CLASSPATH" \
-Djava.library.path=$FLUME_JAVA_LIBRARY_PATH "$FLUME_APPLICATION_CLASS" $*
}
@@ -241,7 +241,8 @@ LD_LIBRARY_PATH=""
opt_conf=""
opt_classpath=""
opt_plugins_dirs=""
-opt_java_props=""
+arr_java_props=()
+arr_java_props_ct=0
opt_dryrun=""
mode=$1
@@ -301,10 +302,12 @@ while [ -n "$*" ] ; do
shift
;;
-D*)
- opt_java_props="$opt_java_props $arg"
+ arr_java_props[arr_java_props_ct]=$arg
+ ((++arr_java_props_ct))
;;
-X*)
- opt_java_props="$opt_java_props $arg"
+ arr_java_props[arr_java_props_ct]=$arg
+ ((++arr_java_props_ct))
;;
*)
args="$args $arg"
@@ -325,11 +328,6 @@ elif [ -f "$opt_conf/flume-env.sh" ]; then
source "$opt_conf/flume-env.sh"
fi
-# append command-line java options to stock or env script JAVA_OPTS
-if [ -n "${opt_java_props}" ]; then
- JAVA_OPTS="${JAVA_OPTS} ${opt_java_props}"
-fi
-
# prepend command-line classpath to env script classpath
if [ -n "${opt_classpath}" ]; then
if [ -n "${FLUME_CLASSPATH}" ]; then