Skip to content

Commit 5f84acc

Browse files
committed
Add Spark-yarn dependency when SHARK_YARN=true, which by default is false.
Also fix Hadoop FileSystem Sevice Meta file assembly rules.
1 parent 2c9fb00 commit 5f84acc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

project/SharkBuild.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ object SharkBuild extends Build {
3434
// "1.0.1" for Apache releases, or "0.20.2-cdh3u3" for Cloudera Hadoop.
3535
val HADOOP_VERSION = "1.0.4"
3636

37+
// Whether to build Shark with Yarn support
38+
val YARN_ENABLED = scala.util.Properties.envOrNone("SHARK_YARN") match {
39+
case None => false
40+
case Some(v) => v.toBoolean
41+
}
42+
3743
// Whether to build Shark with Tachyon jar.
3844
val TACHYON_ENABLED = false
3945

@@ -117,6 +123,7 @@ object SharkBuild extends Build {
117123
"junit" % "junit" % "4.10" % "test",
118124
"net.java.dev.jets3t" % "jets3t" % "0.7.1",
119125
"com.novocode" % "junit-interface" % "0.8" % "test") ++
126+
(if (YARN_ENABLED) Some("org.apache.spark" %% "spark-yarn" % SPARK_VERSION) else None).toSeq ++
120127
(if (TACHYON_ENABLED) Some("org.tachyonproject" % "tachyon" % "0.3.0-SNAPSHOT" excludeAll(excludeKyro, excludeHadoop) ) else None).toSeq
121128
)
122129

@@ -129,6 +136,7 @@ object SharkBuild extends Build {
129136
mergeStrategy in assembly := {
130137
case m if m.toLowerCase.endsWith("manifest.mf") => MergeStrategy.discard
131138
case m if m.toLowerCase.matches("meta-inf.*\\.sf$") => MergeStrategy.discard
139+
case "META-INF/services/org.apache.hadoop.fs.FileSystem" => MergeStrategy.concat
132140
case "reference.conf" => MergeStrategy.concat
133141
case _ => MergeStrategy.first
134142
}

0 commit comments

Comments
 (0)