Skip to content

Commit c886568

Browse files
committed
Fix lines too long + a few comments / style (minor)
1 parent 7a4190a commit c886568

File tree

4 files changed

+26
-14
lines changed

4 files changed

+26
-14
lines changed

bin/pyspark

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ FWDIR="$(cd `dirname $0`/..; pwd)"
2323
# Export this as SPARK_HOME
2424
export SPARK_HOME="$FWDIR"
2525

26-
source $FWDIR/bin/utils.sh
26+
# Load utility functions
27+
. "$FWDIR/bin/utils.sh"
2728

2829
SCALA_VERSION=2.10
2930

bin/run-tests

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ function echo_test_result() {
7272
fi
7373
}
7474

75-
# Test parse_java_property. This takes in three parameters, the name of the config,
76-
# the expected value, and whether or not to ignore whitespace (e.g. for multi-line).
75+
# Test parse_java_property. This takes in three parameters, the name of
76+
# the config, the expected value, and whether or not to ignore whitespace.
7777
function test_parse_java_property() {
7878
key="$1"
7979
expected_value="$2"
@@ -166,20 +166,25 @@ for delimiter in "${delimiters[@]}"; do
166166
test_parse_java_property "spark.$delimiter.3" "-Dstraw=\"berry again\""
167167
test_parse_java_property "spark.$delimiter.4" "-Dstraw=\"berry \\\"quote\""
168168
test_parse_java_property "spark.$delimiter.5" "-Dstraw=\"berry \\\\backslash\""
169-
test_parse_java_property "spark.$delimiter.6" "-Dstraw=\"berry \\\"quotes\\\" and \\\\backslashes\\\\ \""
170-
test_parse_java_property "spark.$delimiter.7" "-Dstraw=berry -Dblue=berry -Dblack=berry"
171-
test_parse_java_property "spark.$delimiter.8" "-Dstraw=\"berry space\" -Dblue=\"berry\" -Dblack=berry"
169+
test_parse_java_property "spark.$delimiter.6" \
170+
"-Dstraw=\"berry \\\"quotes\\\" and \\\\backslashes\\\\ \""
171+
test_parse_java_property "spark.$delimiter.7" \
172+
"-Dstraw=berry -Dblue=berry -Dblack=berry"
173+
test_parse_java_property "spark.$delimiter.8" \
174+
"-Dstraw=\"berry space\" -Dblue=\"berry\" -Dblack=berry"
172175
test_parse_java_property "spark.$delimiter.9" \
173176
"-Dstraw=\"berry space\" -Dblue=\"berry \\\"quotes\\\"\" -Dblack=\"berry \\\\backslashes\\\\ \""
174177
test_parse_java_property "spark.$delimiter.10" \
175-
"-Dstraw=\"berry space\" -Dblue=\"berry \\\"quotes\\\"\" -Dblack=\"berry \\\\backslashes\\\\ \"" IGNORE_WHITESPACE
178+
"-Dstraw=\"berry space\" -Dblue=\"berry \\\"quotes\\\"\" -Dblack=\"berry \\\\backslashes\\\\ \"" \
179+
IGNORE_WHITESPACE
176180
done
177181
log_error
178182

179183
# Test split_java_options. Note that this relies on parse_java_property to work correctly.
180184
log_error "--- Testing split_java_options ---"
181185
if [[ "$tests_failed" == 1 ]]; then
182-
log_error "* WARNING: Tests for parse_java_property failed! This should also fail tests for split_java_options"
186+
log_error "* WARNING: Tests for parse_java_property failed!"
187+
log_error "This should also fail tests for split_java_options"
183188
fi
184189
test_split_java_options "spark.space.1" 1 "-Dstraw=berry"
185190
test_split_java_options "spark.space.2" 1 "-Dstraw=berry"
@@ -198,16 +203,20 @@ log_error
198203
# Test quote_java_property. Note that this relies on split_java_options to work correctly.
199204
log_error "--- Testing quote_java_property ---"
200205
if [[ "$tests_failed" == 1 ]]; then
201-
log_error "* WARNING: Tests for split_java_options failed! This should also fail tests for quote_java_property"
206+
log_error "* WARNING: Tests for split_java_options failed!"
207+
log_error "This should also fail tests for quote_java_property"
202208
fi
203209
test_quote_java_property "spark.space.1" 1 "\"-Dstraw=berry\""
204210
test_quote_java_property "spark.space.2" 1 "\"-Dstraw=berry\""
205211
test_quote_java_property "spark.space.3" 1 "\"-Dstraw=berry again\""
206212
test_quote_java_property "spark.space.4" 1 "\"-Dstraw=berry \"quote\""
207213
test_quote_java_property "spark.space.5" 1 "\"-Dstraw=berry \\backslash\""
208-
test_quote_java_property "spark.space.6" 1 "\"-Dstraw=berry \"quotes\" and \\backslashes\\ \""
209-
test_quote_java_property "spark.space.7" 3 "\"-Dstraw=berry\"" "\"-Dblue=berry\"" "\"-Dblack=berry\""
210-
test_quote_java_property "spark.space.8" 3 "\"-Dstraw=berry space\"" "\"-Dblue=berry\"" "\"-Dblack=berry\""
214+
test_quote_java_property "spark.space.6" 1 \
215+
"\"-Dstraw=berry \"quotes\" and \\backslashes\\ \""
216+
test_quote_java_property "spark.space.7" 3 \
217+
"\"-Dstraw=berry\"" "\"-Dblue=berry\"" "\"-Dblack=berry\""
218+
test_quote_java_property "spark.space.8" 3 \
219+
"\"-Dstraw=berry space\"" "\"-Dblue=berry\"" "\"-Dblack=berry\""
211220
test_quote_java_property "spark.space.9" 3 \
212221
"\"-Dstraw=berry space\"" "\"-Dblue=berry \"quotes\"\"" "\"-Dblack=berry \\backslashes\\ \""
213222
test_quote_java_property "spark.space.10" 3 \

bin/spark-class

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ fi
157157
export CLASSPATH
158158

159159
if [ "$SPARK_PRINT_LAUNCH_COMMAND" == "1" ]; then
160-
# Put quotes around system properties in case they contain spaces
160+
# Put quotes around system properties in case they contain spaces for readability
161161
# This exports the resulting list of java opts into QUOTED_JAVA_OPTS
162162
quote_java_property "${SPLIT_JAVA_OPTS[@]}"
163163
echo -n "Spark Command: " 1>&2

bin/spark-shell

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ if [[ "$@" = *--help ]] || [[ "$@" = *-h ]]; then
4141
usage
4242
fi
4343

44-
source $FWDIR/bin/utils.sh
44+
# Load utility functions
45+
. "$FWDIR/bin/utils.sh"
46+
4547
SUBMIT_USAGE_FUNCTION=usage
4648
gatherSparkSubmitOpts "$@"
4749

0 commit comments

Comments
 (0)