2010-03-30 03:17:55 +04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Figure out where the Scala framework is installed
|
|
|
|
FWDIR=`dirname $0`
|
|
|
|
|
2010-07-20 05:00:30 +04:00
|
|
|
# Load environment variables from conf/spark-env.sh, if it exists
|
|
|
|
if [ -e $FWDIR/conf/spark-env.sh ] ; then
|
|
|
|
. $FWDIR/conf/spark-env.sh
|
|
|
|
fi
|
|
|
|
|
2010-08-13 11:39:36 +04:00
|
|
|
if [ "x$MESOS_HOME" != "x" ] ; then
|
|
|
|
SPARK_CLASSPATH="$MESOS_HOME/lib/java/mesos.jar:$SPARK_CLASSPATH"
|
|
|
|
SPARK_LIBRARY_PATH="$MESOS_HOME/lib/java:$SPARK_LIBARY_PATH"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "x$SPARK_MEM" == "x" ] ; then
|
2010-07-26 05:10:03 +04:00
|
|
|
SPARK_MEM="300m"
|
2010-07-20 05:00:30 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Set JAVA_OPTS to be able to load native libraries and to set heap size
|
|
|
|
JAVA_OPTS="$SPARK_JAVA_OPTS"
|
|
|
|
JAVA_OPTS+=" -Djava.library.path=$SPARK_LIBRARY_PATH:$FWDIR/third_party:$FWDIR/src/native"
|
|
|
|
JAVA_OPTS+=" -Xms$SPARK_MEM -Xmx$SPARK_MEM"
|
|
|
|
# Load extra JAVA_OPTS from conf/java-opts, if it exists
|
2010-03-30 03:17:55 +04:00
|
|
|
if [ -e $FWDIR/conf/java-opts ] ; then
|
|
|
|
JAVA_OPTS+=" `cat $FWDIR/conf/java-opts`"
|
|
|
|
fi
|
|
|
|
export JAVA_OPTS
|
|
|
|
|
|
|
|
# Build up classpath
|
2010-09-29 10:22:07 +04:00
|
|
|
CLASSPATH="$SPARK_CLASSPATH:$FWDIR/build/classes"
|
|
|
|
CLASSPATH+=:$FWDIR/conf
|
|
|
|
CLASSPATH+=:$FWDIR/third_party/mesos.jar
|
|
|
|
CLASSPATH+=:$FWDIR/third_party/asm-3.2/lib/all/asm-all-3.2.jar
|
|
|
|
CLASSPATH+=:$FWDIR/third_party/colt.jar
|
2010-10-16 02:55:58 +04:00
|
|
|
CLASSPATH+=:$FWDIR/third_party/guava-r07/guava-r07.jar
|
2010-09-29 10:22:07 +04:00
|
|
|
CLASSPATH+=:$FWDIR/third_party/hadoop-0.20.0/hadoop-0.20.0-core.jar
|
|
|
|
CLASSPATH+=:$FWDIR/third_party/scalatest-1.2/scalatest-1.2.jar
|
|
|
|
CLASSPATH+=:$FWDIR/third_party/scalacheck_2.8.0-1.7.jar
|
|
|
|
CLASSPATH+=:$FWDIR/third_party/jetty-7.1.6.v20100715/jetty-server-7.1.6.v20100715.jar
|
|
|
|
CLASSPATH+=:$FWDIR/third_party/jetty-7.1.6.v20100715/servlet-api-2.5.jar
|
|
|
|
CLASSPATH+=:$FWDIR/third_party/apache-log4j-1.2.16/log4j-1.2.16.jar
|
|
|
|
CLASSPATH+=:$FWDIR/third_party/slf4j-1.6.1/slf4j-api-1.6.1.jar
|
|
|
|
CLASSPATH+=:$FWDIR/third_party/slf4j-1.6.1/slf4j-log4j12-1.6.1.jar
|
2010-03-30 03:17:55 +04:00
|
|
|
for jar in $FWDIR/third_party/hadoop-0.20.0/lib/*.jar; do
|
2010-09-29 10:22:07 +04:00
|
|
|
CLASSPATH+=:$jar
|
2010-03-30 03:17:55 +04:00
|
|
|
done
|
2010-09-29 10:22:07 +04:00
|
|
|
export CLASSPATH # Needed for spark-shell
|
2010-03-30 03:17:55 +04:00
|
|
|
|
|
|
|
if [ -n "$SCALA_HOME" ]; then
|
|
|
|
SCALA=${SCALA_HOME}/bin/scala
|
|
|
|
else
|
|
|
|
SCALA=scala
|
|
|
|
fi
|
|
|
|
|
2010-09-29 10:22:07 +04:00
|
|
|
exec $SCALA -cp $CLASSPATH $@
|