diff --git a/core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala b/core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala index 6bda8b00aca5b..4840d8bd2d2f0 100644 --- a/core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala +++ b/core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala @@ -90,7 +90,7 @@ case class SparkListenerExecutorAdded(executorId: String, executorInfo: Executor extends SparkListenerEvent @DeveloperApi -case class SparkListenerExecutorRemoved(executorId: String, executorInfo: ExecutorInfo) +case class SparkListenerExecutorRemoved(executorId: String) extends SparkListenerEvent /** diff --git a/core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala b/core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala index 193f6c48e6fca..5786d367464f4 100644 --- a/core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala +++ b/core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala @@ -216,7 +216,7 @@ class CoarseGrainedSchedulerBackend(scheduler: TaskSchedulerImpl, val actorSyste totalCoreCount.addAndGet(-executorInfo.totalCores) totalRegisteredExecutors.addAndGet(-1) scheduler.executorLost(executorId, SlaveLost(reason)) - listenerBus.post(SparkListenerExecutorRemoved(executorId, executorInfo)) + listenerBus.post(SparkListenerExecutorRemoved(executorId)) case None => logError(s"Asked to remove non-existent executor $executorId") } } diff --git a/core/src/main/scala/org/apache/spark/util/JsonProtocol.scala b/core/src/main/scala/org/apache/spark/util/JsonProtocol.scala index 8faa10baf528a..a025011006156 100644 --- a/core/src/main/scala/org/apache/spark/util/JsonProtocol.scala +++ b/core/src/main/scala/org/apache/spark/util/JsonProtocol.scala @@ -207,8 +207,7 @@ private[spark] object JsonProtocol { def executorRemovedToJson(executorRemoved: SparkListenerExecutorRemoved): JValue = { ("Event" -> Utils.getFormattedClassName(executorRemoved)) ~ - ("Executor ID" -> executorRemoved.executorId) ~ - ("Executor Info" -> executorInfoToJson(executorRemoved.executorInfo)) + ("Executor ID" -> executorRemoved.executorId) } /** ------------------------------------------------------------------- * @@ -555,8 +554,7 @@ private[spark] object JsonProtocol { def executorRemovedFromJson(json: JValue): SparkListenerExecutorRemoved = { val executorId = (json \ "Executor ID").extract[String] - val executorInfo = executorInfoFromJson(json \ "Executor Info") - SparkListenerExecutorRemoved(executorId, executorInfo) + SparkListenerExecutorRemoved(executorId) } /** --------------------------------------------------------------------- * diff --git a/core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala b/core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala index 432a9c20cb4ba..5ba94ff67d395 100644 --- a/core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala @@ -72,8 +72,7 @@ class JsonProtocolSuite extends FunSuite { val applicationEnd = SparkListenerApplicationEnd(42L) val executorAdded = SparkListenerExecutorAdded("exec1", new ExecutorInfo("Hostee.awesome.com", 11)) - val executorRemoved = SparkListenerExecutorRemoved("exec2", - new ExecutorInfo("Hoster.awesome.com", 42)) + val executorRemoved = SparkListenerExecutorRemoved("exec2") testEvent(stageSubmitted, stageSubmittedJsonString) testEvent(stageCompleted, stageCompletedJsonString) @@ -352,7 +351,6 @@ class JsonProtocolSuite extends FunSuite { assertEquals(e1.executorInfo, e2.executorInfo) case (e1: SparkListenerExecutorRemoved, e2: SparkListenerExecutorRemoved) => assert(e1.executorId == e1.executorId) - assertEquals(e1.executorInfo, e2.executorInfo) case (e1, e2) => assert(e1 === e2) case _ => fail("Events don't match in types!") @@ -1447,11 +1445,7 @@ class JsonProtocolSuite extends FunSuite { """ |{ | "Event": "SparkListenerExecutorRemoved", - | "Executor ID": "exec2", - | "Executor Info": { - | "Host": "Hoster.awesome.com", - | "Total Cores": 42 - | } + | "Executor ID": "exec2" |} """ }