Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Sephiroth-Lin committed Apr 17, 2015
1 parent 547fd95 commit c63f31f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.spark.deploy.yarn

import java.io.File
import java.net.{InetAddress, UnknownHostException, URI, URISyntaxException}
import java.nio.ByteBuffer

Expand Down Expand Up @@ -752,8 +753,17 @@ object Client extends Logging {
if (conf.contains(CONF_PYSPARK_ARCHIVES)) {
conf.get(CONF_PYSPARK_ARCHIVES)
} else {
val sparkJarPath = SparkContext.jarOfClass(this.getClass).head
sparkJarPath.substring(0, sparkJarPath.lastIndexOf('/')) + "/pyspark.zip"
SparkContext.jarOfClass(this.getClass) match {
case Some(jarPath) =>
val path = new File(jarPath)
val archives = new File(path.getParent + File.separator + "pyspark.zip")
if (archives.exists()) {
archives.getAbsolutePath
} else {
""
}
case None => ""
}
}
}

Expand Down

0 comments on commit c63f31f

Please sign in to comment.