Skip to content

Commit

Permalink
Rename YARN build flag to SPARK_WITH_YARN
Browse files Browse the repository at this point in the history
  • Loading branch information
jey committed Aug 16, 2013
1 parent b1d9974 commit 67b5936
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions make-distribution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ VERSION=$($FWDIR/sbt/sbt "show version" | tail -1 | cut -f 2 | sed 's/^\([a-zA-Z

# Initialize defaults
SPARK_HADOOP_VERSION=1.2.1
SPARK_YARN_MODE=false
SPARK_WITH_YARN=false
MAKE_TGZ=false

# Parse arguments
Expand All @@ -58,7 +58,7 @@ while (( "$#" )); do
shift
;;
--with-yarn)
SPARK_YARN_MODE=true
SPARK_WITH_YARN=true
;;
--tgz)
MAKE_TGZ=true
Expand All @@ -74,15 +74,15 @@ else
fi

echo "Hadoop version set to $SPARK_HADOOP_VERSION"
if [ "$SPARK_YARN_MODE" == "true" ]; then
if [ "$SPARK_WITH_YARN" == "true" ]; then
echo "YARN enabled"
else
echo "YARN disabled"
fi

# Build fat JAR
export SPARK_HADOOP_VERSION
export SPARK_YARN_MODE
export SPARK_WITH_YARN
"$FWDIR/sbt/sbt" "repl/assembly"

# Make directories
Expand Down
12 changes: 7 additions & 5 deletions project/SparkBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ import AssemblyKeys._
object SparkBuild extends Build {
// Hadoop version to build against. For example, "0.20.2", "0.20.205.0", or
// "1.0.4" for Apache releases, or "0.20.2-cdh3u5" for Cloudera Hadoop.
val HADOOP_VERSION = "1.2.1"
val HADOOP_YARN = false
// Note that these variables can be set through the environment variables
// SPARK_HADOOP_VERSION and SPARK_WITH_YARN.
val DEFAULT_HADOOP_VERSION = "1.2.1"
val DEFAULT_WITH_YARN = false

// HBase version; set as appropriate.
val HBASE_VERSION = "0.94.6"
Expand Down Expand Up @@ -55,9 +57,9 @@ object SparkBuild extends Build {
lazy val publishLocalBoth = TaskKey[Unit]("publish-local", "publish local for m2 and ivy")

// Allows build configuration to be set through environment variables
lazy val hadoopVersion = scala.util.Properties.envOrElse("SPARK_HADOOP_VERSION", HADOOP_VERSION)
lazy val isYarnMode = scala.util.Properties.envOrNone("SPARK_YARN_MODE") match {
case None => HADOOP_YARN
lazy val hadoopVersion = scala.util.Properties.envOrElse("SPARK_HADOOP_VERSION", DEFAULT_HADOOP_VERSION)
lazy val isYarnMode = scala.util.Properties.envOrNone("SPARK_WITH_YARN") match {
case None => DEFAULT_WITH_YARN
case Some(v) => v.toBoolean
}

Expand Down

0 comments on commit 67b5936

Please sign in to comment.