Skip to content

Commit

Permalink
Bug fixes for passing the JAR URIs correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
mateiz committed Apr 14, 2012
1 parent bb19ee7 commit b1b9a74
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 2 additions & 0 deletions core/src/main/scala/spark/Executor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class Executor extends org.apache.mesos.Executor with Logging {
// each URL has a unique file name so that no local filenames will clash
// in this process. This is guaranteed by MesosScheduler.
val uris = System.getProperty("spark.jar.uris", "")
logInfo("spark.jar.uris = " + uris)
val localFiles = ArrayBuffer[String]()
for (uri <- uris.split(",").filter(_.size > 0)) {
val url = new URL(uri)
Expand Down Expand Up @@ -149,6 +150,7 @@ class Executor extends org.apache.mesos.Executor with Logging {

// Download a file from a given URL to the local filesystem
private def downloadFile(url: URL, localPath: String) {
logInfo("Downloading " + url + " to " + localPath)
val in = url.openStream()
val out = new FileOutputStream(localPath)
Utils.copyStream(in, out, true)
Expand Down
5 changes: 1 addition & 4 deletions core/src/main/scala/spark/MesosScheduler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ private class MesosScheduler(
// URIs of JARs to pass to executor
var jarUris: String = ""

// Create an ExecutorInfo for our tasks
val executorInfo = createExecutorInfo()

// Sorts jobs in reverse order of run ID for use in our priority queue (so lower IDs run first)
private val jobOrdering = new Ordering[Job] {
override def compare(j1: Job, j2: Job): Int = {
Expand Down Expand Up @@ -108,7 +105,7 @@ private class MesosScheduler(
setDaemon(true)
override def run {
val sched = MesosScheduler.this
driver = new MesosSchedulerDriver(sched, frameworkName, executorInfo, master)
driver = new MesosSchedulerDriver(sched, frameworkName, createExecutorInfo(), master)
try {
val ret = driver.run()
logInfo("driver.run() returned with code " + ret)
Expand Down
1 change: 0 additions & 1 deletion core/src/main/scala/spark/SimpleJob.scala
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ class SimpleJob(
return Some(TaskDescription.newBuilder()
.setTaskId(taskId)
.setSlaveId(offer.getSlaveId)
.setExecutor(sched.executorInfo)
.setName(taskName)
.addResources(cpuRes)
.setData(ByteString.copyFrom(serializedTask))
Expand Down

0 comments on commit b1b9a74

Please sign in to comment.