73 m_QueueName(queue_name),
100 m_Log(server->IsLog()),
101 m_LogBatchEachJob(server->IsLogBatchEachJob()),
102 m_RefuseSubmits(
false),
105 m_StatisticsCountersLastPrintedTimestamp(0.0),
106 m_NotificationsList(qdb, server->GetNodeID(), queue_name),
115 m_PauseStatus(eNoPause),
116 m_ClientRegistryTimeoutWorkerNode(
127 m_ShouldPerfLogTransitions(
false)
168 unsigned int interval_sec =
precision.Sec();
169 if (interval_sec < 1)
240 for (
unsigned n = 0;
n < nParams; ++
n) {
241 parameters.push_back(
249 unsigned int & max_input_size,
250 unsigned int & max_output_size,
270 linked_sections[k->first] = values;
278 bool reader_affinity,
280 bool exclusive_new_affinity,
282 bool affinity_may_change,
283 bool group_may_change)
286 if (!reader_affinity &&
288 !exclusive_new_affinity &&
295 vector<CNetScheduleAPI::EJobStatus> from_state;
298 string scope =
client.GetScope();
322 pending_running_jobs -= all_jobs_in_scopes;
323 other_jobs -= all_jobs_in_scopes;
324 reading_jobs -= all_jobs_in_scopes;
329 pending_running_jobs &= scope_jobs;
330 other_jobs &= scope_jobs;
331 reading_jobs &= scope_jobs;
334 if (group_ids.
any()) {
337 if (!group_may_change)
341 other_jobs |= reading_jobs;
344 other_jobs |= reading_jobs;
346 TNSBitVector candidates = pending_running_jobs | other_jobs;
348 if (!candidates.
any())
355 return !candidates.
any();
366 no_aff_jobs = candidates - all_aff_jobs;
367 if (exclusive_new_affinity && no_aff_jobs.
any())
370 if (exclusive_new_affinity)
371 suitable_affinities = all_aff - all_pref_affs;
375 suitable_affinities |= aff_ids;
379 suitable_affinities);
380 if (affinity_may_change)
381 candidates = pending_running_jobs |
382 (other_jobs & suitable_aff_jobs);
384 candidates &= suitable_aff_jobs;
385 return !candidates.
any();
401 const string & aff_token,
402 const string & group,
412 unsigned int aff_id = 0;
413 unsigned int group_id = 0;
422 event.SetNodeAddr(
client.GetAddress());
425 event.SetTimestamp(op_begin_time);
426 event.SetClientNode(
client.GetNode());
427 event.SetClientSession(
client.GetSession());
441 string scope =
client.GetScope();
445 if (!scope.empty()) {
451 "No available slots in the queue scope registry");
453 if (!group.empty()) {
459 "No available slots in the queue group registry");
461 if (!aff_token.empty()) {
467 "No available slots in the queue affinity registry");
471 if (!group.empty()) {
475 if (!aff_token.empty()) {
521 vector< pair<CJob, string> > & batch,
522 const string & group,
526 unsigned int batch_size = batch.size();
532 unsigned int job_id_cnt = job_id;
533 unsigned int group_id = 0;
534 vector<string> aff_tokens;
535 string scope =
client.GetScope();
538 for (
size_t k = 0; k < batch_size; ++k) {
539 const string & aff_token = batch[k].second;
540 if (!aff_token.empty())
541 aff_tokens.push_back(aff_token);
547 if (!scope.empty()) {
553 "No available slots in the queue scope registry");
555 if (!group.empty()) {
561 "No available slots in the queue group registry");
563 if (!aff_tokens.empty()) {
569 "No available slots in the queue affinity registry");
573 for (
size_t k = 0; k < batch_size; ++k) {
575 CJob & job = batch[k].first;
576 const string & aff_token = batch[k].second;
579 job.
SetId(job_id_cnt);
584 event.SetNodeAddr(
client.GetAddress());
587 event.SetTimestamp(curr_time);
588 event.SetClientNode(
client.GetNode());
589 event.SetClientSession(
client.GetSession());
591 if (!aff_token.empty()) {
593 ResolveAffinityToken(aff_token,
615 jobs.
set_range(job_id, job_id + batch_size - 1);
619 batch_size != aff_tokens.
size(),
628 for (
size_t k = 0; k < batch_size; ++k) {
630 batch[k].
first.GetId(), curr_time,
631 batch[k].first.GetAffinityId(), group_id,
632 batch[k].first.GetExpirationTime(
m_Timeout,
642 for (
size_t k = 0; k < batch_size; ++k)
653 const string & job_key,
655 const string & auth_token,
664 "Output is too long");
720 unsigned int timeout,
722 const list<string> * aff_list,
725 bool exclusive_new_affinity,
726 bool prioritized_aff,
728 const list<string> * group_list,
731 string & added_pref_aff)
743 vector<unsigned int> aff_ids;
746 bool has_groups =
false;
750 if (wnode_affinity) {
763 if (group_list !=
NULL) {
765 has_groups = !group_list->empty();
767 if (aff_list !=
NULL)
783 aff_ids_vector, aff_ids,
786 exclusive_new_affinity,
788 group_ids_vector, has_groups,
791 bool outdated_job =
false;
793 if (job_pick.
job_id == 0) {
794 if (exclusive_new_affinity)
799 if (job_pick.
job_id == 0) {
800 if (timeout != 0 && port > 0)
805 wnode_affinity, any_affinity,
806 exclusive_new_affinity,
807 new_format, group_ids_vector);
817 if (exclusive_new_affinity) {
825 if (outdated_pick.
job_id != 0) {
826 job_pick = outdated_pick;
836 outdated_job ==
false) {
847 UpdatePreferredAffinities(
850 added_pref_aff = aff_token;
853 if (outdated_job && job_pick.
aff_id != 0) {
860 UpdatePreferredAffinities(
863 added_pref_aff = aff_token;
917 "which does not wait anything (node: "
918 <<
client.GetNode() <<
" session: "
919 <<
client.GetSession() <<
")");
935 "which does not wait anything (node: "
936 <<
client.GetNode() <<
" session: "
937 <<
client.GetSession() <<
")");
943 const list<string> & aff_to_add,
944 const list<string> & aff_to_del,
949 if (cmd_group ==
eGet)
956 unsigned int client_id =
client.GetID();
962 bool any_to_add =
false;
963 bool any_to_del =
false;
966 for (list<string>::const_iterator k(aff_to_del.begin());
967 k != aff_to_del.end(); ++k) {
973 <<
"' deletes unknown affinity '"
974 << *k <<
"'. Ignored.");
975 msgs.push_back(
"eAffinityNotFound:"
976 "unknown affinity to delete: " + *k);
980 if (!current_affinities.
get_bit(aff_id)) {
984 <<
"' deletes affinity '" << *k
985 <<
"' which is not in the list of the "
986 "preferred client affinities. Ignored.");
987 msgs.push_back(
"eAffinityNotPreferred:not registered affinity "
1006 if (current_affinities.
count() + aff_to_add.size()
1007 - aff_id_to_del.
count() >
1010 "The client '" +
client.GetNode() +
1011 "' exceeds the limit (" +
1013 ") of the preferred affinities. Changed request ignored.");
1017 vector<string> already_added_affinities;
1023 for (list<string>::const_iterator k(aff_to_add.begin());
1024 k != aff_to_add.end(); ++k ) {
1025 unsigned int aff_id =
1030 if (current_affinities.
get_bit(aff_id)) {
1031 already_added_affinities.push_back(*k);
1035 aff_id_to_add.
set_bit(aff_id);
1041 for (vector<string>::const_iterator j(already_added_affinities.begin());
1042 j != already_added_affinities.end(); ++j) {
1045 <<
"' adds affinity '" << *j
1046 <<
"' which is already in the list of the "
1047 "preferred client affinities. Ignored.");
1048 msgs.push_back(
"eAffinityAlreadyPreferred:already registered "
1049 "affinity to add: " + *j);
1052 if (any_to_add || any_to_del)
1060 <<
"' has been garbage collected and tries to "
1061 "update its preferred affinities.");
1062 msgs.push_back(
"eClientGarbageCollected:the client had been "
1063 "garbage collected");
1070 const list<string> & aff,
1073 if (cmd_group ==
eGet)
1083 "The client '" +
client.GetNode() +
1084 "' exceeds the limit (" +
1086 ") of the preferred affinities. Set request ignored.");
1089 unsigned int client_id =
client.GetID();
1101 for (list<string>::const_iterator k(aff.begin());
1102 k != aff.end(); ++k ) {
1103 unsigned int aff_id =
1108 if (current_affinities.
get_bit(aff_id))
1109 already_added_aff_id.
set_bit(aff_id);
1111 aff_id_to_set.
set_bit(aff_id);
1120 const string &
data,
int data_version)
1146 time_start = job_iter->second.GetLastEvent()->GetTimestamp();
1147 run_timeout = job_iter->second.GetRunTimeout();
1149 run_timeout = queue_run_timeout;
1151 if (time_start + run_timeout > curr + tm) {
1152 job = job_iter->second;
1157 job_iter->second.SetRunTimeout(curr + tm - time_start);
1158 job_iter->second.SetLastTouch(curr);
1164 exp_time = time_start + run_timeout;
1168 job = job_iter->second;
1193 time_start = job_iter->second.GetLastEvent()->GetTimestamp();
1194 read_timeout = job_iter->second.GetReadTimeout();
1196 read_timeout = queue_read_timeout;
1198 if (time_start + read_timeout > curr + tm) {
1199 job = job_iter->second;
1205 job_iter->second.SetReadTimeout(curr + tm - time_start);
1206 job_iter->second.SetLastTouch(curr);
1212 exp_time = time_start + read_timeout;
1216 job = job_iter->second;
1225 string & client_sid,
1226 string & client_phid,
1227 string & progress_msg,
1241 client_ip = job_iter->second.GetClientIP();
1242 client_sid = job_iter->second.GetClientSID();
1243 client_phid = job_iter->second.GetNCBIPHID();
1244 progress_msg = job_iter->second.GetProgressMsg();
1268 job_iter->second.SetLastTouch(curr);
1276 job = job_iter->second;
1283 unsigned int address,
1284 unsigned short port,
1287 bool need_progress_msg,
1288 size_t * last_event_index)
1299 *last_event_index = job_iter->second.GetLastEventIndex();
1300 status = job_iter->second.GetStatus();
1302 unsigned int old_listener_addr = job_iter->second.GetListenerNotifAddr();
1303 unsigned short old_listener_port = job_iter->second.GetListenerNotifPort();
1305 if (job_iter->second.GetNeedStolenNotif() &&
1306 old_listener_addr != 0 && old_listener_port != 0) {
1307 if (old_listener_addr != address || old_listener_port != port) {
1315 if (address == 0 || port == 0 || timeout ==
kTimeZero) {
1318 job_iter->second.SetListenerNotifAddr(0);
1319 job_iter->second.SetListenerNotifPort(0);
1320 job_iter->second.SetListenerNotifAbsTime(
kTimeZero);
1322 job_iter->second.SetListenerNotifAddr(address);
1323 job_iter->second.SetListenerNotifPort(port);
1324 job_iter->second.SetListenerNotifAbsTime(curr + timeout);
1327 job_iter->second.SetNeedLsnrProgressMsgNotif(need_progress_msg);
1328 job_iter->second.SetNeedStolenNotif(need_stolen);
1329 job_iter->second.SetLastTouch(curr);
1331 job = job_iter->second;
1347 job_iter->second.SetProgressMsg(
msg);
1348 job_iter->second.SetLastTouch(curr);
1357 job = job_iter->second;
1363 unsigned int job_id,
1364 const string & job_key,
1366 const string & auth_token,
1381 if (!auth_token.empty()) {
1384 job_iter->second.CompareAuthToken(auth_token);
1387 "Invalid authorization token format");
1390 "Authorization token does not match");
1395 "passport matched.");
1396 warning =
"eJobPassportOnlyMatch:Only job passport matched. "
1397 "Command is ignored.";
1398 job = job_iter->second;
1404 unsigned int run_count = job_iter->second.
GetRunCount();
1405 CJobEvent *
event = job_iter->second.GetLastEvent();
1408 ERR_POST(
"No JobEvent for running job");
1410 event = &job_iter->second.AppendEvent();
1411 event->SetNodeAddr(
client.GetAddress());
1424 event->SetTimestamp(current_time);
1425 event->SetClientNode(
client.GetNode());
1426 event->SetClientSession(
client.GetSession());
1429 job_iter->second.SetRunCount(run_count - 1);
1432 job_iter->second.SetLastTouch(current_time);
1465 job = job_iter->second;
1471 unsigned int job_id,
1472 const string & job_key,
1473 const string & auth_token,
1474 const string & aff_token,
1475 const string & group,
1476 bool & auth_token_ok,
1482 unsigned int affinity_id = 0;
1483 unsigned int group_id = 0;
1484 unsigned int job_affinity_id;
1485 unsigned int job_group_id;
1491 if (!aff_token.empty() || !group.empty()) {
1492 if (!aff_token.empty())
1504 job_iter->second.CompareAuthToken(auth_token);
1508 "Invalid authorization token format");
1511 auth_token_ok =
false;
1512 job = job_iter->second;
1517 auth_token_ok =
true;
1522 job_group_id = job_iter->second.GetGroupId();
1525 job_iter->second.SetAffinityId(affinity_id);
1526 job_iter->second.SetGroupId(group_id);
1528 unsigned int run_count = job_iter->second.GetRunCount();
1529 CJobEvent *
event = job_iter->second.GetLastEvent();
1532 ERR_POST(
"No JobEvent for running job");
1534 event = &job_iter->second.AppendEvent();
1535 event->SetNodeAddr(
client.GetAddress());
1538 event->SetTimestamp(current_time);
1539 event->SetClientNode(
client.GetNode());
1540 event->SetClientSession(
client.GetSession());
1543 job_iter->second.SetRunCount(run_count - 1);
1546 job_iter->second.SetLastTouch(current_time);
1550 if (job_affinity_id != affinity_id) {
1551 if (job_affinity_id != 0)
1553 if (affinity_id != 0)
1556 if (job_group_id != group_id) {
1557 if (job_group_id != 0)
1562 if (job_affinity_id != affinity_id || job_group_id != group_id)
1585 job = job_iter->second;
1591 unsigned int job_id,
1592 const string & job_key,
1609 "Error fetching job");
1611 CJobEvent *
event = job_iter->second.GetLastEvent();
1613 ERR_POST(
"Inconsistency: a job has no events");
1615 event = &job_iter->second.AppendEvent();
1616 event->SetNodeAddr(
client.GetAddress());
1619 event->SetTimestamp(current_time);
1620 event->SetClientNode(
client.GetNode());
1621 event->SetClientSession(
client.GetSession());
1624 job_iter->second.SetLastTouch(current_time);
1640 job_iter->second.GetAffinityId(),
1645 job = job_iter->second;
1666 job_iter->second.SetLastTouch(curr);
1673 job = job_iter->second;
1679 unsigned int job_id,
1680 const string & job_key,
1682 bool is_ns_rollback)
1707 CJobEvent *
event = &job_iter->second.AppendEvent();
1715 event->SetTimestamp(current_time);
1716 event->SetClientNode(
client.GetNode());
1717 event->SetClientSession(
client.GetSession());
1720 job_iter->second.SetLastTouch(current_time);
1723 if (is_ns_rollback) {
1756 job = job_iter->second;
1764 vector<CNetScheduleAPI::EJobStatus> statuses;
1791 string scope =
client.GetScope();
1801 unsigned int count = 0;
1802 for (; en.
valid(); ++en) {
1803 unsigned int job_id = *en;
1809 " while cancelling jobs");
1813 CJobEvent *
event = &job_iter->second.AppendEvent();
1818 event->SetTimestamp(current_time);
1819 event->SetClientNode(
client.GetNode());
1820 event->SetClientSession(
client.GetSession());
1823 job_iter->second.SetLastTouch(current_time);
1857 .
Print(
"job_phid", job_iter->second.GetNCBIPHID());
1880 const string & group,
1881 const string & aff_token,
1882 const vector<TJobStatus> & job_statuses,
1884 vector<string> & warnings)
1886 if (group.empty() && aff_token.empty() && job_statuses.empty()) {
1893 vector<TJobStatus> statuses;
1895 if (job_statuses.empty()) {
1909 statuses = job_statuses;
1915 if (!group.empty()) {
1919 jobs_to_cancel.
clear();
1920 warnings.push_back(
"eGroupNotFound:job group " + group +
1924 "' is not found. No jobs are canceled.");
1928 if (!aff_token.empty()) {
1931 jobs_to_cancel.
clear();
1932 warnings.push_back(
"eAffinityNotFound:affinity " + aff_token +
1936 "' is not found. No jobs are canceled.");
1985 unsigned int start_index =
m_LastId;
2013 unsigned int timeout,
2014 const list<string> * aff_list,
2015 bool reader_affinity,
2017 bool exclusive_new_affinity,
2018 bool prioritized_aff,
2019 const list<string> * group_list,
2020 bool affinity_may_change,
2021 bool group_may_change,
2023 bool * no_more_jobs,
2025 string & added_pref_aff)
2030 bool has_groups =
false;
2032 vector<unsigned int> aff_ids;
2037 *no_more_jobs =
false;
2041 if (reader_affinity) {
2054 if (group_list !=
NULL) {
2056 has_groups = !group_list->empty();
2058 if (aff_list !=
NULL)
2074 aff_ids_vector, aff_ids,
2077 exclusive_new_affinity,
2079 group_ids_vector, has_groups,
2083 bool outdated_job =
false;
2086 if (job_pick.
job_id == 0) {
2087 if (exclusive_new_affinity)
2091 if (job_pick.
job_id == 0) {
2093 reader_affinity, any_affinity,
2094 exclusive_new_affinity,
2096 affinity_may_change,
2098 if (timeout != 0 && port > 0)
2101 reader_affinity, any_affinity,
2102 exclusive_new_affinity,
2106 outdated_job =
true;
2116 if (exclusive_new_affinity) {
2124 if (outdated_pick.
job_id != 0) {
2125 job_pick = outdated_pick;
2126 outdated_job =
true;
2135 outdated_job ==
false) {
2147 added_pref_aff = aff_token;
2151 if (outdated_job && job_pick.
aff_id != 0) {
2158 UpdatePreferredAffinities(
2161 added_pref_aff = aff_token;
2202 unsigned int job_id,
2203 const string & job_key,
2205 const string & auth_token)
2209 job, auth_token,
"",
2218 unsigned int job_id,
2219 const string & job_key,
2221 const string & auth_token,
2222 const string & err_msg,
2227 job, auth_token, err_msg,
2236 unsigned int job_id,
2237 const string & job_key,
2239 const string & auth_token,
2240 bool is_ns_rollback,
2246 job, auth_token,
"",
2250 if (is_ns_rollback || blacklist ==
false)
2259 unsigned int job_id,
2260 const string & job_key,
2291 "Error fetching job");
2293 const vector<CJobEvent>& job_events = job_iter->second.GetEvents();
2294 if (job_events.empty())
2296 "Inconsistency: a job has no events");
2298 state_before_read = job_iter->second.GetStatusBeforeReading();
2300 CJobEvent *
event = &job_iter->second.AppendEvent();
2302 event->SetStatus(state_before_read);
2304 event->SetTimestamp(current_time);
2305 event->SetClientNode(
client.GetNode());
2306 event->SetClientSession(
client.GetSession());
2308 job_iter->second.SetStatus(state_before_read);
2309 job_iter->second.SetLastTouch(current_time);
2336 job = job_iter->second;
2342 unsigned int job_id,
2343 const string & job_key,
2345 const string & auth_token,
2346 const string & err_msg,
2348 bool is_ns_rollback,
2367 if (is_ns_rollback ==
false) {
2369 job_iter->second.CompareAuthToken(auth_token);
2372 "Invalid authorization token format");
2375 "Authorization token does not match");
2381 "Internal inconsistency detected. The job state in memory is " +
2383 " while in database it is " +
2387 target_status = job_iter->second.GetStatusBeforeReading();
2391 CJobEvent &
event = job_iter->second.AppendEvent();
2393 event.SetNodeAddr(
client.GetAddress());
2394 event.SetClientNode(
client.GetNode());
2395 event.SetClientSession(
client.GetSession());
2396 event.SetErrorMsg(err_msg);
2398 if (is_ns_rollback) {
2400 job_iter->second.SetReadCount(job_iter->second.GetReadCount() - 1);
2402 switch (target_status) {
2407 job_iter->second.SetReadCount(job_iter->second.GetReadCount() - 1);
2431 event.SetStatus(target_status);
2432 job_iter->second.SetStatus(target_status);
2433 job_iter->second.SetLastTouch(current_time);
2465 job = job_iter->second;
2491 size_t job_count = job_ids.
count();
2512 const vector<unsigned int> & aff_ids,
2513 bool use_pref_affinity,
2515 bool exclusive_new_affinity,
2516 bool prioritized_aff,
2521 string scope =
client.GetScope();
2522 string virtual_scope =
client.GetVirtualScope();
2524 if (!virtual_scope.empty()) {
2527 aff_ids, use_pref_affinity,
2529 exclusive_new_affinity,
2531 group_ids, has_groups,
2532 cmd_group, virtual_scope);
2533 if (job_pick.
job_id != 0)
2540 any_affinity, exclusive_new_affinity,
2541 prioritized_aff, group_ids, has_groups,
2549 const vector<unsigned int> & aff_ids,
2550 bool use_pref_affinity,
2552 bool exclusive_new_affinity,
2553 bool prioritized_aff,
2557 const string & scope)
2559 bool explicit_aff = !aff_ids.empty();
2560 bool effective_use_pref_affinity = use_pref_affinity;
2572 if (use_pref_affinity)
2573 effective_use_pref_affinity = use_pref_affinity && pref_aff.
any();
2575 if (explicit_aff || effective_use_pref_affinity || exclusive_new_affinity) {
2579 if (cmd_group ==
eGet)
2600 if (cmd_group ==
eRead)
2603 if (prioritized_aff) {
2606 for (vector<unsigned int>::const_iterator k = aff_ids.begin();
2607 k != aff_ids.end(); ++k) {
2609 GetJobsWithAffinity(*k);
2611 if (candidates.
any()) {
2614 for (; en.
valid(); ++en) {
2617 job_id, running_jobs_per_client)) {
2624 if (vacant_jobs.
any()) {
2627 for (; en.
valid(); ++en) {
2630 job_id, running_jobs_per_client)) {
2642 if (exclusive_new_affinity)
2647 for (; en.
valid(); ++en) {
2648 unsigned int job_id = *en;
2651 if (aff_id != 0 && explicit_aff) {
2652 if (explicit_affs.
get_bit(aff_id)) {
2654 job_id, running_jobs_per_client)) {
2660 if (aff_id != 0 && effective_use_pref_affinity) {
2661 if (pref_aff.
get_bit(aff_id)) {
2662 if (explicit_aff ==
false) {
2664 job_id, running_jobs_per_client)) {
2669 pref_aff_candidate_jobs.
set_bit(job_id);
2674 if (exclusive_new_affinity) {
2675 if (aff_id == 0 || all_pref_aff.
get_bit(aff_id) ==
false) {
2676 if (explicit_aff ==
false &&
2677 effective_use_pref_affinity ==
false) {
2679 job_id, running_jobs_per_client)) {
2684 exclusive_aff_candidate_jobs.
set_bit(job_id);
2690 for (; en1.
valid(); ++en1) {
2697 for (; en2.
valid(); ++en2) {
2711 use_pref_affinity && !effective_use_pref_affinity &&
2712 !exclusive_new_affinity &&
2713 cmd_group ==
eGet)) {
2717 bool no_scope_only = scope.
empty() ||
2719 unsigned int job_id = 0;
2729 if (cmd_group ==
eGet) {
2738 if (no_scope_only) {
2742 for (; en.
valid(); ++en) {
2743 unsigned int candidate_job_id = *en;
2744 if (jobs_in_scope.
get_bit(candidate_job_id))
2746 if (!group_jobs.
get_bit(candidate_job_id))
2749 running_jobs_per_client)) {
2750 job_id = candidate_job_id;
2755 for (; en.
valid(); ++en) {
2756 unsigned int candidate_job_id = *en;
2757 if (jobs_in_scope.
get_bit(candidate_job_id))
2760 running_jobs_per_client)) {
2761 job_id = candidate_job_id;
2768 for (; en.
valid(); ++en) {
2769 unsigned int candidate_job_id = *en;
2770 if (jobs_in_scope.
get_bit(candidate_job_id))
2772 if (!restricted_jobs.
get_bit(candidate_job_id))
2775 running_jobs_per_client)) {
2776 job_id = candidate_job_id;
2782 if (no_scope_only) {
2811 restricted_jobs,
true);
2828 for (; en.
valid(); ++en) {
2831 string client_ip = job_iter->second.GetClientIP();
2832 auto iter = ret.
find(client_ip);
2833 if (iter == ret.
end()) {
2846 unsigned int job_id,
2849 if (jobs_per_client_ip.
empty())
2856 string client_ip = job_iter->second.GetClientIP();
2857 auto iter = jobs_per_client_ip.
find(client_ip);
2858 if (iter == jobs_per_client_ip.
end())
2866 unsigned int picked_earlier,
2872 string scope =
client.GetScope();
2873 string virtual_scope =
client.GetVirtualScope();
2875 if (!virtual_scope.empty()) {
2880 if (job_pick.
job_id != 0)
2893 unsigned int picked_earlier,
2895 const string & scope)
2901 if (picked_earlier != 0)
2902 outdated_pending.
set_bit(picked_earlier,
false);
2911 if (group_ids.
any())
2914 if (!outdated_pending.
any())
2928 unsigned int picked_earlier,
2934 string scope =
client.GetScope();
2935 string virtual_scope =
client.GetVirtualScope();
2937 if (!virtual_scope.empty()) {
2943 if (job_pick.
job_id != 0)
2956 unsigned int picked_earlier,
2958 const string & scope)
2964 if (picked_earlier != 0)
2965 outdated_read_jobs.
set_bit(picked_earlier,
false);
2968 outdated_read_jobs);
2975 if (group_ids.
any())
2978 if (!outdated_read_jobs.
any())
2981 unsigned int job_id = *outdated_read_jobs.
first();
2983 return x_SJobPick(job_id, aff_id != 0, aff_id);
2988 unsigned int job_id,
2989 const string & job_key,
2991 const string & auth_token,
2992 const string & err_msg,
2998 unsigned failed_retries;
2999 unsigned max_output_size;
3006 if (
output.size() > max_output_size) {
3008 "Output is too long");
3012 bool rescheduled =
false;
3033 "Error fetching job");
3035 if (!auth_token.empty()) {
3038 job_iter->second.CompareAuthToken(auth_token);
3041 "Invalid authorization token format");
3044 "Authorization token does not match");
3049 "passport matched.");
3050 warning =
"eJobPassportOnlyMatch:Only job passport "
3051 "matched. Command is ignored.";
3052 job = job_iter->second;
3058 CJobEvent *
event = job_iter->second.GetLastEvent();
3060 ERR_POST(
"No JobEvent for running job");
3062 event = &job_iter->second.AppendEvent();
3068 event->SetTimestamp(curr);
3069 event->SetErrorMsg(err_msg);
3070 event->SetRetCode(ret_code);
3071 event->SetNodeAddr(
client.GetAddress());
3072 event->SetClientNode(
client.GetNode());
3073 event->SetClientSession(
client.GetSession());
3078 rescheduled =
false;
3081 "unconditionally, no_retries = 1");
3083 unsigned run_count = job_iter->second.GetRunCount();
3084 if (run_count <= failed_retries) {
3095 rescheduled =
false;
3098 "max number of retries ("
3099 << failed_retries <<
")");
3103 job_iter->second.SetOutput(
output);
3104 job_iter->second.SetLastTouch(curr);
3146 job = job_iter->second;
3158 bool & client_was_found,
3159 string & old_session,
3160 bool & had_wn_pref_affs,
3161 bool & had_reader_pref_affs)
3172 client_was_found, old_session,
3173 had_wn_pref_affs, had_reader_pref_affs);
3177 if (running_jobs.
any())
3179 if (reading_jobs.
any())
3195 if (outdated_jobs.
any())
3209 if (outdated_jobs.
any())
3219 static size_t skip_limit = 0;
3220 static size_t skip_count;
3229 if (skip_count < skip_limit)
3272 string scope =
client.GetScope();
3277 else if (!scope.empty())
3290 string scope =
client.GetScope();
3295 else if (!scope.empty())
3325 for ( ;en.
valid(); ++en) {
3327 *en, curr, logging);
3334 unsigned int job_id,
3364 CJobEvent *
event = job_iter->second.GetLastEvent();
3365 time_start =
event->GetTimestamp();
3366 run_timeout = job_iter->second.GetRunTimeout();
3368 run_timeout = queue_run_timeout;
3375 read_timeout = job_iter->second.GetReadTimeout();
3377 read_timeout = queue_read_timeout;
3386 exp_time = time_start + run_timeout;
3388 exp_time = time_start + read_timeout;
3390 if (curr_time < exp_time) {
3407 new_status = job_iter->second.GetStatusBeforeReading();
3412 job_iter->second.SetStatus(new_status);
3413 job_iter->second.SetLastTouch(curr_time);
3415 event = &job_iter->second.AppendEvent();
3416 event->SetStatus(new_status);
3417 event->SetEvent(event_type);
3418 event->SetTimestamp(curr_time);
3486 purpose =
"execution";
3488 purpose =
"reading";
3491 .
Print(
"msg",
"Timeout expired, rescheduled for " + purpose)
3492 .
Print(
"msg_code",
"410")
3496 .
Print(
"run_counter", job_iter->second.GetRunCount())
3497 .
Print(
"read_counter", job_iter->second.GetReadCount())
3500 .
Print(
"run_timeout", run_timeout)
3501 .
Print(
"read_timeout", read_timeout);
3513 unsigned int last_job,
3518 unsigned int job_id;
3532 if (last_job != 0 && job_id >= last_job)
3562 if (
result.deleted > 0) {
3566 for (; en.
valid(); ++en) {
3567 unsigned int id = *en;
3625 unsigned int add_job_id,
3650 unsigned int del_rec = 0;
3654 while (en.
valid() && del_rec < max_deleted) {
3661 unsigned int job_id = *en;
3664 if (del_count > 0) {
3683 for (; en.
valid(); ++en) {
3717 unsigned int del_limit = aff_reg_settings.
high_removal;
3723 unsigned int candidates_size =
3726 if (candidates_size <
3753 unsigned int del_limit = group_reg_settings.
high_removal;
3754 if (group_dict_size <
3759 unsigned int candidates_size =
3762 if (candidates_size <
3811 unsigned int job_id,
3825 string scope =
client.GetScope();
3833 }
else if (!scope.empty()) {
3842 job_dump.reserve(2048);
3848 job_dump = job_iter->second.Print(dump_fields,
3852 job_dump.append(
"OK:GC erase time: ")
3855 if (dump_fields &
eScope)
3856 job_dump.append(
"OK:scope: '")
3868 const string & group,
3869 const string & aff_token,
3870 const vector<TJobStatus> & job_statuses,
3871 unsigned int start_after_job_id,
3880 vector<TJobStatus> statuses;
3883 if (job_statuses.empty()) {
3897 statuses = job_statuses;
3902 string scope =
client.GetScope();
3907 if (!group.empty()) {
3911 jobs_to_dump.
clear();
3914 "' is not found. No jobs to dump.");
3918 if (!aff_token.empty()) {
3921 jobs_to_dump.
clear();
3924 "' is not found. No jobs to dump.");
3932 }
else if (!scope.empty()) {
3939 dump_fields, order_first);
3944 unsigned int start_after_job_id,
3949 if (!jobs_to_dump.
any())
3953 size_t skipped_jobs = 0;
3955 while (en.
valid() && *en <= start_after_job_id) {
3960 if (
count > 0 && !order_first) {
3961 size_t total_jobs = jobs_to_dump.
count();
3962 size_t jobs_left = total_jobs - skipped_jobs;
3963 while (jobs_left >
count) {
3972 buffer_size =
count;
3975 result.reserve(2048*buffer_size);
3978 vector<CJob>
buffer(buffer_size);
3979 size_t read_jobs = 0;
3980 size_t printed_count = 0;
3982 for ( ; en.
valid(); ) {
3986 for ( ; en.
valid() && read_jobs < buffer_size; ++en ) {
3989 buffer[read_jobs] = job_iter->second;
3994 if (printed_count >=
count)
4002 one_job.reserve(2048);
4003 for (
size_t index = 0; index < read_jobs; ++index) {
4010 unsigned int job_id =
buffer[index].GetId();
4017 one_job.append(
"OK:GC erase time: ")
4021 if (dump_fields &
eScope)
4022 one_job.append(
"OK:scope: '")
4031 if (printed_count >=
count)
4065 bool & client_was_found,
4066 bool & session_was_reset,
4067 string & old_session,
4068 bool & had_wn_pref_affs,
4069 bool & had_reader_pref_affs)
4082 client_was_found, session_was_reset,
4083 old_session, had_wn_pref_affs,
4084 had_reader_pref_affs);
4088 if (session_was_reset) {
4089 if (running_jobs.
any())
4091 if (reading_jobs.
any())
4121 unsigned int job_id,
4131 ERR_POST(
"Cannot fetch job to reset it due to " <<
4148 new_status = job_iter->second.GetStatusBeforeReading();
4153 job_iter->second.SetStatus(new_status);
4154 job_iter->second.SetLastTouch(current_time);
4156 CJobEvent *
event = &job_iter->second.AppendEvent();
4158 event->SetEvent(event_type);
4159 event->SetTimestamp(current_time);
4160 event->SetClientNode(
client.GetNode());
4161 event->SetClientSession(
client.GetSession());
4221 ERR_POST(
"Error resetting a running job when worker node is "
4237 ERR_POST(
"Error resetting a reading job when worker node is "
4253 ERR_POST(
"Error resetting a running job when worker node "
4269 ERR_POST(
"Error resetting a reading job when worker node "
4277 unsigned short port,
4278 unsigned int timeout,
4282 bool exclusive_new_affinity,
4289 exclusive_new_affinity, new_format,
4300 unsigned short port,
4301 unsigned int timeout,
4305 bool exclusive_new_affinity,
4310 reader_aff, any_aff,
4311 exclusive_new_affinity,
true,
4318 unsigned short port)
4349 ctx->SetRequestID();
4358 aff_count += affinities;
4361 extra.
Print(
"_type",
"statistics_thread")
4364 .
Print(
"affinities", affinities)
4389 vector<TJobStatus> statuses;
4416 .append(
"OK:garbage_jobs: ")
4419 .append(
"OK:affinity_registry_size: ")
4422 .append(
"OK:client_registry_size: ")
4430 const string & group_token,
4431 const string & aff_token,
4433 vector<string> & warnings)
const
4439 if (!group_token.empty()) {
4443 warnings.push_back(
"eGroupNotFound:job group " + group_token +
4447 if (!aff_token.empty()) {
4450 warnings.push_back(
"eAffinityNotFound:affinity " + aff_token +
4456 if (!warnings.empty())
4460 string scope =
client.GetScope();
4466 if (!group_token.empty())
4467 candidates &= group_jobs;
4468 if (!aff_token.empty())
4469 candidates &= aff_jobs;
4476 }
else if (!scope.empty()) {
4481 jobs[index] = candidates.
count();
4487 const string & group_token,
4488 const string & aff_token,
4489 vector<string> & warnings)
const
4499 if (warnings.empty()) {
4503 ": " + to_string(jobs_per_state[index]) +
"\n";
4504 total += jobs_per_state[index];
4506 result +=
"OK:Total: " + to_string(total) +
"\n";
4514 vector<CNetScheduleAPI::EJobStatus> statuses;
4526 bool need_notifications = (status ==
eNoPause &&
4530 if (need_notifications)
4538 unsigned short port,
4547 const string & auth_token,
4558 if (!auth_token.empty()) {
4561 job_iter->second.CompareAuthToken(auth_token);
4564 "Invalid authorization token format");
4567 "Authorization token does not match");
4572 "passport matched.");
4578 CJobEvent *
event = &job_iter->second.AppendEvent();
4581 event->SetTimestamp(curr);
4582 event->SetRetCode(ret_code);
4584 event->SetClientNode(
client.GetNode());
4585 event->SetClientSession(
client.GetSession());
4586 event->SetNodeAddr(
client.GetAddress());
4589 job_iter->second.SetOutput(
output);
4590 job_iter->second.SetLastTouch(curr);
4592 job = job_iter->second;
4600 unsigned int job_id,
4608 CJobEvent &
event = job_iter->second.AppendEvent();
4610 event.SetNodeAddr(
client.GetAddress());
4611 event.SetClientNode(
client.GetNode());
4612 event.SetClientSession(
client.GetSession());
4614 if (cmd_group ==
eGet) {
4622 job_iter->second.SetLastTouch(curr);
4623 if (cmd_group ==
eGet) {
4625 job_iter->second.SetRunTimeout(
kTimeZero);
4626 job_iter->second.SetRunCount(job_iter->second.GetRunCount() + 1);
4629 job_iter->second.SetReadTimeout(
kTimeZero);
4630 job_iter->second.SetReadCount(job_iter->second.GetReadCount() + 1);
4633 job = job_iter->second;
4641 vector<TJobStatus> statuses;
4660 if (!jobs_to_dump.
any())
4665 FILE * jobs_file =
NULL;
4674 jobs_file = fopen(jobs_file_name.c_str(),
"wb");
4675 if (jobs_file ==
NULL)
4676 throw runtime_error(
"Cannot open file " + jobs_file_name +
4680 setbuf(jobs_file,
NULL);
4684 header.
Write(jobs_file);
4687 for ( ; en.
valid(); ++en) {
4690 ERR_POST(
"Dump at SHUTDOWN: error fetching job " <<
4695 job_iter->second.Dump(jobs_file);
4697 }
catch (
const exception & ex) {
4698 if (jobs_file !=
NULL)
4701 throw runtime_error(
"Error dumping queue " +
m_QueueName +
4702 ": " +
string(ex.what()));
4716 if (access(jobs_file_name.c_str(), F_OK) != -1)
4717 remove(jobs_file_name.c_str());
4731 unsigned int recs = 0;
4733 FILE * jobs_file =
NULL;
4735 if (!
CDir(dump_dname).Exists())
4737 if (!
CFile(jobs_file_name).Exists())
4744 jobs_file = fopen(jobs_file_name.c_str(),
"rb");
4745 if (jobs_file ==
NULL)
4746 throw runtime_error(
"Cannot open file " + jobs_file_name +
4747 " to load dumped jobs");
4750 header.
Read(jobs_file);
4756 input_buf.
get(), output_buf.
get(),
4758 unsigned int job_id = job.
GetId();
4796 aff_id, group_id, expiration);
4807 }
catch (
const exception & ex) {
4808 if (jobs_file !=
NULL)
4812 throw runtime_error(
"Error loading queue " +
m_QueueName +
4813 " from its dump: " +
string(ex.what()));
4815 if (jobs_file !=
NULL)
4819 throw runtime_error(
"Unknown error loading queue " +
m_QueueName +
4848 const string & job_key,
4852 string notification;
4861 job, job_key, job_status, reason);
4871 if (notification.empty())
4873 job, job_key, job_status, reason);
Algorithms for bvector<> (main include)
void Release()
Manually force the resource to be released.
static std::string EventToString(EJobEvent event)
void SetNodeAddr(unsigned int node_ip)
void SetStatus(TJobStatus status)
void SetTimestamp(const CNSPreciseTime &t)
CNSPreciseTime GetLifetime(unsigned int job_id) const
bool DeleteIfTimedOut(unsigned int job_id, const CNSPreciseTime ¤t_time, unsigned int *aff_id, unsigned int *group_id)
void UpdateReadVacantTime(unsigned int job_id, const CNSPreciseTime &read_vacant_time)
void RegisterJob(unsigned int job_id, const CNSPreciseTime &submit_time, unsigned int aff_id, unsigned int group_id, const CNSPreciseTime &life_time)
void UpdateLifetime(unsigned int job_id, const CNSPreciseTime &life_time)
unsigned int GetAffinityID(unsigned int job_id) const
bool IsOutdatedJob(unsigned int job_id, ECommandGroup cmd_group, const CNSPreciseTime &timeout) const
void ChangeAffinityAndGroup(unsigned int job_id, unsigned int aff_id, unsigned int group_id)
unsigned GetNext(TJobStatus status, unsigned job_id) const
void SetStatus(unsigned int job_id, TJobStatus status)
void Erase(unsigned job_id)
void GetJobs(const vector< TJobStatus > &statuses, TNSBitVector &jobs) const
void AddPendingJob(unsigned int job_id)
void StatusStatistics(TJobStatus status, TNSBitVector::statistics *st) const
vector< unsigned int > GetJobCounters(const vector< TJobStatus > &statuses) const
void SetExactStatusNoLock(unsigned int job_id, TJobStatus status, bool set_clear)
unsigned int CountStatus(TJobStatus status) const
TJobStatus GetStatus(unsigned job_id) const
TNSBitVector GetOutdatedReadVacantJobs(CNSPreciseTime timeout, const TNSBitVector &read_jobs, const CJobGCRegistry &gc_registry) const
void ClearAll(TNSBitVector *bv)
void AddPendingBatch(unsigned job_id_from, unsigned job_id_to)
unsigned int GetJobByStatus(TJobStatus status, const TNSBitVector &unwanted_jobs, const TNSBitVector &restrict_jobs, bool restricted) const
TNSBitVector GetOutdatedPendingJobs(CNSPreciseTime timeout, const CJobGCRegistry &gc_registry) const
void SetPassport(unsigned int passport)
unsigned GetRunCount() const
CNSPreciseTime GetTimeout() const
bool GetSubmNeedProgressMsgNotif() const
unsigned GetSubmAddr() const
bool ShouldNotifyListener(const CNSPreciseTime ¤t_time) const
void SetAffinityId(unsigned aff_id)
void SetLastTouch(const CNSPreciseTime &t)
unsigned int GetListenerNotifAddr() const
unsigned short GetSubmNotifPort() const
const string & GetInput() const
unsigned GetGroupId() const
CNSPreciseTime GetRunTimeout() const
void SetGroupId(unsigned id)
unsigned short GetListenerNotifPort() const
TJobStatus GetStatus() const
CJobEvent & AppendEvent()
CNSPreciseTime GetSubmitTime(void) const
bool GetLsnrNeedProgressMsgNotif() const
bool ShouldNotifySubmitter(const CNSPreciseTime ¤t_time) const
unsigned GetAffinityId() const
CNSPreciseTime GetExpirationTime(const CNSPreciseTime &queue_timeout, const CNSPreciseTime &queue_run_timeout, const CNSPreciseTime &queue_read_timeout, const CNSPreciseTime &queue_pending_timeout, const CNSPreciseTime &event_time) const
CNSPreciseTime GetLastTouch() const
CNSPreciseTime GetReadTimeout() const
bool LoadFromDump(FILE *jobs_file, char *input_buf, char *output_buf, const SJobDumpHeader &header)
void RemoveJobFromAffinity(unsigned int job_id, unsigned int aff_id)
unsigned int ResolveAffinity(const string &token)
TNSBitVector GetJobsWithAffinity(unsigned int aff_id) const
void Dump(const string &dump_dir_name, const string &queue_name) const
void FinalizeAffinityDictionaryLoading(void)
TNSBitVector GetJobsWithAffinities(const TNSBitVector &affs) const
void RemoveDump(const string &dump_dir_name, const string &queue_name) const
bool CanAccept(const string &aff_token, size_t max_records) const
string Print(const CQueue *queue, const CNSClientsRegistry &clients_registry, const TNSBitVector &scope_jobs, const string &scope, size_t batch_size, bool verbose) const
string GetTokenByID(unsigned int aff_id) const
void ResolveAffinities(const list< string > &tokens, TNSBitVector &resolved_affs, vector< unsigned int > &aff_ids)
TNSBitVector GetRegisteredAffinities(void) const
unsigned int CollectGarbage(unsigned int max_to_del)
void LoadFromDump(const string &dump_dir_name, const string &queue_name)
unsigned int GetIDByToken(const string &aff_token) const
unsigned int CheckRemoveCandidates(void)
unsigned int ResolveAffinityToken(const string &token, unsigned int job_id, unsigned int client_id, ECommandGroup command_group)
void AddJobToAffinity(unsigned int job_id, unsigned int aff_id)
void AppendType(const CNSClientId &client, unsigned int type_to_append)
bool IsPreferredByAny(unsigned int aff_id, ECommandGroup cmd_group) const
void RegisterJob(const CNSClientId &client, unsigned int job_id, ECommandGroup cmd_group)
void SetPreferredAffinities(const CNSClientId &client, const TNSBitVector &aff_to_set, ECommandGroup cmd_group)
void SubtractBlacklistedJobs(const CNSClientId &client, ECommandGroup cmd_group, TNSBitVector &bv) const
void Purge(const CNSPreciseTime ¤t_time, const CNSPreciseTime &timeout_worker_node, unsigned int min_worker_nodes, const CNSPreciseTime &timeout_admin, unsigned int min_admins, const CNSPreciseTime &timeout_submitter, unsigned int min_submitters, const CNSPreciseTime &timeout_reader, unsigned int min_readers, const CNSPreciseTime &timeout_unknown, unsigned int min_unknowns, bool is_log)
void StaleNodes(const CNSPreciseTime ¤t_time, const CNSPreciseTime &wn_timeout, const CNSPreciseTime &reader_timeout, bool is_log)
void AddToSubmitted(const CNSClientId &client, size_t count)
string PrintClientsList(const CQueue *queue, size_t batch_size, bool verbose) const
void UnregisterJob(const CNSClientId &client, unsigned int job_id, ECommandGroup cmd_group)
TNSBitVector GetAllPreferredAffinities(ECommandGroup cmd_group) const
void RegisterBlacklistedJob(const CNSClientId &client, unsigned int job_id, ECommandGroup cmd_group)
bool CancelWaiting(CNSClient &client, ECommandGroup cmd_group, bool touch_notif_registry=true)
void SetBlacklistTimeouts(const CNSPreciseTime &blacklist_timeout, const CNSPreciseTime &read_blacklist_timeout)
void MoveJobToBlacklist(const CNSClientId &client, unsigned int job_id, ECommandGroup cmd_group)
void ClearClient(const CNSClientId &client, TNSBitVector &running_jobs, TNSBitVector &reading_jobs, bool &client_was_found, string &old_session, bool &had_wn_pref_affs, bool &had_reader_pref_affs)
void GCBlacklistedJobs(const CJobStatusTracker &tracker, ECommandGroup cmd_group)
void UpdatePreferredAffinities(const CNSClientId &client, const TNSBitVector &aff_to_add, const TNSBitVector &aff_to_del, ECommandGroup cmd_group)
void Touch(CNSClientId &client, TNSBitVector &running_jobs, TNSBitVector &reading_jobs, bool &client_was_found, bool &session_was_reset, string &old_session, bool &had_wn_pref_affs, bool &had_reader_pref_affs)
bool GetAffinityReset(const CNSClientId &client, ECommandGroup cmd_group) const
void SetLastScope(const CNSClientId &client)
void MarkAsAdmin(const CNSClientId &client)
void RegisterSocketWriteError(const CNSClientId &client)
int SetClientData(const CNSClientId &client, const string &data, int data_version)
void SetRegistries(CNSAffinityRegistry *aff_registry, CNSNotificationList *notif_registry)
void SetNodeWaiting(const CNSClientId &client, unsigned short port, const TNSBitVector &aff_ids, ECommandGroup cmd_group)
TNSBitVector GetPreferredAffinities(const CNSClientId &client, ECommandGroup cmd_group) const
bool WasGarbageCollected(const CNSClientId &client, ECommandGroup cmd_group) const
void AddBlacklistedJobs(const CNSClientId &client, ECommandGroup cmd_group, TNSBitVector &bv) const
void RemoveJob(unsigned int group_id, unsigned int job_id)
void RemoveDump(const string &dump_dir_name, const string &queue_name) const
unsigned int CollectGarbage(unsigned int max_to_del)
unsigned int CheckRemoveCandidates(void)
TNSBitVector GetJobs(const string &group, bool allow_exception=true) const
unsigned int ResolveGroup(const string &group)
bool CanAccept(const string &group, size_t max_records) const
void AddJobToGroup(unsigned int group_id, unsigned int job_id)
unsigned int AddJob(const string &group, unsigned int job_id)
unsigned int AddJobs(unsigned int group_id, unsigned int first_job_id, unsigned int count)
void FinalizeGroupDictionaryLoading(void)
string Print(const CQueue *queue, const TNSBitVector &scope_jobs, const string &scope, size_t batch_size, bool verbose) const
void ResolveGroups(const list< string > &tokens, TNSBitVector &group_ids_vector)
void RestrictByGroup(const string &group, TNSBitVector &bv) const
void Dump(const string &dump_dir_name, const string &queue_name) const
void LoadFromDump(const string &dump_dir_name, const string &queue_name)
string BuildJobChangedNotification(const CJob &job, const string &job_key, TJobStatus job_status, ENotificationReason reason)
void onQueueResumed(bool any_pending)
void Notify(unsigned int job_id, unsigned int aff_id, CNSClientsRegistry &clients_registry, CNSAffinityRegistry &aff_registry, CNSGroupsRegistry &group_registry, CNSScopeRegistry &scope_registry, const CNSPreciseTime ¬if_highfreq_period, const CNSPreciseTime ¬if_handicap, ECommandGroup cmd_group)
void AddToQueueResumedNotifications(unsigned int address, unsigned short port, bool new_format)
void NotifyJobChanges(unsigned int address, unsigned short port, const string ¬ification)
void UnregisterListener(const CNSClientId &client, unsigned short port, ECommandGroup cmd_group)
void CheckOutdatedJobs(const TNSBitVector &outdated_jobs, CNSClientsRegistry &clients_registry, const CNSPreciseTime ¬if_highfreq_period, ECommandGroup cmd_group)
void ClearExactGetNotifications(void)
void CheckTimeout(const CNSPreciseTime ¤t_time, CNSClientsRegistry &clients_registry, ECommandGroup cmd_group)
void NotifyPeriodically(const CNSPreciseTime ¤t_time, unsigned int notif_lofreq_mult, CNSClientsRegistry &clients_registry)
void RegisterListener(const CNSClientId &client, unsigned short port, unsigned int timeout, bool wnode_aff, bool any_job, bool exclusive_new_affinity, bool new_format, const TNSBitVector &groups, ECommandGroup cmd_group)
string Print(const CNSClientsRegistry &clients_registry, const CNSAffinityRegistry &aff_registry, const CNSGroupsRegistry &group_registry, bool verbose) const
CNSPreciseTime NotifyExactListeners(void)
static CNSPreciseTime Current(void)
TNSBitVector GetAllJobsInScopes(void) const
void AddJobs(const string &scope, unsigned int first_job_id, unsigned int count)
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 GetJobScope(unsigned int job_id) const
void RemoveJob(unsigned int job_id)
void AddJob(const string &scope, unsigned int job_id)
CJsonNode SetHosts(const string &host_names)
NetSchedule internal exception.
@ eStatus_OK
Command is ok and execution is good.
NetScheduler threaded server.
void SetJobsStartID(const string &qname, unsigned int value)
unsigned int GetJobsStartID(const string &qname)
SNSRegistryParameters GetAffRegistrySettings(void) const
bool ShouldPerfLogTransitions(const string &queue_name, const string &class_name) const
CCompoundIDPool GetCompoundIDPool(void) const
SNSRegistryParameters GetScopeRegistrySettings(void) const
SNSRegistryParameters GetGroupRegistrySettings(void) const
void AddClientInfo(const CQueueClientInfo &cinfo)
map< string, string > GetLinkedSection(const string §ion_name) const
unsigned GetNumParams() const
unsigned int GetMaxOutputSize() const
unsigned int GetFailedRetries() const
string GetParamValue(unsigned int n) const
unsigned int GetMaxInputSize() const
string GetParamName(unsigned int n) const
CFastMutex m_OperationLock
void x_ResetReadingDueToClear(const CNSClientId &client, const TNSBitVector &jobs)
void SetPauseStatus(const CNSClientId &client, TPauseStatus status)
CFastMutex m_JobsToDeleteLock
unsigned int CountActiveJobs(void) const
map< string, size_t > x_GetRunningJobsPerClientIP(void)
CNSScopeRegistry m_ScopeRegistry
void x_ResetRunningDueToNewSession(const CNSClientId &client, const TNSBitVector &jobs)
CNSPreciseTime m_ClientRegistryTimeoutSubmitter
TJobStatus ConfirmReadingJob(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token)
string DecorateJob(unsigned int job_id) const
void TimeLineRemove(unsigned int job_id)
void PurgeClientRegistry(const CNSPreciseTime ¤t_time)
map< unsigned int, CJob > m_Jobs
void TimeLineMove(unsigned int job_id, const CNSPreciseTime &old_time, const CNSPreciseTime &new_time)
unsigned int m_DumpAffBufferSize
int SetClientData(const CNSClientId &client, const string &data, int data_version)
unsigned m_ReadFailedRetries
TPauseStatus m_PauseStatus
CNetScheduleServer * m_Server
TJobStatus x_ChangeReadingStatus(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, const string &err_msg, TJobStatus target_status, bool is_ns_rollback, bool no_retries)
unsigned CountStatus(TJobStatus) const
CQueueDataBase & m_QueueDB
CNSPreciseTime m_PendingTimeout
CJobStatusTracker m_StatusTracker
unsigned m_MaxJobsPerClient
void x_RegisterGetListener(const CNSClientId &client, unsigned short port, unsigned int timeout, const TNSBitVector &aff_ids, bool wnode_aff, bool any_aff, bool exclusive_new_affinity, bool new_format, const TNSBitVector &group_ids)
void x_CheckExecutionTimeout(const CNSPreciseTime &queue_run_timeout, const CNSPreciseTime &queue_read_timeout, unsigned job_id, const CNSPreciseTime &curr_time, bool logging)
unsigned int CancelAllJobs(const CNSClientId &client, bool logging)
string PrintNotificationsList(bool verbose) const
unsigned int m_ClientRegistryMinWorkerNodes
void SetAffinity(const CNSClientId &client, const list< string > &aff, ECommandGroup cmd_group)
const string & GetQueueName() const
void PrintStatistics(size_t &aff_count) const
void StatusStatistics(TJobStatus status, TNSBitVector::statistics *st) const
unsigned int LoadFromDump(const string &dump_dir_name)
string PrintClientsList(bool verbose) const
x_SJobPick x_FindOutdatedPendingJob(const CNSClientId &client, unsigned int picked_earlier, const TNSBitVector &group_ids)
void NotifyListenersPeriodically(const CNSPreciseTime ¤t_time)
CNSPreciseTime m_ReadTimeout
CStatisticsCounters m_StatisticsCountersLastPrinted
bool PutProgressMessage(unsigned int job_id, CJob &job, const string &msg)
unsigned int CancelSelectedJobs(const CNSClientId &client, const string &group, const string &aff_token, const vector< TJobStatus > &statuses, bool logging, vector< string > &warnings)
void CheckExecutionTimeout(bool logging)
unsigned SubmitBatch(const CNSClientId &client, vector< pair< CJob, string > > &batch, const string &group, bool logging, CNSRollbackInterface *&rollback_action)
TJobStatus ReadAndTouchJob(unsigned int job_id, CJob &job, CNSPreciseTime *lifetime)
CNSPreciseTime m_ClientRegistryTimeoutReader
unsigned int m_ClientRegistryMinUnknowns
void TimeLineAdd(unsigned int job_id, const CNSPreciseTime &job_time)
unsigned int GetJobsToDeleteCount(void) const
CNSPreciseTime m_ReadBlacklistTime
TJobStatus FailReadingJob(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, const string &err_msg, bool no_retries)
TJobStatus SetJobListener(unsigned int job_id, CJob &job, unsigned int address, unsigned short port, const CNSPreciseTime &timeout, bool need_stolen, bool need_progress_msg, size_t *last_event_index)
void ClearWorkerNode(const CNSClientId &client, bool &client_was_found, string &old_session, bool &had_wn_pref_affs, bool &had_reader_pref_affs)
CNSPreciseTime m_ReaderTimeout
void RegisterQueueResumeNotification(unsigned int address, unsigned short port, bool new_format)
string GetAffinityTokenByID(unsigned int aff_id) const
CJobTimeLine * m_RunTimeLine
void Dump(const string &dump_dir_name)
bool GetJobForReadingOrWait(const CNSClientId &client, unsigned int port, unsigned int timeout, const list< string > *aff_list, bool reader_affinity, bool any_affinity, bool exclusive_new_affinity, bool prioritized_aff, const list< string > *group_list, bool affinity_may_change, bool group_may_change, CJob *job, bool *no_more_jobs, CNSRollbackInterface *&rollback_action, string &added_pref_aff)
unsigned int PurgeAffinities(void)
void UpdatePerfLoggingSettings(const string &qclass)
void SetParameters(const SQueueParameters ¶ms)
CNetScheduleKeyGenerator m_KeyGenerator
TJobStatus JobDelayExpiration(unsigned int job_id, CJob &job, const CNSPreciseTime &tm)
void SetClientScope(const CNSClientId &client)
CQueueClientInfoList m_ProgramVersionList
unsigned int x_CancelJobs(const CNSClientId &client, const TNSBitVector &jobs_to_cancel, bool logging)
string PrintTransitionCounters(void) const
string PrintScopesList(bool verbose) const
CNSPreciseTime m_BlacklistTime
CNSPreciseTime NotifyExactListeners(void)
void CancelWaitRead(const CNSClientId &client)
CNetScheduleAccessList m_SubmHosts
TJobStatus FailJob(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, const string &err_msg, const string &output, int ret_code, bool no_retries, string warning)
TJobStatus ReturnReadingJob(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, bool is_ns_rollback, bool blacklist, TJobStatus target_status)
unsigned int GetNextJobIdForBatch(unsigned count)
TParameterList GetParameters() const
void MarkClientAsAdmin(const CNSClientId &client)
bool x_UnregisterGetListener(const CNSClientId &client, unsigned short port)
CNSClientsRegistry m_ClientsRegistry
string x_GetJobsDumpFileName(const string &dump_dname) const
TJobStatus JobDelayReadExpiration(unsigned int job_id, CJob &job, const CNSPreciseTime &tm)
string MakeJobKey(unsigned int job_id) const
string PrintJobDbStat(const CNSClientId &client, unsigned int job_id, TDumpFields dump_fields)
TJobStatus PutResult(const CNSClientId &client, const CNSPreciseTime &curr, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, int ret_code, const string &output)
unsigned int m_JobsToDeleteOps
unsigned int Submit(const CNSClientId &client, CJob &job, const string &aff_token, const string &group, bool logging, CNSRollbackInterface *&rollback_action)
TJobStatus GetStatusAndLifetime(unsigned int job_id, string &client_ip, string &client_sid, string &client_phid, string &progress_msg, CNSPreciseTime *lifetime)
void GetJobsPerState(const CNSClientId &client, const string &group_token, const string &aff_token, size_t *jobs, vector< string > &warnings) const
void RemoveDump(const string &dump_dir_name)
TJobStatus x_ResetDueTo(const CNSClientId &client, unsigned int job_id, const CNSPreciseTime ¤t_time, TJobStatus status_from, CJobEvent::EJobEvent event_type)
CNSPreciseTime m_ClientRegistryTimeoutAdmin
SPurgeAttributes CheckJobsExpiry(const CNSPreciseTime ¤t_time, SPurgeAttributes attributes, unsigned int last_job, TJobStatus status)
void x_LogSubmit(const CJob &job)
void x_Erase(const TNSBitVector &job_ids, TJobStatus status)
Erase jobs from all structures, request delayed db deletion.
unsigned int m_DumpGroupBufferSize
x_SJobPick x_FindOutdatedJobForReading(const CNSClientId &client, unsigned int picked_earlier, const TNSBitVector &group_ids)
CNSPreciseTime m_WNodeTimeout
list< pair< string, string > > TParameterList
CNetScheduleAccessList m_WnodeHosts
TJobStatus ReturnJob(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, string &warning, TJobReturnOption how)
unsigned int m_ClientRegistryMinSubmitters
void TimeLineExchange(unsigned int remove_job_id, unsigned int add_job_id, const CNSPreciseTime &new_time)
void x_ResetReadingDueToNewSession(const CNSClientId &client, const TNSBitVector &jobs)
CNSPreciseTime m_ClientRegistryTimeoutWorkerNode
string PrintGroupsList(const CNSClientId &client, bool verbose) const
TJobStatus GetJobStatus(unsigned job_id) const
void GetLinkedSections(map< string, map< string, string > > &linked_sections) const
unsigned int m_ReadJobsOps
TNSBitVector m_JobsToDelete
string PrintAllJobDbStat(const CNSClientId &client, const string &group, const string &aff_token, const vector< TJobStatus > &job_statuses, unsigned int start_after_job_id, unsigned int count, bool order_first, TDumpFields dump_fields, bool logging)
TJobStatus RescheduleJob(const CNSClientId &client, unsigned int job_id, const string &job_key, const string &auth_token, const string &aff_token, const string &group, bool &auth_token_ok, CJob &job)
CNSPreciseTime GetTimeout() const
CNSPreciseTime GetReadTimeout() const
string PrintAffinitiesList(const CNSClientId &client, bool verbose) const
string x_DumpJobs(const TNSBitVector &jobs_to_dump, unsigned int start_after_job_id, unsigned int count, TDumpFields dump_fields, bool order_first)
unsigned int m_ClientRegistryMinReaders
CNSNotificationList m_NotificationsList
bool GetJobOrWait(const CNSClientId &client, unsigned short port, unsigned int timeout, const list< string > *aff_list, bool wnode_affinity, bool any_affinity, bool exclusive_new_affinity, bool prioritized_aff, bool new_format, const list< string > *group_list, CJob *new_job, CNSRollbackInterface *&rollback_action, string &added_pref_aff)
CQueue(const string &queue_name, TQueueKind queue_kind, CNetScheduleServer *server, CQueueDataBase &qdb)
void RegisterSocketWriteError(const CNSClientId &client)
unsigned int m_ClientRegistryMinAdmins
void x_UpdateDB_ProvideJobNoLock(const CNSClientId &client, const CNSPreciseTime &curr, unsigned int job_id, ECommandGroup cmd_group, CJob &job)
CNSPreciseTime m_MaxPendingReadWaitTimeout
CNSPreciseTime m_ClientRegistryTimeoutUnknown
unsigned int PurgeGroups(void)
CStatisticsCounters m_StatisticsCounters
bool x_NoMoreReadJobs(const CNSClientId &client, const TNSBitVector &aff_list, bool reader_affinity, bool any_affinity, bool exclusive_new_affinity, const TNSBitVector &group_list, bool affinity_may_change, bool group_may_change)
CNSAffinityRegistry m_AffinityRegistry
unsigned int m_DumpBufferSize
const bool & m_LogBatchEachJob
x_SJobPick x_FindVacantJob(const CNSClientId &client, const TNSBitVector &explicit_affs, const vector< unsigned int > &aff_ids, bool use_pref_affinity, bool any_affinity, bool exclusive_new_affinity, bool prioritized_aff, const TNSBitVector &group_ids, bool has_groups, ECommandGroup cmd_group)
CNetScheduleAccessList m_ReaderHosts
CNSPreciseTime x_GetEstimatedJobLifetime(unsigned int job_id, TJobStatus status) const
map< string, string > m_LinkedSections
void PrintJobCounters(void) const
TJobStatus RedoJob(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job)
TJobStatus RereadJob(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, bool &no_op)
CNSGroupsRegistry m_GroupRegistry
void x_NotifyJobChanges(const CJob &job, const string &job_key, ENotificationReason reason, const CNSPreciseTime ¤t_time)
CNSPreciseTime GetRunTimeout() const
CNSPreciseTime m_NotifHifreqPeriod
string PrintJobsStat(const CNSClientId &client, const string &group_token, const string &aff_token, vector< string > &warnings) const
void GetMaxIOSizesAndLinkedSections(unsigned int &max_input_size, unsigned int &max_output_size, map< string, map< string, string > > &linked_sections) const
unsigned int m_DumpClientBufferSize
void StaleNodes(const CNSPreciseTime ¤t_time)
void x_ResetRunningDueToClear(const CNSClientId &client, const TNSBitVector &jobs)
CJobGCRegistry m_GCRegistry
void PurgeBlacklistedJobs(void)
bool x_ValidateMaxJobsPerClientIP(unsigned int job_id, const map< string, size_t > &jobs_per_client_ip) const
TJobStatus GetStatusAndLifetimeAndTouch(unsigned int job_id, CJob &job, CNSPreciseTime *lifetime)
void TouchClientsRegistry(CNSClientId &client, bool &client_was_found, bool &session_was_reset, string &old_session, bool &had_wn_pref_affs, bool &had_reader_pref_affs)
void EraseJob(unsigned job_id, TJobStatus status)
void CancelWaitGet(const CNSClientId &client)
CNSPreciseTime m_MaxPendingWaitTimeout
list< string > ChangeAffinity(const CNSClientId &client, const list< string > &aff_to_add, const list< string > &aff_to_del, ECommandGroup cmd_group)
void x_UpdateDB_PutResultNoLock(unsigned job_id, const string &auth_token, const CNSPreciseTime &curr, int ret_code, const string &output, CJob &job, const CNSClientId &client)
bool m_ShouldPerfLogTransitions
CNSPreciseTime m_RunTimeout
void x_RegisterReadListener(const CNSClientId &client, unsigned short port, unsigned int timeout, const TNSBitVector &aff_ids, bool reader_aff, bool any_aff, bool exclusive_new_affinity, const TNSBitVector &group_ids)
unsigned int m_NotifLofreqMult
unsigned int DeleteBatch(unsigned int max_deleted)
CNSPreciseTime m_StatisticsCountersLastPrintedTimestamp
CNSPreciseTime m_HandicapTimeout
CRWLock m_RunTimeLineLock
vector< CNetScheduleAPI::EJobStatus > m_StatesForRead
TJobStatus Cancel(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, bool is_ns_rollback=false)
CNSPreciseTime m_NotifHifreqInterval
void CountNSGetRollback(size_t count)
void CountOutdatedPick(ECommandGroup cmd_group)
void CountDBDeletion(size_t count)
void CountRedo(CNetScheduleAPI::EJobStatus from)
void CountToPendingRescheduled(size_t count)
void CountReread(CNetScheduleAPI::EJobStatus from, CNetScheduleAPI::EJobStatus to)
void CountTransitionToDeleted(CNetScheduleAPI::EJobStatus from, size_t count)
void CountTransition(CNetScheduleAPI::EJobStatus from, CNetScheduleAPI::EJobStatus to, ETransitionPathOption path_option=eNone)
void CountNSSubmitRollback(size_t count)
void PrintDelta(CDiagContext_Extra &extra, const CStatisticsCounters &prev) const
void CountToPendingWithoutBlacklist(size_t count)
void CountNSReadRollback(size_t count)
void PrintTransitions(CDiagContext_Extra &extra) const
void CountSubmit(size_t count)
void MoveObject(time_t old_time, time_t new_time, unsigned object_id)
Move object from one time slot to another.
void AddObject(time_t tm, unsigned object_id)
Add object to the timeline.
bool RemoveObject(time_t object_time, unsigned object_id)
Remove object from the time line, object_time defines time slot.
void ExtractObjects(time_t tm, TBitVector *objects)
Extracts all objects up to 'tm' and puts them into 'objects' vector.
time_t GetHead() const
Return head of the timeline.
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.
@ opt_free_0
Free unused 0 blocks.
bool get_bit(size_type n) const noexcept
returns true if bit n is set and false is bit n is 0.
bool any() const noexcept
Returns true if any bits in this bitset are set, and otherwise returns false.
bool empty() const noexcept
Returns true if the set is empty (no bits are set, otherwise returns false) Please note that this is ...
size_type size() const noexcept
Returns bvector's capacity (number of bits it can store)
void optimize(bm::word_t *temp_block=0, optmode opt_mode=opt_compress, statistics *stat=0)
Optimize memory bitvector's memory allocation.
bool set_bit(size_type n, bool val=true)
Sets bit n.
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
void Print(const CCompactSAMApplication::AlignInfo &ai)
static const int chunk_size
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static void DLIST_NAME() remove(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
static const struct attribute attributes[]
static SQLCHAR output[256]
element_type * get(void) const
Get pointer.
void PrintRequestStop(void)
Print request stop message (for request-driven applications)
CDiagContext_Extra & Print(const string &name, const string &value)
The method does not print the argument, but adds it to the string.
CDiagContext & GetDiagContext(void)
Get diag context instance.
static void SetRequestContext(CRequestContext *ctx)
Shortcut to CDiagContextThreadData::GetThreadData().SetRequestContext()
void PrintRequestStart(const string &message)
Print request start message (for request-driven applications)
CDiagContext_Extra Extra(void) const
Create a temporary CDiagContext_Extra object.
void Flush(void)
Print the message and reset object.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Warning(CExceptionArgs_Base &args)
EJobStatus
Job status codes.
static string StatusToString(EJobStatus status)
Printable status type.
string Generate(unsigned id) const
string GenerateCompoundID(unsigned id, CCompoundIDPool id_pool) const
@ eDeleted
The job has been wiped out of the database.
@ eDone
Job is ready (computed successfully)
@ eConfirmed
Final state - read confirmed.
@ eReading
Job has its output been reading.
@ eCanceled
Explicitly canceled.
@ eRunning
Running on a worker node.
@ eJobNotFound
No such job.
@ ePending
Waiting for execution.
@ eReadFailed
Final state - read failed.
@ eFailed
Failed to run (execution timeout)
@ eOutOfOrder
This jobs comes to the node before every regular jobs.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string & ToUpper(string &str)
Convert string to upper case – string& version.
unsigned short GetPort() const
Get the listening port number back.
@ BM_GAP
GAP compression is ON.
CNSPreciseTime GetJobExpirationTime(const CNSPreciseTime &last_touch, TJobStatus status, const CNSPreciseTime &job_submit_time, const CNSPreciseTime &job_timeout, const CNSPreciseTime &job_run_timeout, const CNSPreciseTime &job_read_timeout, const CNSPreciseTime &queue_timeout, const CNSPreciseTime &queue_run_timeout, const CNSPreciseTime &queue_read_timeout, const CNSPreciseTime &queue_pending_timeout, const CNSPreciseTime &event_time)
const size_t g_ValidJobStatusesSize
const CNetScheduleAPI::EJobStatus g_ValidJobStatuses[]
Uint4 GetHost(TEndpointKey key)
const unsigned int kNetScheduleMaxDBDataSize
Int4 delta(size_t dimension_, const Int4 *score_)
const string k_NoAffinityToken
const CNSPreciseTime default_client_registry_timeout_unknown
const unsigned int default_dump_group_buffer_size
const CNSPreciseTime default_run_timeout(3600, 0)
const unsigned int default_max_jobs_per_client
const CNSPreciseTime default_wnode_timeout(40, 0)
const unsigned int default_notif_lofreq_mult
const unsigned int default_dump_aff_buffer_size
const CNSPreciseTime default_notif_hifreq_interval(0, kNSecsPerSecond/10)
const unsigned int default_dump_client_buffer_size
const unsigned int default_client_registry_min_submitters
const unsigned int default_client_registry_min_unknowns
const CNSPreciseTime default_pending_timeout(604800, 0)
const CNSPreciseTime default_reader_timeout(40, 0)
const CNSPreciseTime default_read_timeout(10, 0)
const unsigned int default_client_registry_min_admins
const CNSPreciseTime default_timeout(3600, 0)
const CNSPreciseTime default_client_registry_timeout_worker_node
const unsigned int default_dump_buffer_size
const unsigned int default_client_registry_min_worker_nodes
const unsigned int default_failed_retries
const CNSPreciseTime default_client_registry_timeout_admin
const CNSPreciseTime default_notif_hifreq_period(5, 0)
const CNSPreciseTime default_client_registry_timeout_reader
const CNSPreciseTime default_client_registry_timeout_submitter
const CNSPreciseTime default_blacklist_time
const unsigned int default_client_registry_min_readers
const bool default_scramble_job_keys
void g_DoErasePerfLogging(const CQueue &queue, const CJob &job)
void g_DoPerfLogging(const CQueue &queue, const CJob &job, int status)
const CNSPreciseTime kTimeZero
const CNSPreciseTime kTimeNever
string NS_FormatPreciseTimeAsSec(const CNSPreciseTime &t)
string NS_FormatPreciseTime(const CNSPreciseTime &t)
static const unsigned int s_ReserveDelta
CTimeLine< TNSBitVector > CJobTimeLine
void SerializePauseState(CNetScheduleServer *server)
const string kNoScopeOnly
const TNSBitVector kEmptyBitVector
@ eProgressMessageChanged
const string kJobsFileName("jobs.dump")
static string kNewLine("\n")
const unsigned kNetScheduleMaxOverflowSize
Query parser execution implementations.
Query string parsing components.
Defines CRequestContext class for NCBI C++ diagnostic API.
static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
static CNamedPipeClient * client
unsigned int low_mark_percentage
unsigned int dirt_percentage
unsigned int high_mark_percentage
unsigned int high_removal
unsigned int dump_buffer_size
unsigned int client_registry_min_submitters
CNSPreciseTime blacklist_time
map< string, string > linked_sections
CNSPreciseTime read_timeout
unsigned int client_registry_min_unknowns
CNSPreciseTime notif_hifreq_interval
unsigned int dump_aff_buffer_size
CNSPreciseTime notif_hifreq_period
unsigned int max_output_size
CNSPreciseTime read_blacklist_time
CNSPreciseTime pending_timeout
unsigned int max_input_size
CNSPreciseTime notif_handicap
unsigned int max_jobs_per_client
CNSPreciseTime client_registry_timeout_submitter
unsigned int read_failed_retries
CNSPreciseTime client_registry_timeout_unknown
CNSPreciseTime CalculateRuntimePrecision(void) const
unsigned int notif_lofreq_mult
unsigned int dump_client_buffer_size
CNSPreciseTime reader_timeout
unsigned int failed_retries
CNSPreciseTime max_pending_read_wait_timeout
unsigned int dump_group_buffer_size
unsigned int client_registry_min_worker_nodes
CNSPreciseTime max_pending_wait_timeout
CNSPreciseTime client_registry_timeout_admin
CNSPreciseTime client_registry_timeout_reader
CNSPreciseTime run_timeout
CNSPreciseTime client_registry_timeout_worker_node
CNSPreciseTime wnode_timeout
unsigned int client_registry_min_admins
unsigned int client_registry_min_readers
Statistical information about bitset's memory allocation details.