scala没有从语法的角度来支持枚举,而是通过定义了一个接口Enumeration来支持的 object ExecutorState extends Enumeration{ type ExecutorState = Value val LAUNCHING, LOADING, RUNNING, KILLED, FAILED, LOST, EXITED = Value def isFinished(state:ExecutorState):Boolean = { Seq(KILLED, FAILE…