Github user sebastienrainville commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1140#discussion_r14165286
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala
 ---
    @@ -206,14 +203,13 @@ private[spark] class MesosSchedulerBackend(
             val taskLists = scheduler.resourceOffers(offerableWorkers)
     
             // Build a list of Mesos tasks for each slave
    -        val mesosTasks = offers.map(o => 
Collections.emptyList[MesosTaskInfo]())
    +        val mesosTasks = offers.map(o => new JArrayList[MesosTaskInfo]())
             for ((taskList, index) <- taskLists.zipWithIndex) {
               if (!taskList.isEmpty) {
    -            val offerNum = offerableIndices(index)
    -            val slaveId = offers(offerNum).getSlaveId.getValue
    -            slaveIdsWithExecutors += slaveId
    -            mesosTasks(offerNum) = new 
JArrayList[MesosTaskInfo](taskList.size)
                 for (taskDesc <- taskList) {
    +              val slaveId = taskDesc.executorId
    +              val offerNum = offers.indexWhere(_.getSlaveId.getValue == 
slaveId)
    --- End diff --
    
    Oups, hadn't seen your latest comment before posting this! I'll change it 
to a hashmap like you suggested.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to