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

    https://github.com/apache/spark/pull/1056#discussion_r15202868
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala ---
    @@ -311,6 +314,18 @@ private[spark] class TaskSchedulerImpl(
         }
       }
     
    +  override def executorHeartbeat(execId: String, taskMetrics: Array[(Long, 
TaskMetrics)],
    +      blockManagerId: BlockManagerId): Boolean = {
    +    val metricsWithStageIds = taskMetrics.flatMap(
    +      (idAndMetrics) => {
    +        val taskSetIdOption = taskIdToTaskSetId.get(idAndMetrics._1)
    +        val taskSetManagerOption = 
taskSetIdOption.flatMap(activeTaskSets.get(_))
    +        val stageIdOption = taskSetManagerOption.map(_.stageId)
    +        stageIdOption.map((idAndMetrics._1, _, idAndMetrics._2))
    +     })
    --- End diff --
    
    I think this is a little hard to read right now. Could you do the following 
here?
    ```
    taskMetrics.flatMap { case (id, metrics) =>
      ..
    }
    ```


---
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