Skip to content
Snippets Groups Projects
Commit 1beb843a authored by Kay Ousterhout's avatar Kay Ousterhout
Browse files

Reuse the set of failed states rather than creating a new object each time

parent c92dd627
No related branches found
No related tags found
No related merge requests found
......@@ -24,9 +24,11 @@ private[spark] object TaskState
val LAUNCHING, RUNNING, FINISHED, FAILED, KILLED, LOST = Value
val FINISHED_STATES = Set(FINISHED, FAILED, KILLED, LOST)
type TaskState = Value
def isFinished(state: TaskState) = Seq(FINISHED, FAILED, KILLED, LOST).contains(state)
def isFinished(state: TaskState) = FINISHED_STATES.contains(state)
def toMesos(state: TaskState): MesosTaskState = state match {
case LAUNCHING => MesosTaskState.TASK_STARTING
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment