Commit 0347cfbd by 杜发飞

1

parent 655c5792
...@@ -3,7 +3,7 @@ package com.hikcreate.data.listener ...@@ -3,7 +3,7 @@ package com.hikcreate.data.listener
import com.hikcreate.data.client.EmailClient import com.hikcreate.data.client.EmailClient
import com.hikcreate.data.common.Logging import com.hikcreate.data.common.Logging
import com.hikcreate.data.constant.ApolloConst import com.hikcreate.data.constant.ApolloConst
import org.apache.spark.{ExceptionFailure, SparkConf, TaskFailedReason, TaskKilled} import org.apache.spark._
import org.apache.spark.scheduler.{SparkListener, SparkListenerApplicationEnd, SparkListenerApplicationStart, SparkListenerTaskEnd} import org.apache.spark.scheduler.{SparkListener, SparkListenerApplicationEnd, SparkListenerApplicationStart, SparkListenerTaskEnd}
import org.joda.time.DateTime import org.joda.time.DateTime
...@@ -30,9 +30,10 @@ class LifecycleListener(conf:SparkConf) extends SparkListener with Logging { ...@@ -30,9 +30,10 @@ class LifecycleListener(conf:SparkConf) extends SparkListener with Logging {
val info = taskEnd.taskInfo val info = taskEnd.taskInfo
if (info != null && taskEnd.stageAttemptId != -1) { if (info != null && taskEnd.stageAttemptId != -1) {
val errorMessage: Option[String] = taskEnd.reason match { val errorMessage: Option[String] = taskEnd.reason match {
case kill:TaskKilled => Some(kill.toErrorString)
case e: ExceptionFailure => Some(e.toErrorString) case e: ExceptionFailure => Some(e.toErrorString)
case e: TaskFailedReason => Some(e.toErrorString) case e: TaskFailedReason => Some(e.toErrorString)
case kill:TaskKilled => Some(kill.toErrorString)
case UnknownReason => Some(UnknownReason.toErrorString)
case _ => None case _ => None
} }
if (errorMessage.nonEmpty) { if (errorMessage.nonEmpty) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment