bmarcott commented on a change in pull request #27207:
URL: https://github.com/apache/spark/pull/27207#discussion_r418921358
##########
File path:
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala
##########
@@ -466,12 +503,28 @@ private[spark] class TaskSchedulerImpl(
}.sum
}
+ private def minTaskLocality(
+ l1: Option[TaskLocality],
+ l2: Option[TaskLocality]) : Option[TaskLocality] = {
+ if (l1.isEmpty) {
+ l2
+ } else if (l2.isEmpty) {
+ l1
+ } else if (l1.get < l2.get) {
+ l1
+ } else {
+ l2
+ }
+ }
+
/**
* Called by cluster manager to offer resources on slaves. We respond by
asking our active task
* sets for tasks in order of priority. We fill each node with tasks in a
round-robin manner so
* that tasks are balanced across the cluster.
*/
- def resourceOffers(offers: IndexedSeq[WorkerOffer]):
Seq[Seq[TaskDescription]] = synchronized {
+ def resourceOffers(
+ offers: IndexedSeq[WorkerOffer],
+ isAllFreeResources: Boolean = true): Seq[Seq[TaskDescription]] =
synchronized {
Review comment:
I think I originally did this to not break the api + maintain something
closer to previous behavior for callers who hadn't migrated to setting it to
false.
Lemme know if this is the wrong approach.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]