00001 #ifndef Impala_Job_State_h 00002 #define Impala_Job_State_h 00003 00004 #include "Basis/String.h" 00005 00006 00007 namespace Impala 00008 { 00009 namespace Job 00010 { 00011 00012 class State 00013 { 00014 00015 public: 00016 00017 typedef enum StateType 00018 { 00019 UNDEFINED, 00020 CREATED, 00021 SUBMITTED, 00022 SCHEDULED, 00023 RESCHEDULED, 00024 RUNNING, 00025 KILL_ATTEMPT, 00026 TERMINATED_NRM, 00027 TERMINATED_ABNRM 00028 } StateType; 00029 00030 static String 00031 ToString(StateType state) 00032 { 00033 switch (state) 00034 { 00035 case UNDEFINED : return "undefined"; 00036 case CREATED : return "created"; 00037 case SUBMITTED : return "submitted"; 00038 case SCHEDULED : return "scheduled"; 00039 case RESCHEDULED : return "rescheduled"; 00040 case RUNNING : return "running"; 00041 case KILL_ATTEMPT : return "kill_attempt"; 00042 case TERMINATED_NRM : return "terminated_nrm"; 00043 case TERMINATED_ABNRM : return "terminated_abnorm"; 00044 } 00045 return "unknown_state"; 00046 } 00047 00048 private: 00049 00050 }; // class 00051 00052 } // namespace 00053 } // namespace 00054 00055 #endif