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

    https://github.com/apache/spark/pull/8007#discussion_r37353128
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/ExecutorLossReason.scala ---
    @@ -23,13 +23,29 @@ import org.apache.spark.executor.ExecutorExitCode
      * Represents an explanation for a executor or whole slave failing or 
exiting.
      */
     private[spark]
    -class ExecutorLossReason(val message: String) {
    +class ExecutorLossReason(val message: String) extends Serializable {
       override def toString: String = message
     }
     
    +private[spark] case class ExecutorExitedAbnormally(val exitCode: Int, 
reason: String)
    +  extends ExecutorLossReason(reason) {
    +}
    +
    +private[spark] object ExecutorExitedAbnormally {
    +  def apply(exitCode: Int): ExecutorExitedAbnormally = {
    +    ExecutorExitedAbnormally(exitCode, 
ExecutorExitCode.explainExitCode(exitCode))
    +  }
    +}
    +
     private[spark]
    -case class ExecutorExited(val exitCode: Int)
    -  extends ExecutorLossReason(ExecutorExitCode.explainExitCode(exitCode)) {
    +case class ExecutorExitedNormally(val exitCode: Int, reason: String)
    +  extends ExecutorLossReason(reason) {
    +}
    +
    +private[spark] object ExecutorExitedNormally {
    --- End diff --
    
    I don't know, I find `ExecutorExitedAbnormally` and 
`ExecutorExitedNormally` a little confusing, since internally they hold exactly 
the same data (even the same reason message). What if there was only 
`ExecutorExited` with a parameter saying whether it should be treated as an 
error or not?


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

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

Reply via email to