File tree Expand file tree Collapse file tree 5 files changed +18
-18
lines changed Expand file tree Collapse file tree 5 files changed +18
-18
lines changed Original file line number Diff line number Diff line change 77
77
CMD=()
78
78
while IFS= read -d ' ' -r ARG; do
79
79
CMD+=(" $ARG " )
80
- done < <( $RUNNER -cp " $SPARK_LAUNCHER_CP " org.apache.spark.launcher.Main " $@ " )
80
+ done < <( " $RUNNER " -cp " $SPARK_LAUNCHER_CP " org.apache.spark.launcher.Main " $@ " )
81
81
82
82
if [ " ${CMD[0]} " = " usage" ]; then
83
83
" ${CMD[@]} "
Original file line number Diff line number Diff line change @@ -32,11 +32,11 @@ export FWDIR="$(cd "`dirname "$0"`"/..; pwd)"
32
32
33
33
usage () {
34
34
if [ -n " $1 " ]; then
35
- echo $1
35
+ echo " $1 "
36
36
fi
37
37
echo " Usage: ./bin/spark-shell [options]"
38
38
" $FWDIR " /bin/spark-submit --help 2>&1 | grep -v Usage 1>&2
39
- exit $2
39
+ exit " $2 "
40
40
}
41
41
export -f usage
42
42
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export FWDIR="$(cd "`dirname "$0"`"/..; pwd)"
32
32
33
33
function usage {
34
34
if [ -n " $1 " ]; then
35
- echo $1
35
+ echo " $1 "
36
36
fi
37
37
echo " Usage: ./bin/spark-sql [options] [cli option]"
38
38
pattern=" usage"
@@ -45,13 +45,13 @@ function usage {
45
45
" $FWDIR " /bin/spark-submit --help 2>&1 | grep -v Usage 1>&2
46
46
echo
47
47
echo " CLI options:"
48
- " $FWDIR " /bin/spark-class $CLASS --help 2>&1 | grep -v " $pattern " 1>&2
49
- exit $2
48
+ " $FWDIR " /bin/spark-class " $CLASS " --help 2>&1 | grep -v " $pattern " 1>&2
49
+ exit " $2 "
50
50
}
51
51
export -f usage
52
52
53
53
if [[ " $@ " = * --help ]] || [[ " $@ " = * -h ]]; then
54
54
usage " " 0
55
55
fi
56
56
57
- exec " $FWDIR " /bin/spark-submit --class $CLASS " $@ "
57
+ exec " $FWDIR " /bin/spark-submit --class " $CLASS " " $@ "
Original file line number Diff line number Diff line change @@ -23,10 +23,10 @@ SPARK_HOME="$(cd "`dirname "$0"`"/..; pwd)"
23
23
if ! type -t usage > /dev/null 2>&1 ; then
24
24
usage () {
25
25
if [ -n " $1 " ]; then
26
- echo $1
26
+ echo " $1 "
27
27
fi
28
28
" $SPARK_HOME " /bin/spark-class org.apache.spark.deploy.SparkSubmit --help
29
- exit $2
29
+ exit " $2 "
30
30
}
31
31
export -f usage
32
32
fi
Original file line number Diff line number Diff line change @@ -122,12 +122,12 @@ if [ "$SPARK_NICENESS" = "" ]; then
122
122
fi
123
123
124
124
run_command () {
125
- mode=$1
125
+ mode=" $1 "
126
126
shift
127
127
128
128
mkdir -p " $SPARK_PID_DIR "
129
129
130
- if [ -f $pid ]; then
130
+ if [ -f " $pid " ]; then
131
131
TARGET_ID=" $( cat " $pid " ) "
132
132
if [[ $( ps -p " $TARGET_ID " -o args=) =~ $command ]]; then
133
133
echo " $command running as process $TARGET_ID . Stop it first."
@@ -137,21 +137,21 @@ run_command() {
137
137
138
138
if [ " $SPARK_MASTER " != " " ]; then
139
139
echo rsync from " $SPARK_MASTER "
140
- rsync -a -e ssh --delete --exclude=.svn --exclude=' logs/*' --exclude=' contrib/hod/logs/*' $SPARK_MASTER / " $SPARK_HOME "
140
+ rsync -a -e ssh --delete --exclude=.svn --exclude=' logs/*' --exclude=' contrib/hod/logs/*' " $SPARK_MASTER /" " $SPARK_HOME "
141
141
fi
142
142
143
143
spark_rotate_log " $log "
144
144
echo " starting $command , logging to $log "
145
145
146
- case $mode in
146
+ case " $mode " in
147
147
(class)
148
- nohup nice -n $SPARK_NICENESS " $SPARK_PREFIX " /bin/spark-class $command " $@ " >> " $log " 2>&1 < /dev/null &
149
- newpid=$!
148
+ nohup nice -n " $SPARK_NICENESS " " $SPARK_PREFIX " /bin/spark-class $command " $@ " >> " $log " 2>&1 < /dev/null &
149
+ newpid=" $! "
150
150
;;
151
151
152
152
(submit)
153
- nohup nice -n $SPARK_NICENESS " $SPARK_PREFIX " /bin/spark-submit --class $command " $@ " >> " $log " 2>&1 < /dev/null &
154
- newpid=$!
153
+ nohup nice -n " $SPARK_NICENESS " " $SPARK_PREFIX " /bin/spark-submit --class $command " $@ " >> " $log " 2>&1 < /dev/null &
154
+ newpid=" $! "
155
155
;;
156
156
157
157
(* )
@@ -160,7 +160,7 @@ run_command() {
160
160
;;
161
161
esac
162
162
163
- echo $newpid > $pid
163
+ echo " $newpid " > " $pid "
164
164
sleep 2
165
165
# Check if the process has died; in that case we'll tail the log so the user can see
166
166
if [[ ! $( ps -p " $newpid " -o args=) =~ $command ]]; then
You can’t perform that action at this time.
0 commit comments