Skip to content
Snippets Groups Projects
Commit 4ca06256 authored by Sean Owen's avatar Sean Owen Committed by Patrick Wendell
Browse files

SPARK-1806 (addendum) Use non-deprecated methods in Mesos 0.18

The update to Mesos 0.18 caused some deprecation warnings in the build. The change to the non-deprecated version is straightforward as it emulates what the Mesos driver does with the deprecated method anyway (https://github.com/apache/mesos/blob/c5aa1dd22155d79c5a7c33076319299a40fd63b3/src/sched/sched.cpp#L1354)

Author: Sean Owen <sowen@cloudera.com>

Closes #920 from srowen/SPARK-1806 and squashes the following commits:

8d76b6a [Sean Owen] Use non-deprecated methods in Mesos 0.18
parent ab7c62d5
No related branches found
No related tags found
No related merge requests found
......@@ -207,10 +207,12 @@ private[spark] class CoarseMesosSchedulerBackend(
.addResources(createResource("cpus", cpusToUse))
.addResources(createResource("mem", sc.executorMemory))
.build()
d.launchTasks(offer.getId, Collections.singletonList(task), filters)
d.launchTasks(
Collections.singleton(offer.getId), Collections.singletonList(task), filters)
} else {
// Filter it out
d.launchTasks(offer.getId, Collections.emptyList[MesosTaskInfo](), filters)
d.launchTasks(
Collections.singleton(offer.getId), Collections.emptyList[MesosTaskInfo](), filters)
}
}
}
......
......@@ -223,7 +223,7 @@ private[spark] class MesosSchedulerBackend(
// Reply to the offers
val filters = Filters.newBuilder().setRefuseSeconds(1).build() // TODO: lower timeout?
for (i <- 0 until offers.size) {
d.launchTasks(offers(i).getId, mesosTasks(i), filters)
d.launchTasks(Collections.singleton(offers(i).getId), mesosTasks(i), filters)
}
}
} finally {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment