Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Add support for new task states #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 28 additions & 18 deletions src/main/scala/mesosphere/mesos/protos/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -156,29 +156,39 @@ object Implicits {

implicit def taskStateToProto(taskState: TaskState): Protos.TaskState = {
taskState match {
case TaskFailed => Protos.TaskState.TASK_FAILED
case TaskFinished => Protos.TaskState.TASK_FINISHED
case TaskKilled => Protos.TaskState.TASK_KILLED
case TaskLost => Protos.TaskState.TASK_LOST
case TaskRunning => Protos.TaskState.TASK_RUNNING
case TaskKilling => Protos.TaskState.TASK_KILLING
case TaskStaging => Protos.TaskState.TASK_STAGING
case TaskStarting => Protos.TaskState.TASK_STARTING
case TaskError => Protos.TaskState.TASK_ERROR
case TaskFailed => Protos.TaskState.TASK_FAILED
case TaskFinished => Protos.TaskState.TASK_FINISHED
case TaskKilled => Protos.TaskState.TASK_KILLED
case TaskLost => Protos.TaskState.TASK_LOST
case TaskRunning => Protos.TaskState.TASK_RUNNING
case TaskKilling => Protos.TaskState.TASK_KILLING
case TaskStaging => Protos.TaskState.TASK_STAGING
case TaskStarting => Protos.TaskState.TASK_STARTING
case TaskError => Protos.TaskState.TASK_ERROR
case TaskDropped => Protos.TaskState.TASK_DROPPED
case TaskUnreachable => Protos.TaskState.TASK_UNREACHABLE
case TaskGone => Protos.TaskState.TASK_GONE
case TaskGoneByOperator => Protos.TaskState.TASK_GONE_BY_OPERATOR
case TaskUnknown => Protos.TaskState.TASK_UNKNOWN
}
}

implicit def taskStateToCaseClass(taskState: Protos.TaskState): TaskState = {
taskState match {
case Protos.TaskState.TASK_FAILED => TaskFailed
case Protos.TaskState.TASK_FINISHED => TaskFinished
case Protos.TaskState.TASK_KILLED => TaskKilled
case Protos.TaskState.TASK_LOST => TaskLost
case Protos.TaskState.TASK_RUNNING => TaskRunning
case Protos.TaskState.TASK_KILLING => TaskKilling
case Protos.TaskState.TASK_STAGING => TaskStaging
case Protos.TaskState.TASK_STARTING => TaskStarting
case Protos.TaskState.TASK_ERROR => TaskError
case Protos.TaskState.TASK_FAILED => TaskFailed
case Protos.TaskState.TASK_FINISHED => TaskFinished
case Protos.TaskState.TASK_KILLED => TaskKilled
case Protos.TaskState.TASK_LOST => TaskLost
case Protos.TaskState.TASK_RUNNING => TaskRunning
case Protos.TaskState.TASK_KILLING => TaskKilling
case Protos.TaskState.TASK_STAGING => TaskStaging
case Protos.TaskState.TASK_STARTING => TaskStarting
case Protos.TaskState.TASK_ERROR => TaskError
case Protos.TaskState.TASK_DROPPED => TaskDropped
case Protos.TaskState.TASK_UNREACHABLE => TaskUnreachable
case Protos.TaskState.TASK_GONE => TaskGone
case Protos.TaskState.TASK_GONE_BY_OPERATOR => TaskGoneByOperator
case Protos.TaskState.TASK_UNKNOWN => TaskUnknown
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/main/scala/mesosphere/mesos/protos/TaskState.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ case object TaskFailed extends TaskState
case object TaskKilled extends TaskState
case object TaskLost extends TaskState
case object TaskError extends TaskState
case object TaskDropped extends TaskState
case object TaskUnreachable extends TaskState
case object TaskGone extends TaskState
case object TaskGoneByOperator extends TaskState
case object TaskUnknown extends TaskState