#include <job_status.hpp>
Collaboration diagram for CJobStatusTracker:
Definition at line 57 of file job_status.hpp.
Public Types | |
| typedef vector< TNSBitVector * > | TStatusStorage |
| typedef map< TJobStatus, unsigned > | TStatusSummaryMap |
| Status to number of jobs map. | |
Public Member Functions | |
| CJobStatusTracker () | |
| ~CJobStatusTracker () | |
| TJobStatus | GetStatus (unsigned job_id) const |
| TJobStatus | ChangeStatus (unsigned job_id, TJobStatus status, bool *updated=NULL) |
| Set job status. | |
| void | AddPendingBatch (unsigned job_id_from, unsigned job_id_to) |
| Add closed interval of ids to pending status. | |
| bool | GetPendingJobFromSet (TNSBitVector *candidate_set, unsigned *job_id) |
| Get pending job out of a certain candidate set Method cleans candidates if they are no longer available for scheduling (it means job was already dispatched). | |
| bool | GetPendingJob (const TNSBitVector &unwanted_jobs, unsigned *job_id) |
| Get any pending job, but it should NOT be in the unwanted list Presumed, that unwanted jobs are speculatively assigned to other worker nodes or postponed. | |
| void | PendingIntersect (TNSBitVector *candidate_set) |
| Logical AND of candidates and pending jobs (candidate_set &= pending_set). | |
| void | SwitchJobs (unsigned count, TJobStatus old_status, TJobStatus new_status, TNSBitVector &jobs, const TNSBitVector *unwanted_jobs=NULL) |
| Group switch up to 'count' jobs, not including ones from 'unwanted_jobs', from old_status to new_status. | |
| void | GetAliveJobs (TNSBitVector &ids) |
| Logical AND with statuses ORed cleans up a list from non-existing jobs. | |
| bool | AnyPending () const |
| TRUE if we have pending jobs. | |
| unsigned | GetFirstDone () const |
| Get first job id from DONE status. | |
| unsigned | GetFirst (TJobStatus status) const |
| Get first job in the specified status. | |
| unsigned | GetNext (TJobStatus status, unsigned job_id) const |
| Get next job in the specified status, or first if job_id is 0. | |
| void | SetStatus (unsigned job_id, TJobStatus status) |
| void | Erase (unsigned job_id) |
| void | SetExactStatusNoLock (unsigned job_id, TJobStatus status, bool set_clear) |
| Set job status without any protection. | |
| unsigned | CountStatus (TJobStatus status) const |
| Return number of jobs in specified status. | |
| void | CountStatus (TStatusSummaryMap *status_map, const TNSBitVector *candidate_set) |
| Count all status vectors using candidate_set(optional) as a mask (AND_COUNT). | |
| unsigned | Count (void) |
| Count all jobs in any status. | |
| void | StatusStatistics (TJobStatus status, TNSBitVector::statistics *st) const |
| void | StatusSnapshot (TJobStatus status, TNSBitVector *bv) const |
| Specified status is OR-ed with the target vector. | |
| void | ClearAll (TNSBitVector *bv=0) |
| Clear status storage. | |
| void | OptimizeMem () |
| Optimize bitvectors memory. | |
| void | PrintStatusMatrix (CNcbiOstream &out) const |
Static Public Member Functions | |
| static bool | IsCancelCode (TJobStatus status) |
Protected Member Functions | |
| TJobStatus | x_GetStatusNoLock (unsigned job_id) const |
| TJobStatus | IsStatusNoLock (unsigned job_id, TJobStatus st1, TJobStatus st2=CNetScheduleAPI::eJobNotFound, TJobStatus st3=CNetScheduleAPI::eJobNotFound) const |
| Check if job is in specified status. | |
| void | ReportInvalidStatus (unsigned job_id, TJobStatus status, TJobStatus old_status) |
| void | x_SetClearStatusNoLock (unsigned job_id, TJobStatus status, TJobStatus old_status) |
| void | IncDoneJobs () |
Private Member Functions | |
| CJobStatusTracker (const CJobStatusTracker &) | |
| CJobStatusTracker & | operator= (const CJobStatusTracker &) |
Private Attributes | |
| TStatusStorage | m_StatusStor |
| CRWLock | m_Lock |
| TNSBitVector | m_UsedIds |
| bm::id_t | m_LastPending |
| Last pending id. | |
| unsigned | m_DoneCnt |
| Done jobs counter. | |
Friends | |
| class | CNetSchedule_JSGroupGuard |
|
|
Definition at line 60 of file job_status.hpp. |
|
|
Status to number of jobs map.
Definition at line 63 of file job_status.hpp. |
|
|
Definition at line 42 of file job_status.cpp. References bm::BM_GAP, CNetScheduleAPI::eLastStatus, and m_StatusStor. |
|
|
Definition at line 54 of file job_status.cpp. References m_StatusStor. |
|
|
|
|
||||||||||||
|
Add closed interval of ids to pending status.
Definition at line 327 of file job_status.cpp. References CNetScheduleAPI::ePending, m_Lock, m_StatusStor, and bm::bvector< Alloc, MS >::set_range(). |
|
|
TRUE if we have pending jobs.
Definition at line 459 of file job_status.cpp. References bm::bvector< Alloc, MS >::any(), CNetScheduleAPI::ePending, m_Lock, and m_StatusStor. Referenced by CQueue::NotifyListeners(), CQueue::Submit(), and CQueue::SubmitBatch(). |
|
||||||||||||||||
|
Set job status. (Controls status change logic) Status switching rules, [] - means request ignored ePending <- eRunning, "no status" eRunning <- ePending, [eCanceled] eCanceled <- ePending, eRunning, [eDone, eFailed (ignored if job is ready)] eFailed <- eRunning, [eCanceled] eDone <- ePending, eRunning, [eCanceled, eFailed], eReading (timeout) eReading <- eDone eConfirmed <- eReading, eDone eReadFailed <- eReading
Definition at line 223 of file job_status.cpp. References _ASSERT, CNetScheduleAPI::eCanceled, CNetScheduleAPI::eDone, CNetScheduleAPI::eFailed, CNetScheduleAPI::eJobNotFound, CNetScheduleAPI::ePending, CNetScheduleAPI::eReturned, CNetScheduleAPI::eRunning, IncDoneJobs(), IsCancelCode(), IsStatusNoLock(), m_Lock, ReportInvalidStatus(), SetExactStatusNoLock(), x_GetStatusNoLock(), and x_SetClearStatusNoLock(). Referenced by CNetSchedule_JS_Guard::CNetSchedule_JS_Guard(), and CQueue::x_UpdateDB_GetJobNoLock(). |
|
|
Clear status storage.
Definition at line 181 of file job_status.cpp. References m_Lock, and m_StatusStor. Referenced by CQueue::Clear(). |
|
|
Count all jobs in any status.
Definition at line 112 of file job_status.cpp. References m_Lock, and m_StatusStor. Referenced by CQueue::IsExpired(). |
|
||||||||||||
|
Count all status vectors using candidate_set(optional) as a mask (AND_COUNT).
Definition at line 91 of file job_status.cpp. References _ASSERT, map_checker< Container >::clear(), bm::count_and(), m_Lock, and m_StatusStor. |
|
|
Return number of jobs in specified status.
Definition at line 84 of file job_status.cpp. References m_Lock, and m_StatusStor. Referenced by CQueue::CountStatus(). |
|
|
Definition at line 175 of file job_status.cpp. References CNetScheduleAPI::eJobNotFound, and SetStatus(). Referenced by CQueue::CheckJobsExpiry(), and CQueue::EraseJob(). |
|
|
Logical AND with statuses ORed cleans up a list from non-existing jobs.
Definition at line 449 of file job_status.cpp. References m_Lock, and m_StatusStor. Referenced by CQueue::FilterJobs(). |
|
|
Get first job in the specified status.
Definition at line 476 of file job_status.cpp. References bm::bvector< Alloc, MS >::get_first(), m_Lock, and m_StatusStor. Referenced by GetFirstDone(). |
|
|
Get first job id from DONE status.
Definition at line 469 of file job_status.cpp. References CNetScheduleAPI::eDone, and GetFirst(). |
|
||||||||||||
|
Get next job in the specified status, or first if job_id is 0.
Definition at line 486 of file job_status.cpp. References bm::bvector< Alloc, MS >::get_next(), m_Lock, and m_StatusStor. Referenced by CQueue::CheckJobsExpiry(). |
|
||||||||||||
|
Get any pending job, but it should NOT be in the unwanted list Presumed, that unwanted jobs are speculatively assigned to other worker nodes or postponed.
Definition at line 395 of file job_status.cpp. References bm::bvector< Alloc, MS >::any(), bm::bvector< Alloc, MS >::enumerator, CNetScheduleAPI::ePending, bm::bvector< Alloc, MS >::first(), m_Lock, and m_StatusStor. Referenced by CQueue::FindPendingJob(). |
|
||||||||||||
|
Get pending job out of a certain candidate set Method cleans candidates if they are no longer available for scheduling (it means job was already dispatched).
Definition at line 337 of file job_status.cpp. References bm::bvector< Alloc, MS >::any(), bm::bvector< Alloc, MS >::enumerator, CNetScheduleAPI::ePending, bm::bvector< Alloc, MS >::first(), m_Lock, and m_StatusStor. |
|
|
Definition at line 64 of file job_status.cpp. References m_Lock, and x_GetStatusNoLock(). Referenced by CQueue::GetJobStatus(). |
|
|
Definition at line 580 of file job_status.cpp. References CNetScheduleAPI::eDone, CNetScheduleAPI::ePending, m_DoneCnt, m_StatusStor, bm::bvector< Alloc, MS >::opt_free_0, bm::bvector< Alloc, MS >::opt_free_01, and bm::bvector< Alloc, MS >::optimize(). Referenced by ChangeStatus(). |
|
|
Definition at line 179 of file job_status.hpp. References CNetScheduleAPI::eCanceled, and CNetScheduleAPI::eFailed. Referenced by ChangeStatus(), and CQueue::x_UpdateDB_GetJobNoLock(). |
|
||||||||||||||||||||
|
Check if job is in specified status.
Definition at line 520 of file job_status.cpp. References CNetScheduleAPI::eJobNotFound, and m_StatusStor. Referenced by ChangeStatus(). |
|
|
|
|
|
Optimize bitvectors memory.
Definition at line 195 of file job_status.cpp. References m_Lock, m_StatusStor, and bm::bvector< Alloc, MS >::opt_free_0. Referenced by CQueue::OptimizeMem(). |
|
|
Logical AND of candidates and pending jobs (candidate_set &= pending_set).
Definition at line 420 of file job_status.cpp. References CNetScheduleAPI::ePending, m_Lock, and m_StatusStor. Referenced by CQueue::GetAffinityList(), and CWorkerNodeAffinityGuard::GetJobWithAffinities(). |
|
|
Definition at line 557 of file job_status.cpp. References bm::bvector< Alloc, MS >::enumerator, CNetScheduleAPI::ePending, bm::bvector< Alloc, MS >::first(), m_Lock, m_StatusStor, and CNetScheduleAPI::StatusToString(). Referenced by CQueue::PrintJobStatusMatrix(). |
|
||||||||||||||||
|
Definition at line 506 of file job_status.cpp. References NCBI_THROW, and CNetScheduleAPI::StatusToString(). Referenced by ChangeStatus(). |
|
||||||||||||||||
|
Set job status without any protection.
Definition at line 208 of file job_status.cpp. References CNetScheduleAPI::ePending, m_LastPending, m_StatusStor, and bm::bvector< Alloc, MS >::set(). Referenced by ChangeStatus(), and x_SetClearStatusNoLock(). |
|
||||||||||||
|
Definition at line 150 of file job_status.cpp. References ERR_POST, m_Lock, and m_StatusStor. Referenced by Erase(), CQueue::ForceReschedule(), CNetSchedule_JS_Guard::SetStatus(), CQueue::Submit(), and CNetSchedule_JS_Guard::~CNetSchedule_JS_Guard(). |
|
||||||||||||
|
Specified status is OR-ed with the target vector.
Definition at line 138 of file job_status.cpp. References _ASSERT, m_Lock, and m_StatusStor. Referenced by CQueue::JobsWithStatus(). |
|
||||||||||||
|
Definition at line 126 of file job_status.cpp. References _ASSERT, bm::bvector< Alloc, MS >::calc_stat(), m_Lock, and m_StatusStor. Referenced by CQueue::StatusStatistics(). |
|
||||||||||||||||||||||||
|
Group switch up to 'count' jobs, not including ones from 'unwanted_jobs', from old_status to new_status.
Definition at line 429 of file job_status.cpp. References bm::bvector< Alloc, MS >::enumerator, bm::bvector< Alloc, MS >::first(), m_Lock, m_StatusStor, and bm::bvector< Alloc, MS >::set(). Referenced by CQueue::ReadJobs(). |
|
|
Definition at line 72 of file job_status.cpp. References m_StatusStor. Referenced by ChangeStatus(), and GetStatus(). |
|
||||||||||||||||
|
Definition at line 496 of file job_status.cpp. References SetExactStatusNoLock(). Referenced by ChangeStatus(). |
|
|
Definition at line 225 of file job_status.hpp. |
|
|
Done jobs counter.
Definition at line 233 of file job_status.hpp. Referenced by IncDoneJobs(). |
|
|
Last pending id.
Definition at line 231 of file job_status.hpp. Referenced by SetExactStatusNoLock(). |
|
|
|
|
Definition at line 228 of file job_status.hpp. |
1.4.6
Modified on Mon Dec 07 16:23:21 2009 by modify_doxy.py rev. 173732