spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davies <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-13465] Add a task failure listener to T...
Date Fri, 26 Feb 2016 01:02:22 GMT
Github user davies commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11340#discussion_r54191628
  
    --- Diff: core/src/main/scala/org/apache/spark/TaskContextImpl.scala ---
    @@ -55,14 +58,30 @@ private[spark] class TaskContextImpl(
         this
       }
     
    -  override def addTaskCompletionListener(f: TaskContext => Unit): this.type = {
    -    onCompleteCallbacks += new TaskCompletionListener {
    -      override def onTaskCompletion(context: TaskContext): Unit = f(context)
    -    }
    +  override def addTaskFailureListener(listener: TaskFailureListener): this.type = {
    +    onFailureCallbacks += listener
         this
       }
     
    -  /** Marks the task as completed and triggers the listeners. */
    +  /** Marks the task as completed and triggers the failure listeners. */
    +  private[spark] def markTaskFailed(error: Throwable): Unit = {
    +    val errorMsgs = new ArrayBuffer[String](2)
    +    // Process complete callbacks in the reverse order of registration
    +    onFailureCallbacks.reverse.foreach { listener =>
    --- End diff --
    
    Existing: Should we store these callback as reversed order, so don't need to reverse them
for every callback, especially for onCompleteCallbacks.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message