@@ -33,13 +33,13 @@ export SPARK_HOME="$FWDIR"
3333. $FWDIR /bin/load-spark-env.sh
3434
3535if [ -z " $1 " ]; then
36- echo " Usage: spark-class <class> [<args>]" >&2
36+ echo " Usage: spark-class <class> [<args>]" 1 >&2
3737 exit 1
3838fi
3939
4040if [ -n " $SPARK_MEM " ]; then
41- echo " Warning: SPARK_MEM is deprecated, please use a more specific config option"
42- echo " (e.g., spark.executor.memory or SPARK_DRIVER_MEMORY)."
41+ echo -e " Warning: SPARK_MEM is deprecated, please use a more specific config option" 1>&2
42+ echo -e " (e.g., spark.executor.memory or SPARK_DRIVER_MEMORY)." 1>&2
4343fi
4444
4545# Use SPARK_MEM or 512m as the default memory, to be overridden by specific options
@@ -110,9 +110,9 @@ export JAVA_OPTS
110110
111111TOOLS_DIR=" $FWDIR " /tools
112112SPARK_TOOLS_JAR=" "
113- if [ -e " $TOOLS_DIR " /target/scala-$SCALA_VERSION /* assembly * [0-9Tg].jar ]; then
113+ if [ -e " $TOOLS_DIR " /target/scala-$SCALA_VERSION /spark-tools * [0-9Tg].jar ]; then
114114 # Use the JAR from the SBT build
115- export SPARK_TOOLS_JAR=` ls " $TOOLS_DIR " /target/scala-$SCALA_VERSION /* assembly * [0-9Tg].jar`
115+ export SPARK_TOOLS_JAR=` ls " $TOOLS_DIR " /target/scala-$SCALA_VERSION /spark-tools * [0-9Tg].jar`
116116fi
117117if [ -e " $TOOLS_DIR " /target/spark-tools* [0-9Tg].jar ]; then
118118 # Use the JAR from the Maven build
@@ -130,6 +130,11 @@ else
130130fi
131131
132132if [[ " $1 " =~ org.apache.spark.tools.* ]]; then
133+ if test -z " $SPARK_TOOLS_JAR " ; then
134+ echo " Failed to find Spark Tools Jar in $FWDIR /tools/target/scala-$SCALA_VERSION /" 1>&2
135+ echo " You need to build spark before running $1 ." 1>&2
136+ exit 1
137+ fi
133138 CLASSPATH=" $CLASSPATH :$SPARK_TOOLS_JAR "
134139fi
135140
142147export CLASSPATH
143148
144149if [ " $SPARK_PRINT_LAUNCH_COMMAND " == " 1" ]; then
145- echo -n " Spark Command: "
146- echo " $RUNNER " -cp " $CLASSPATH " $JAVA_OPTS " $@ "
147- echo " ========================================"
148- echo
150+ echo -n " Spark Command: " 1>&2
151+ echo " $RUNNER " -cp " $CLASSPATH " $JAVA_OPTS " $@ " 1>&2
152+ echo -e " ========================================\n" 1>&2
149153fi
150154
151155exec " $RUNNER " -cp " $CLASSPATH " $JAVA_OPTS " $@ "
0 commit comments