4 #include "TaskInfo.pb.h"
19 enum EQueueType { pending = 0, assigned = 1, running = 2, done = 3, failed = 4, all = 5 };
21 Job(std::string
uuid =
"", std::string type =
"NONE");
39 void tasks(std::vector<TaskInfo *> & v,
EQueueType type,
bool clear =
true);
55 std::string
feeder()
const;
83 std::map<uint32_t, TaskInfo *>
mTasks[all] = {};
bool removeTask(uint32_t id, EQueueType from)
size_t size(EQueueType t=all) const
uint32_t JobID_t
Job ID type alias.
bool moveTask(uint32_t id, EQueueType from, EQueueType to)
int mSubmitterSocketIndex
Submitter socket index in NodeZyre::mZmqSockets.
uint64_t timeFinished() const
Returns time finished for the job.
Job(std::string uuid="", std::string type="NONE")
std::string mFeederUUID
Feeder UUID.
void * mSubmitterSocketID
Submitter socket identity.
void submitterSocketIndex(int i)
Set submitter socket index.
void changed(bool c)
Set if job info was changed.
int submitterSocketIndex() const
Returns submitter socket index.
bool isFinished()
Returns if jobs is finished.
std::string uuid() const
returns UUID
void submitterSocketID(void *id)
Set submitter socket identity.
std::string mConsumerUUID
Source (consumer) UUID.
std::string mUUID
Job UUID.
std::map< uint32_t, TaskInfo * > mTasks[all]
Lists of jobs.
bool changed() const
Returns if job info was changed.
bool haveMoreTasks() const
Task statuses.
bool mChanged
Flag if job was changed.
std::string consumer() const
bool addTask(uint32_t id, TaskInfo *pJob, EQueueType type)
bool isTaskInQueue(uint32_t id, EQueueType type) const
Check task presence in certain queue.
void json(Json::Value &json)
size_t sizeNotFinished() const
std::string feeder() const
std::string mType
Job type.
uint32_t mUid
Job user id (nobody : 99)
uint32_t mGid
Job group id (nogroup : 99)
uint64_t mTimeFinished
Time finished.
uint64_t mTimeStarted
Time started.
uint64_t timeStarted() const
Return time started for the job.
void tasks(std::vector< TaskInfo * > &v, EQueueType type, bool clear=true)
void * submitterSocketID() const
Returns submitter socket identity.