From dd7561d33761d119ded09cfba072147292bf6964 Mon Sep 17 00:00:00 2001 From: erenavsarogullari Date: Wed, 21 Sep 2016 14:47:18 +0100 Subject: [CORE][MINOR] Add minor code change to TaskState and Task ## What changes were proposed in this pull request? - TaskState and ExecutorState expose isFailed and isFinished functions. It can be useful to add test coverage for different states. Currently, Other enums do not expose any functions so this PR aims just these two enums. - `private` access modifier is added for Finished Task States Set - A minor doc change is added. ## How was this patch tested? New Unit tests are added and run locally. Author: erenavsarogullari Closes #15143 from erenavsarogullari/SPARK-17584. --- core/src/main/scala/org/apache/spark/TaskState.scala | 2 +- core/src/main/scala/org/apache/spark/scheduler/Task.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/org/apache/spark/TaskState.scala b/core/src/main/scala/org/apache/spark/TaskState.scala index cbace7b5f9..596ce67d4c 100644 --- a/core/src/main/scala/org/apache/spark/TaskState.scala +++ b/core/src/main/scala/org/apache/spark/TaskState.scala @@ -21,7 +21,7 @@ private[spark] object TaskState extends Enumeration { val LAUNCHING, RUNNING, FINISHED, FAILED, KILLED, LOST = Value - val FINISHED_STATES = Set(FINISHED, FAILED, KILLED, LOST) + private val FINISHED_STATES = Set(FINISHED, FAILED, KILLED, LOST) type TaskState = Value diff --git a/core/src/main/scala/org/apache/spark/scheduler/Task.scala b/core/src/main/scala/org/apache/spark/scheduler/Task.scala index 1ed36bf069..ea9dc3988d 100644 --- a/core/src/main/scala/org/apache/spark/scheduler/Task.scala +++ b/core/src/main/scala/org/apache/spark/scheduler/Task.scala @@ -239,7 +239,7 @@ private[spark] object Task { * and return the task itself as a serialized ByteBuffer. The caller can then update its * ClassLoaders and deserialize the task. * - * @return (taskFiles, taskJars, taskBytes) + * @return (taskFiles, taskJars, taskProps, taskBytes) */ def deserializeWithDependencies(serializedTask: ByteBuffer) : (HashMap[String, Long], HashMap[String, Long], Properties, ByteBuffer) = { -- cgit v1.2.3