ARC SDK
|
#include <arc/compute/JobState.h>
Public Types | |
enum | StateType { UNDEFINED, ACCEPTED, PREPARING, SUBMITTING, HOLD, QUEUING, RUNNING, FINISHING, FINISHED, KILLED, FAILED, DELETED, OTHER } |
Possible job states in libarccompute. More... | |
Public Member Functions | |
JobState (const std::string &jobstate) | |
Construct state from string. More... | |
JobState & | operator= (const JobState &js) |
operator bool () const | |
operator StateType () const | |
bool | operator! () const |
bool | operator== (const StateType &st) const |
bool | operator!= (const StateType &st) const |
bool | IsFinished () const |
Check if state is finished. More... | |
const std::string & | operator() () const |
Unformatted specific job state. More... | |
const std::string & | GetGeneralState () const |
General string representation of job state. More... | |
std::string | GetSpecificState () const |
Specific string representation of job state. More... | |
Static Public Member Functions | |
static StateType | GetStateType (const std::string &state) |
Static Public Attributes | |
static const std::string | StateTypeString [] |
Protected Types | |
typedef std::string(* | SpecificStateFormater) (const std::string &) |
Protected Member Functions | |
JobState (const std::string &state, JobState::StateType(*map)(const std::string &), SpecificStateFormater ssf=FormatSpecificState) | |
Static Protected Member Functions | |
static std::string | FormatSpecificState (const std::string &state) |
Protected Attributes | |
SpecificStateFormater | ssf |
std::string | state |
StateType | type |
Friends | |
class | Job |
libarccompute state model. The class comprise the general state model used by the libarccompute library. A JobState object has two attributes: A native state as a string, and a enum value specifying the mapping to the state model. Each job management extension (JobControllerPlugin specialisation), likely a implementation against a computing service, should define a mapping of the native job states to those in the libarccompute state model, which should then be used when constructing a JobState object for that specific extension. In that way both the general and the specific state is available.
A derived class should consist of a constructor and a mapping function (a JobStateMap) which maps a std::string to a JobState:StateType. An example of a constructor in a plugin could be: JobStatePlugin::JobStatePluging(const std::string& state) : JobState(state, &pluginStateMap) {} where &pluginStateMap is a reference to the JobStateMap defined by the derived class.
Documentation for mapping of job states for different computing services to those defined in this class can be found here.
Possible job states in libarccompute.
The possible job states usable in the libarccompute library with a short description is listed below:
|
inline |
Construct state from string.
|
inline |
General string representation of job state.
Get the string representation of the job state as mapped to the libarccompute job state model.
|
inline |
Specific string representation of job state.
Get the string representation of the job state as returned by the CE service possibly formatted to a human readable string.
|
inline |
Check if state is finished.
|
inline |
Unformatted specific job state.
Get the unformatted specific job state as returned by the CE.