61 size_t max_records)
const
82 return scope_it->second;
96 if (job_id == 0 || scope.empty() || scope ==
kNoScopeOnly)
109 scope_jobs[job_id] =
true;
112 scope_it->second[job_id] =
true;
118 unsigned int first_job_id,
121 if (first_job_id == 0 ||
count == 0 ||
134 scope_it->second.
set_range(first_job_id, first_job_id +
count - 1);
148 if (k->second[job_id]) {
149 k->second[job_id] =
false;
164 while (!scope_names.empty()) {
165 batch.push_back(scope_names.front());
166 scope_names.pop_front();
168 if (batch.size() >= batch_size) {
186 deque<string>::const_iterator k = batch.begin();
190 for ( ; k != batch.end(); ++k ) {
210 "OK: NUMBER OF JOBS: " +
211 to_string(jobs.
count()) +
"\n";
218 for ( ; en.
valid(); ++en) {
219 unsigned int job_id = *en;
226 buffer +=
"OK: JOBS: NONE\n";
248 result.push_back(k->first);
262 if (k->second[job_id])
271 unsigned int del_count = 0;
273 deque<string> to_be_deleted;
277 if (!it->second.any()) {
278 to_be_deleted.push_back(it->first);
280 if (del_count >= max_to_del)
285 for (deque<string>::const_iterator k = to_be_deleted.begin();
286 k != to_be_deleted.end(); ++k)
288 return to_be_deleted.size();
294 unsigned int count = 0;
299 if (!it->second.any())
unsigned int CheckRemoveCandidates(void)
TNSBitVector GetAllJobsInScopes(void) const
deque< string > GetScopeNames(void) const
void AddJobs(const string &scope, unsigned int first_job_id, unsigned int count)
string x_PrintOne(const string &scope_name, const TNSBitVector &jobs, const CQueue *queue, bool verbose) const
string Print(const CQueue *queue, size_t batch_size, bool verbose) const
bool CanAccept(const string &scope, size_t max_records) const
TNSBitVector GetJobs(const string &scope) const
string x_PrintSelected(const deque< string > &batch, const CQueue *queue, bool verbose) const
unsigned int CollectGarbage(unsigned int max_to_del)
TNSBitVector m_AllScopedJobs
string GetJobScope(unsigned int job_id) const
void RemoveJob(unsigned int job_id)
TScopeToJobsMap m_ScopeToJobs
void AddJob(const string &scope, unsigned int job_id)
string MakeJobKey(unsigned int job_id) const
TJobStatus GetJobStatus(unsigned job_id) const
Constant iterator designed to enumerate "ON" bits.
bool valid() const noexcept
Checks if iterator is still valid.
Bitvector Bit-vector container with runtime compression of bits.
bool any() const noexcept
Returns true if any bits in this bitset are set, and otherwise returns false.
enumerator first() const
Returns enumerator pointing on the first non-zero bit.
bvector< Alloc > & set_range(size_type left, size_type right, bool value=true)
Sets all bits in the specified closed interval [left,right] Interval must be inside the bvector's siz...
void clear(const size_type *ids, size_type ids_size, bm::sort_order so=bm::BM_UNKNOWN)
clear list of bits in this bitset
size_type count() const noexcept
population count (count of ON bits)
container_type::const_iterator const_iterator
container_type::iterator iterator
const_iterator begin() const
const_iterator end() const
const_iterator find(const key_type &key) const
EJobStatus
Job status codes.
static string StatusToString(EJobStatus status)
Printable status type.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string PrintableString(const CTempString str, TPrintableMode mode=fNewLine_Quote|fNonAscii_Passthru)
Get a printable version of the specified string.
const string kNoScopeOnly
const TNSBitVector kEmptyBitVector