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