NCBI C++ ToolKit
netschedule_api_executor.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: netschedule_api_executor.cpp 87801 2019-10-04 15:52:36Z sadyrovr $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: Anatoliy Kuznetsov, Maxim Didenko, Dmitry Kazimirov
27  *
28  * File Description:
29  * Implementation of NetSchedule API.
30  *
31  */
32 
33 #include <ncbi_pch.hpp>
34 
35 #include "netschedule_api_impl.hpp"
36 
37 #include <cmath>
38 
39 #define NCBI_USE_ERRCODE_X ConnServ_NetSchedule
40 
42 
43 using namespace grid::netschedule;
44 
45 bool s_DoParseGet2JobResponse(CNetScheduleJob& job, const string& response)
46 {
47  enum {
48  eJobKey,
49  eJobInput,
50  eJobAuthToken,
51  eJobAffinity,
52  eClientIP,
53  eClientSessionID,
54  ePageHitID,
55  eJobMask,
56  eNumberOfJobBits
57  };
58  int job_bits = 0;
59  CUrlArgs url_parser(response);
60  ITERATE(CUrlArgs::TArgs, field, url_parser.GetArgs()) {
61 
62  if (field->name == "job_key") {
63  job_bits |= (1 << eJobKey);
64  job.job_id = field->value;
65 
66  } else if (field->name == "input") {
67  job_bits |= (1 << eJobInput);
68  job.input = field->value;
69 
70  } else if (field->name == "auth_token") {
71  job_bits |= (1 << eJobAuthToken);
72  job.auth_token = field->value;
73 
74  } else if (field->name == "affinity") {
75  job_bits |= (1 << eJobAffinity);
76  job.affinity = field->value;
77 
78  } else if (field->name == "client_ip") {
79  job_bits |= (1 << eClientIP);
80  job.client_ip = field->value;
81 
82  } else if (field->name == "client_sid") {
83  job_bits |= (1 << eClientSessionID);
84  job.session_id = field->value;
85 
86  } else if (field->name == "mask") {
87  job_bits |= (1 << eJobMask);
88  job.mask = atoi(field->value.c_str());
89 
90  } else if (field->name == "ncbi_phid") {
91  job_bits |= (1 << ePageHitID);
92  job.page_hit_id = field->value;
93  }
94 
95  if (job_bits == (1 << eNumberOfJobBits) - 1)
96  break;
97  }
98  return !job.job_id.empty();
99 }
100 
101 string s_GET2(CNetScheduleExecutor::EJobAffinityPreference affinity_preference);
102 
103 bool s_ParseGetJobResponse(CNetScheduleJob& job, const string& response)
104 {
105  if (response.empty())
106  return false;
107 
108  try {
109  return s_DoParseGet2JobResponse(job, response);
110  }
111  catch (CUrlParserException&) {
112  NCBI_THROW(CNetScheduleException, eProtocolSyntaxError,
113  "Cannot parse server output for GET2:\n" + response);
114  }
115 }
116 
117 ////////////////////////////////////////////////////////////////////////
119  unsigned runtime_inc)
120 {
121  string cmd("JDEX " + job.job_id);
122  cmd += ' ';
123  cmd += NStr::NumericToString(runtime_inc);
125  m_Impl->m_API->ExecOnJobServer(job, cmd, eOn);
126 }
127 
129 {
130 public:
131  CGetJobCmdExecutor(const string& get_cmd,
132  CNetScheduleJob& job, SNetScheduleExecutorImpl* executor) :
133  m_GetCmd(get_cmd), m_Job(job), m_Executor(executor)
134  {
135  }
136 
137  virtual bool Consider(CNetServer server);
138 
139 private:
140  const string& m_GetCmd;
143 };
144 
146 {
147  return m_Executor->ExecGET(server, m_GetCmd, m_Job);
148 }
149 
151 {
152  return m_Impl->m_API->GetServerParams();
153 }
154 
156 {
157  m_Impl->m_API->x_ClearNode();
158 }
159 
162 {
163  m_Impl->m_AffinityPreference = aff_pref;
164 }
165 
166 void CNetScheduleExecutor::SetJobGroup(const string& job_group)
167 {
168  m_Impl->m_JobGroup = job_group;
169 }
170 
172  CNetServer orig_server, const string& affinity)
173 {
174  if (m_AffinityPreference != CNetScheduleExecutor::eClaimNewPreferredAffs ||
175  affinity.empty())
176  return;
177 
178  CFastMutexGuard guard(m_PreferredAffMutex);
179 
180  if (m_PreferredAffinities.find(affinity) == m_PreferredAffinities.end()) {
181  m_PreferredAffinities.insert(affinity);
182  string new_preferred_aff_cmd = "CHAFF add=" + affinity;
183  g_AppendClientIPSessionIDHitID(new_preferred_aff_cmd);
184  for (CNetServiceIterator it =
185  m_API->m_Service.ExcludeServer(orig_server); it; ++it)
186  try {
187  (*it).ExecWithRetry(new_preferred_aff_cmd, false);
188  }
189  catch (CException& e) {
190  ERR_POST("Error while notifying " <<
191  (*it).GetServerAddress() <<
192  " of a new affinity " << e);
193 
194  CFastMutexGuard sync_guard(m_API->m_SharedData->m_AffinitySubmissionMutex);
195  auto& affs_synced = it.GetServer()->Get<SNetScheduleServerProperties>()->affs_synced;
196 
197  affs_synced = false;
198  }
199  }
200 }
201 
203 {
204  CFastMutexGuard guard(m_PreferredAffMutex);
205 
206  string cmd("SETAFF aff=\"");
207  const char* sep = "";
208  ITERATE(set<string>, it, m_PreferredAffinities) {
209  cmd += sep;
210  cmd += *it;
211  sep = ",";
212  }
213  cmd += '"';
215 
216  return cmd;
217 }
218 
220  const string& get_cmd, CNetScheduleJob& job)
221 {
222  CNetScheduleGETCmdListener get_cmd_listener(this);
223 
224  CNetServer::SExecResult exec_result;
225 
226  try {
227  server->ConnectAndExec(get_cmd, false,
228  exec_result, NULL, &get_cmd_listener);
229  }
230  catch (CNetScheduleException& e) {
232  throw;
233 
234  {
235  CFastMutexGuard guard(m_API->m_SharedData->m_AffinitySubmissionMutex);
236  auto& affs_synced = server->Get<SNetScheduleServerProperties>()->affs_synced;
237 
238  affs_synced = false;
239  server->ConnectAndExec(MkSETAFFCmd(), false, exec_result);
240  affs_synced = true;
241  }
242 
243  server->ConnectAndExec(get_cmd, false,
244  exec_result, NULL, &get_cmd_listener);
245  }
246 
247  if (!s_ParseGetJobResponse(job, exec_result.response))
248  return false;
249 
250  // Remember the server that issued this job.
251  job.server = server;
252 
253  // If a new preferred affinity is given by the server,
254  // register it with the rest of servers.
255  ClaimNewPreferredAffinity(server, job.affinity);
256 
257  return true;
258 }
259 
261  SNetServerImpl* server, const CDeadline& timeout,
262  const string& prio_aff_list, bool any_affinity, CNetScheduleJob& job)
263 {
264  // Ask for any affinity only when requested and configured
265  // (it's not requested when we have a job already).
266  const auto affinity_preference = any_affinity ? m_AffinityPreference :
268 
269  string cmd(s_GET2(affinity_preference));
270  const bool have_affinities = !prio_aff_list.empty();
271 
272  if (have_affinities) cmd += " aff=" + prio_aff_list;
273 
274  m_NotificationHandler.CmdAppendTimeoutGroupAndClientInfo(cmd,
275  &timeout, m_JobGroup);
276 
277  if (have_affinities) cmd += " prioritized_aff=1";
278 
279  return ExecGET(server, cmd, job);
280 }
281 
283  const string& affinity_list,
284  CDeadline* deadline)
285 {
287  m_Impl->m_AffinityPreference, affinity_list));
288 
289  string cmd(base_cmd);
290  m_Impl->m_NotificationHandler.CmdAppendTimeoutGroupAndClientInfo(
291  cmd, deadline, m_Impl->m_JobGroup);
292  if (m_Impl->m_NotificationHandler.RequestJob(m_Impl, job, cmd))
293  return true;
294 
295  if (deadline == NULL)
296  return false;
297 
298  while (m_Impl->m_NotificationHandler.WaitForNotification(*deadline)) {
299  CNetServer server;
300  if (m_Impl->m_NotificationHandler.CheckRequestJobNotification(m_Impl,
301  &server)) {
302  cmd.erase(base_cmd.length());
303  m_Impl->m_NotificationHandler.CmdAppendTimeoutGroupAndClientInfo(
304  cmd, deadline, m_Impl->m_JobGroup);
305  if (s_ParseGetJobResponse(job, server.ExecWithRetry(cmd,
306  false).response)) {
307  // Remember the server that issued this job.
308  job.server = server;
309 
310  // Notify the rest of NetSchedule servers that
311  // we are no longer listening on the UDP socket.
312  string cancel_wget_cmd("CWGET");
313  g_AppendClientIPSessionIDHitID(cancel_wget_cmd);
314  for (CNetServiceIterator it =
315  m_Impl->m_API->m_Service.ExcludeServer(server); it; ++it)
316  (*it).ExecWithRetry(cancel_wget_cmd, false);
317 
318  // Also, if a new preferred affinity is given by
319  // the server, register it with the rest of servers.
320  m_Impl->ClaimNewPreferredAffinity(server, job.affinity);
321 
322  return true;
323  }
324  }
325  }
326 
327  return false;
328 }
329 
331  unsigned wait_time,
332  const string& affinity_list)
333 {
334  if (wait_time == 0)
335  return GetJob(job, affinity_list);
336  else {
337  CDeadline deadline(wait_time, 0);
338 
339  return GetJob(job, affinity_list, &deadline);
340  }
341 }
342 
344 {
345  switch (affinity_preference) {
347  return "GET2 wnode_aff=1 any_aff=1";
348 
350  return "GET2 wnode_aff=1 any_aff=0";
351 
353  return "GET2 wnode_aff=1 any_aff=0 exclusive_new_aff=1";
354 
356  return "GET2 wnode_aff=0 any_aff=1";
357 
358  default:
359  return "GET2 wnode_aff=0 any_aff=0";
360  }
361 }
362 
365  const string& affinity_list)
366 {
367  string cmd(s_GET2(affinity_preference));
368 
369  if (!affinity_list.empty()) {
370  list<CTempString> affinity_tokens;
371 
372  NStr::Split(affinity_list, ",", affinity_tokens,
374 
375  ITERATE(list<CTempString>, token, affinity_tokens) {
376  limits::Check<limits::SAffinity>(*token);
377  }
378 
379  cmd += " aff=";
380  cmd += affinity_list;
381  }
382 
383  return cmd;
384 }
385 
387  string& cmd, const CDeadline* deadline, const string& job_group)
388 {
389  if (deadline != NULL) {
390  unsigned remaining_seconds = (unsigned)
391  ceil(deadline->GetRemainingTime().GetAsDouble());
392 
393  if (remaining_seconds > 0) {
394  cmd += " port=";
396 
397  cmd += " timeout=";
398  cmd += NStr::UIntToString(remaining_seconds);
399  }
400  }
401 
402  if (!job_group.empty()) {
403  cmd += " group=\"";
404  cmd += NStr::PrintableString(job_group);
405  cmd += '"';
406  }
407 
409 }
410 
413  CNetScheduleJob& job,
414  const string& cmd)
415 {
416  CGetJobCmdExecutor get_cmd_executor(cmd, job, executor);
417 
419  &get_cmd_executor, CNetService::eIncludePenalized));
420 
421  if (!it)
422  return false;
423 
424  string cancel_wget_cmd("CWGET");
425  g_AppendClientIPSessionIDHitID(cancel_wget_cmd);
426 
427  while (--it)
428  (*it).ExecWithRetry(cancel_wget_cmd, false);
429 
430  return true;
431 }
432 
435 {
436  SNetScheduleOutputParser parser(m_Receiver.message);
437 
438  if (parser("queue") != executor->m_API.GetQueueName()) return false;
439 
440  return executor->m_API->GetServerByNode(parser("ns_node"), server);
441 }
442 
443 inline
444 void static s_CheckOutputSize(const string& output, size_t max_output_size)
445 {
446  if (output.length() > max_output_size) {
447  NCBI_THROW(CNetScheduleException, eDataTooLong,
448  "Output data too long.");
449  }
450 }
451 
453 {
455  m_Impl->m_API->GetServerParams().max_output_size);
456 
457  string cmd("PUT2 job_key=" + job.job_id);
458 
459  limits::Check<limits::SAuthToken>(job.auth_token);
460  cmd.append(" auth_token=");
461  cmd.append(job.auth_token);
462 
463  cmd.append(" job_return_code=");
464  cmd.append(NStr::NumericToString(job.ret_code));
465 
466  cmd.append(" output=\"");
467  cmd.append(NStr::PrintableString(job.output));
468  cmd.push_back('\"');
469 
471  m_Impl->m_API->ExecOnJobServer(job, cmd, m_Impl->retry_on_exception);
472 }
473 
475 {
476  if (job.progress_msg.length() >= kNetScheduleMaxDBDataSize) {
477  NCBI_THROW(CNetScheduleException, eDataTooLong,
478  "Progress message too long");
479  }
480  string cmd("MPUT " + job.job_id);
481  cmd += " \"";
483  cmd += '\"';
485  m_Impl->m_API->ExecOnJobServer(job, cmd, m_Impl->retry_on_exception);
486 }
487 
489 {
490  m_Impl->m_API.GetProgressMsg(job);
491 }
492 
494  bool no_retries)
495 {
497  m_Impl->m_API->GetServerParams().max_output_size);
498 
499  if (job.error_msg.length() >= kNetScheduleMaxDBErrSize) {
500  NCBI_THROW(CNetScheduleException, eDataTooLong,
501  "Error message too long");
502  }
503 
504  string cmd("FPUT2 job_key=" + job.job_id);
505 
506  limits::Check<limits::SAuthToken>(job.auth_token);
507  cmd.append(" auth_token=");
508  cmd.append(job.auth_token);
509 
510  cmd.append(" err_msg=\"");
511  cmd.append(NStr::PrintableString(job.error_msg));
512 
513  cmd.append("\" output=\"");
514  cmd.append(NStr::PrintableString(job.output));
515 
516  cmd.append("\" job_return_code=");
517  cmd.append(NStr::NumericToString(job.ret_code));
518 
520 
521  if (no_retries)
522  cmd.append(" no_retries=1");
523 
524  m_Impl->m_API->ExecOnJobServer(job, cmd, m_Impl->retry_on_exception);
525 }
526 
528 {
529  string cmd("RESCHEDULE job_key=" + job.job_id);
530 
531  limits::Check<limits::SAuthToken>(job.auth_token);
532  cmd += " auth_token=";
533  cmd += job.auth_token;
534 
535  if (!job.affinity.empty()) {
536  cmd += " aff=\"";
537  limits::Check<limits::SAffinity>(job.affinity);
539  cmd += '"';
540  }
541 
542  if (!job.group.empty()) {
543  cmd += " group=\"";
544  limits::Check<limits::SJobGroup>(job.group);
546  cmd += '"';
547  }
548 
550  m_Impl->m_API->ExecOnJobServer(job, cmd, m_Impl->retry_on_exception);
551 }
552 
554  const CNetScheduleJob& job, time_t* job_exptime,
555  ENetScheduleQueuePauseMode* pause_mode)
556 {
557  return m_Impl->m_API->GetJobStatus("WST2", job, job_exptime, pause_mode);
558 }
559 
561  bool blacklist)
562 {
563  string cmd("RETURN2 job_key=" + job.job_id);
564 
565  limits::Check<limits::SAuthToken>(job.auth_token);
566  cmd.append(" auth_token=");
567  cmd.append(job.auth_token);
568 
569  if (!blacklist) {
570  cmd.append(" blacklist=0");
571  }
572 
574  m_API->ExecOnJobServer(job, cmd, retry_on_exception);
575 }
576 
578 {
579  m_Impl->ReturnJob(job);
580 }
581 
583  const vector<string>* affs,
585 {
586  if (affs == NULL || affs->empty())
587  return 0;
588 
589  const char* sep = action == eAddAffs ? " add=\"" : " del=\"";
590 
591  ITERATE(vector<string>, aff, *affs) {
592  cmd.append(sep);
593  limits::Check<limits::SAffinity>(*aff);
594  cmd.append(*aff);
595  sep = ",";
596  }
597  cmd.push_back('"');
598 
599  CFastMutexGuard guard(m_PreferredAffMutex);
600 
601  if (action == eAddAffs)
602  ITERATE(vector<string>, aff, *affs) {
603  if (*aff == "-") {
604  NCBI_THROW(CNetScheduleException, eInvalidParameter,
605  "Affinity '-' cannot be added as a preferred one.");
606  }
607 
608  m_PreferredAffinities.insert(*aff);
609  }
610  else
611  ITERATE(vector<string>, aff, *affs) {
612  m_PreferredAffinities.erase(*aff);
613  }
614 
615  return 1;
616 }
617 
619  const vector<string>* affs_to_add, const vector<string>* affs_to_delete)
620 {
621  string cmd("CHAFF");
622 
623  if (m_Impl->AppendAffinityTokens(cmd, affs_to_add,
625  m_Impl->AppendAffinityTokens(cmd, affs_to_delete,
628 
629  m_Impl->m_API->m_Service.ExecOnAllServers(cmd);
630  }
631 }
632 
634 {
635  return m_Impl->m_API.GetQueueName();
636 }
637 
639 {
640  return m_Impl->m_API->m_Service->GetClientName();
641 }
642 
644 {
645  return m_Impl->m_API->m_Service.GetServiceName();
646 }
647 
649  CNetServerConnection::TInstance conn_impl, const string& /*cmd*/)
650 {
651  switch (m_Executor->m_AffinityPreference) {
655  {
656  CNetServerConnection conn(conn_impl);
657 
658  CFastMutexGuard guard(m_Executor->m_API->m_SharedData->m_AffinitySubmissionMutex);
659  auto& affs_synced = conn->m_Server->Get<SNetScheduleServerProperties>()->affs_synced;
660 
661  if (!affs_synced) {
662  conn.Exec(m_Executor->MkSETAFFCmd(), false);
663  affs_synced = true;
664  }
665  }
666  break;
667 
668  default:
669  // Preferred affinities are not used -- there's no need
670  // to send the SETAFF command to the server.
671  break;
672  }
673 }
674 
CDeadline.
Definition: ncbitime.hpp:1830
virtual bool Consider(CNetServer server)
CGetJobCmdExecutor(const string &get_cmd, CNetScheduleJob &job, SNetScheduleExecutorImpl *executor)
SNetScheduleExecutorImpl * m_Executor
NetSchedule internal exception.
virtual void OnExec(CNetServerConnection::TInstance conn_impl, const string &cmd)
void CmdAppendTimeoutGroupAndClientInfo(string &cmd, const CDeadline *deadline, const string &job_group)
bool CheckRequestJobNotification(CNetScheduleExecutor::TInstance executor, CNetServer *server)
bool RequestJob(CNetScheduleExecutor::TInstance executor, CNetScheduleJob &job, const string &cmd)
static string MkBaseGETCmd(CNetScheduleExecutor::EJobAffinityPreference affinity_preference, const string &affinity_list)
SExecResult ExecWithRetry(const string &cmd, bool multiline_output=false)
Execute remote command 'cmd', wait for the reply, check if it starts with 'OK:', and return the remai...
CNetServiceIterator FindServer(INetServerFinder *finder, EIterationMode mode=eSortByLoad)
CUrlArgs::
Definition: ncbi_url.hpp:240
CUrlParserException –.
Definition: ncbi_url.hpp:539
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
static CS_CONNECTION * conn
Definition: ct_dynamic.c:25
static SQLCHAR output[256]
Definition: print.c:5
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
@ eOn
Definition: ncbi_types.h:111
#define NULL
Definition: ncbistd.hpp:225
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
Definition: ncbidiag.hpp:186
TErrCode GetErrCode(void) const
Get error code.
Definition: ncbiexpt.cpp:453
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
EJobStatus
Job status codes.
string output
Job result data.
CNetScheduleAPI::EJobStatus GetJobStatus(const CNetScheduleJob &job, time_t *job_exptime=NULL, ENetScheduleQueuePauseMode *pause_mode=NULL)
Get the current status of the specified job.
const string & GetQueueName()
Return Queue name.
void ReturnJob(const CNetScheduleJob &job)
Switch the job back to the "Pending" status so that it can be run again on a different worker node.
void ClearNode()
Unregister client-listener.
void PutResult(const CNetScheduleJob &job)
Put job result (job should be received by GetJob() or WaitJob())
CNetScheduleAPI::TJobMask mask
int ret_code
Job return code.
const CNetScheduleAPI::SServerParams & GetServerParams()
Retrieve queue parameters from the server.
string input
Input data.
void SetJobGroup(const string &job_group)
Retrieve jobs from the specified group only.
const string & GetQueueName() const
Return Queue name.
CNetServer server
The server the job belongs to.
void JobDelayExpiration(const CNetScheduleJob &job, unsigned runtime_inc)
Increment job execution timeout.
EJobAffinityPreference
Affinity matching modes.
void SetAffinityPreference(EJobAffinityPreference aff_pref)
Set preferred method of requesting jobs with affinities.
void ChangePreferredAffinities(const vector< string > *affs_to_add, const vector< string > *affs_to_delete)
void PutProgressMsg(const CNetScheduleJob &job)
Put job interim (progress) message.
bool GetJob(CNetScheduleJob &job, const string &affinity_list=kEmptyStr, CDeadline *dealine=NULL)
Get a pending job.
void Reschedule(const CNetScheduleJob &job)
Reschedule a job with new affinity and/or group information.
void GetProgressMsg(CNetScheduleJob &job)
Get progress message.
void PutFailure(const CNetScheduleJob &job, bool no_retries=false)
Submit job failure diagnostics.
string job_id
Output job key.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static string PrintableString(const CTempString str, TPrintableMode mode=fNewLine_Quote|fNonAscii_Passthru)
Get a printable version of the specified string.
Definition: ncbistr.cpp:3944
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
Definition: ncbistr.cpp:3452
static string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)
Convert UInt to string.
Definition: ncbistr.hpp:5103
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
Definition: ncbistr.hpp:673
@ fSplit_Truncate
Definition: ncbistr.hpp:2503
@ fSplit_MergeDelimiters
Merge adjacent delimiters.
Definition: ncbistr.hpp:2500
unsigned short GetPort() const
Get the listening port number back.
CNanoTimeout GetRemainingTime(void) const
Get time left to the expiration.
Definition: ncbitime.cpp:3859
double GetAsDouble(void) const
Get as number of seconds (fractional value).
Definition: ncbitime.cpp:3512
const TArgs & GetArgs(void) const
Get the const list of arguments.
Definition: ncbi_url.hpp:300
list< TArg > TArgs
Definition: ncbi_url.hpp:276
ENetScheduleQueuePauseMode
Defines whether the job queue is paused, and if so, defines the pause mode set by the administrator.
bool s_DoParseGet2JobResponse(CNetScheduleJob &job, const string &response)
string s_GET2(CNetScheduleExecutor::EJobAffinityPreference affinity_preference)
bool s_ParseGetJobResponse(CNetScheduleJob &job, const string &response)
static void s_CheckOutputSize(const string &output, size_t max_output_size)
const unsigned int kNetScheduleMaxDBDataSize
const unsigned int kNetScheduleMaxDBErrSize
void g_AppendClientIPSessionIDHitID(string &cmd)
Job description.
bool GetServerByNode(const string &ns_node, CNetServer *server)
bool ExecGET(SNetServerImpl *server, const string &get_cmd, CNetScheduleJob &job)
int AppendAffinityTokens(string &cmd, const vector< string > *affs, EChangeAffAction action)
void ReturnJob(const CNetScheduleJob &job, bool blacklist=true)
bool x_GetJobWithAffinityLadder(SNetServerImpl *server, const CDeadline &timeout, const string &prio_aff_list, bool any_affinity, CNetScheduleJob &job)
void ClaimNewPreferredAffinity(CNetServer orig_server, const string &affinity)
CRef< TProperties > Get()
CNetServer::SExecResult ConnectAndExec(const string &cmd, bool multiline_output, bool retry_on_exception=false)
Modified on Fri Sep 20 14:57:01 2024 by modify_doxy.py rev. 669887