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

Go to the SVN repository for this file.

1 /* $Id: ns_queue_parameters.cpp 101217 2023-11-16 17:20:46Z satskyse $
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  * Authors: Anatoliy Kuznetsov, Victor Joukov
27  *
28  * File Description: Queue parameters
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
35 
36 #include "ns_queue_parameters.hpp"
37 #include "ns_types.hpp"
38 #include "ns_queue.hpp"
39 #include "ns_ini_params.hpp"
40 
41 
42 
44 
45 
47  kind(CQueue::eKindStatic),
48  delete_request(false),
49  qclass(""),
50  timeout(default_timeout),
51  notif_hifreq_interval(default_notif_hifreq_interval),
52  notif_hifreq_period(default_notif_hifreq_period),
53  notif_lofreq_mult(default_notif_lofreq_mult),
54  notif_handicap(default_notif_handicap),
55  dump_buffer_size(default_dump_buffer_size),
56  dump_client_buffer_size(default_dump_client_buffer_size),
57  dump_aff_buffer_size(default_dump_aff_buffer_size),
58  dump_group_buffer_size(default_dump_group_buffer_size),
59  run_timeout(default_run_timeout),
60  read_timeout(default_read_timeout),
61  program_name(""),
62  failed_retries(default_failed_retries),
63  read_failed_retries(default_failed_retries), // See CXX-5161, the same
64  // default as for
65  // failed_retries
66  max_jobs_per_client(default_max_jobs_per_client),
67  blacklist_time(default_blacklist_time),
68  read_blacklist_time(default_blacklist_time), // See CXX-4993, the same
69  // default as for
70  // blacklist_time
71  max_input_size(kNetScheduleMaxDBDataSize),
72  max_output_size(kNetScheduleMaxDBDataSize),
73  subm_hosts(""),
74  wnode_hosts(""),
75  reader_hosts(""),
76  wnode_timeout(default_wnode_timeout),
77  reader_timeout(default_reader_timeout),
78  pending_timeout(default_pending_timeout),
79  max_pending_wait_timeout(default_max_pending_wait_timeout),
80  max_pending_read_wait_timeout(default_max_pending_read_wait_timeout),
81  description(""),
82  scramble_job_keys(default_scramble_job_keys),
83  client_registry_timeout_worker_node(
85  client_registry_min_worker_nodes(default_client_registry_min_worker_nodes),
86  client_registry_timeout_admin(default_client_registry_timeout_admin),
87  client_registry_min_admins(default_client_registry_min_admins),
88  client_registry_timeout_submitter(
90  client_registry_min_submitters(default_client_registry_min_submitters),
91  client_registry_timeout_reader(default_client_registry_timeout_reader),
92  client_registry_min_readers(default_client_registry_min_readers),
93  client_registry_timeout_unknown(default_client_registry_timeout_unknown),
94  client_registry_min_unknowns(default_client_registry_min_unknowns)
95 {}
96 
97 
98 
100  const string & sname,
101  vector<string> & warnings)
102 {
103  qclass = ""; // No class name for the queue class
104 
105  timeout = ReadTimeout(reg, sname, warnings);
106  notif_hifreq_interval = ReadNotifHifreqInterval(reg, sname, warnings);
107  notif_hifreq_period = ReadNotifHifreqPeriod(reg, sname, warnings);
108  notif_lofreq_mult = ReadNotifLofreqMult(reg, sname, warnings);
109  notif_handicap = ReadNotifHandicap(reg, sname, warnings);
110  dump_buffer_size = ReadDumpBufferSize(reg, sname, warnings);
111  dump_client_buffer_size = ReadDumpClientBufferSize(reg, sname, warnings);
112  dump_aff_buffer_size = ReadDumpAffBufferSize(reg, sname, warnings);
113  dump_group_buffer_size = ReadDumpGroupBufferSize(reg, sname, warnings);
114  run_timeout = ReadRunTimeout(reg, sname, warnings);
115  read_timeout = ReadReadTimeout(reg, sname, warnings);
116  program_name = ReadProgram(reg, sname, warnings);
117  failed_retries = ReadFailedRetries(reg, sname, warnings);
118  read_failed_retries = ReadReadFailedRetries(reg, sname, warnings,
120  max_jobs_per_client = ReadMaxJobsPerClient(reg, sname, warnings);
121  blacklist_time = ReadBlacklistTime(reg, sname, warnings);
122  read_blacklist_time = ReadReadBlacklistTime(reg, sname, warnings,
124  max_input_size = ReadMaxInputSize(reg, sname, warnings);
125  max_output_size = ReadMaxOutputSize(reg, sname, warnings);
126  subm_hosts = ReadSubmHosts(reg, sname, warnings);
127  wnode_hosts = ReadWnodeHosts(reg, sname, warnings);
128  reader_hosts = ReadReaderHosts(reg, sname, warnings);
129  wnode_timeout = ReadWnodeTimeout(reg, sname, warnings);
130  reader_timeout = ReadReaderTimeout(reg, sname, warnings);
131  pending_timeout = ReadPendingTimeout(reg, sname, warnings);
132  max_pending_wait_timeout = ReadMaxPendingWaitTimeout(reg, sname, warnings);
134  warnings);
135  description = ReadDescription(reg, sname, warnings);
136  scramble_job_keys = ReadScrambleJobKeys(reg, sname, warnings);
138  reg, sname, warnings);
140  reg, sname, warnings);
142  warnings);
144  warnings);
146  reg, sname, warnings);
148  warnings);
150  warnings);
152  warnings);
154  reg, sname, warnings);
156  warnings);
157 
158  bool linked_sections_ok;
159  linked_sections = ReadLinkedSections(reg, sname, warnings,
160  &linked_sections_ok);
161  return linked_sections_ok;
162 }
163 
164 
165 bool SQueueParameters::ReadQueue(const IRegistry & reg, const string & sname,
166  const TQueueParams & queue_classes,
167  vector<string> & warnings)
168 {
169  string queue_class = ReadClass(reg, sname, warnings);
170  if (queue_class.empty()) {
171  // There is no class so it exactly matches a queue class
172  return ReadQueueClass(reg, sname, warnings);
173  }
174 
175  // This queue derives from a class
176  TQueueParams::const_iterator found = queue_classes.find(queue_class);
177  if (found == queue_classes.end()) {
178  warnings.push_back(g_WarnPrefix +
179  NS_RegValName(sname, "class") +
180  ". It refers to un unknown queue class");
181  // Read the queue as if there were no queue class
182  return ReadQueueClass(reg, sname, warnings);
183  }
184 
185  // Here: the queue class is here and the queue needs to derive everything
186  // from the queue class
187  *this = found->second;
188  // The class name has been reset in the assignment above
189  qclass = queue_class;
190 
191  // Override the class with what found in the section
192  list<string> values;
193  reg.EnumerateEntries(sname, &values);
194 
195  // Avoid to have double warnings if so
196  unsigned int failed_retries_preread = ReadFailedRetries(reg, sname,
197  warnings);
198  CNSPreciseTime blacklist_time_preread = ReadBlacklistTime(reg, sname,
199  warnings);
200 
201  for (list<string>::const_iterator val = values.begin();
202  val != values.end(); ++val) {
203  if (*val == "timeout")
204  timeout = ReadTimeout(reg, sname, warnings);
205  else if (*val == "notif_hifreq_interval")
207  ReadNotifHifreqInterval(reg, sname, warnings);
208  else if (*val == "notif_hifreq_period")
209  notif_hifreq_period = ReadNotifHifreqPeriod(reg, sname, warnings);
210  else if (*val == "notif_lofreq_mult")
211  notif_lofreq_mult = ReadNotifLofreqMult(reg, sname, warnings);
212  else if (*val == "notif_handicap")
213  notif_handicap = ReadNotifHandicap(reg, sname, warnings);
214  else if (*val == "dump_buffer_size")
215  dump_buffer_size = ReadDumpBufferSize(reg, sname, warnings);
216  else if (*val == "dump_client_buffer_size")
218  ReadDumpClientBufferSize(reg, sname, warnings);
219  else if (*val == "dump_aff_buffer_size")
220  dump_aff_buffer_size = ReadDumpAffBufferSize(reg, sname, warnings);
221  else if (*val == "dump_group_buffer_size")
223  ReadDumpGroupBufferSize(reg, sname, warnings);
224  else if (*val == "run_timeout")
225  run_timeout = ReadRunTimeout(reg, sname, warnings);
226  else if (*val == "read_timeout")
227  read_timeout = ReadReadTimeout(reg, sname, warnings);
228  else if (*val == "program")
229  program_name = ReadProgram(reg, sname, warnings);
230  else if (*val == "failed_retries")
231  failed_retries = failed_retries_preread;
232  else if (*val == "read_failed_retries")
233  // See CXX-5161, the read_failed_retries depends on failed_retries
235  ReadReadFailedRetries(reg, sname, warnings,
236  failed_retries_preread);
237  else if (*val == "max_jobs_per_client")
238  max_jobs_per_client = ReadMaxJobsPerClient(reg, sname, warnings);
239  else if (*val == "blacklist_time")
240  blacklist_time = blacklist_time_preread;
241  else if (*val == "read_blacklist_time")
242  // See CXX-4993, the read_blacklist_time depends on blacklist_time
244  ReadReadBlacklistTime(reg, sname, warnings,
245  blacklist_time_preread);
246  else if (*val == "max_input_size")
247  max_input_size = ReadMaxInputSize(reg, sname, warnings);
248  else if (*val == "max_output_size")
249  max_output_size = ReadMaxOutputSize(reg, sname, warnings);
250  else if (*val == "subm_host")
251  subm_hosts = ReadSubmHosts(reg, sname, warnings);
252  else if (*val == "wnode_host")
253  wnode_hosts = ReadWnodeHosts(reg, sname, warnings);
254  else if (*val == "reader_host")
255  reader_hosts = ReadReaderHosts(reg, sname, warnings);
256  else if (*val == "wnode_timeout")
257  wnode_timeout = ReadWnodeTimeout(reg, sname, warnings);
258  else if (*val == "reader_timeout")
259  reader_timeout = ReadReaderTimeout(reg, sname, warnings);
260  else if (*val == "pending_timeout")
261  pending_timeout = ReadPendingTimeout(reg, sname, warnings);
262  else if (*val == "max_pending_wait_timeout")
264  ReadMaxPendingWaitTimeout(reg, sname, warnings);
265  else if (*val == "max_pending_read_wait_timeout")
267  ReadMaxPendingReadWaitTimeout(reg, sname, warnings);
268  else if (*val == "description")
269  description = ReadDescription(reg, sname, warnings);
270  else if (*val == "scramble_job_keys")
271  scramble_job_keys = ReadScrambleJobKeys(reg, sname, warnings);
272  else if (*val == "client_registry_timeout_worker_node")
274  ReadClientRegistryTimeoutWorkerNode(reg, sname, warnings);
275  else if (*val == "client_registry_min_worker_nodes")
277  ReadClientRegistryMinWorkerNodes(reg, sname, warnings);
278  else if (*val == "client_registry_timeout_admin")
280  ReadClientRegistryTimeoutAdmin(reg, sname, warnings);
281  else if (*val == "client_registry_min_admins")
283  ReadClientRegistryMinAdmins(reg, sname, warnings);
284  else if (*val == "client_registry_timeout_submitter")
286  ReadClientRegistryTimeoutSubmitter(reg, sname, warnings);
287  else if (*val == "client_registry_min_submitters")
289  ReadClientRegistryMinSubmitters(reg, sname, warnings);
290  else if (*val == "client_registry_timeout_reader")
292  ReadClientRegistryTimeoutReader(reg, sname, warnings);
293  else if (*val == "client_registry_min_readers")
295  ReadClientRegistryMinReaders(reg, sname, warnings);
296  else if (*val == "client_registry_timeout_unknown")
298  ReadClientRegistryTimeoutUnknown(reg, sname, warnings);
299  else if (*val == "client_registry_min_unknowns")
301  ReadClientRegistryMinUnknowns(reg, sname, warnings);
302  }
303 
304  // Apply linked sections if so
305  bool linked_sections_ok;
306  map<string, string> queue_linked_sections =
307  ReadLinkedSections(reg, sname, warnings,
308  &linked_sections_ok);
309  for (map<string, string>::const_iterator k = queue_linked_sections.begin();
310  k != queue_linked_sections.end(); ++k)
311  linked_sections[k->first] = k->second;
312 
313  // After deriving from a queue class there might be some restrictions
314  // broken. Check them here.
316  warnings.push_back(g_WarnPrefix +
317  NS_RegValName(sname,
318  "client_registry_timeout_worker_node")
319  + ". It must be > " +
320  to_string(double(wnode_timeout)));
321  double fixed_timeout =
322  max(
324  double(wnode_timeout + wnode_timeout)),
325  double(run_timeout + run_timeout));
327  }
328 
330  warnings.push_back(g_WarnPrefix +
331  NS_RegValName(sname,
332  "client_registry_timeout_reader")
333  + ". It must be > " +
334  to_string(double(reader_timeout)));
335  double fixed_timeout =
336  max(
338  double(reader_timeout + reader_timeout)),
339  double(read_timeout + read_timeout));
341  }
342  return linked_sections_ok;
343 }
344 
345 
346 
347 // Returns descriptive diff
348 // Empty dictionary if there is no difference
349 CJsonNode
351  bool include_class_cmp,
352  bool include_description) const
353 {
355 
356  // It does not make sense to compare the qclass field for a queue class
357  if (include_class_cmp && qclass != other.qclass)
358  AddParameterToDiff(diff, "class",
359  qclass, other.qclass);
360 
361  if (timeout.Sec() != other.timeout.Sec())
362  AddParameterToDiff(diff, "timeout",
363  timeout.Sec(), other.timeout.Sec());
364 
367  diff, "notif_hifreq_interval",
370 
373  diff, "notif_hifreq_period",
376 
378  AddParameterToDiff(diff, "notif_lofreq_mult",
380 
381  if (notif_handicap != other.notif_handicap)
383  diff, "notif_handicap",
386 
387  if (dump_buffer_size != other.dump_buffer_size)
388  AddParameterToDiff(diff, "dump_buffer_size",
390 
392  AddParameterToDiff(diff, "dump_client_buffer_size",
395 
397  AddParameterToDiff(diff, "dump_aff_buffer_size",
399 
401  AddParameterToDiff(diff, "dump_group_buffer_size",
403  other.dump_group_buffer_size);
404 
405  if (run_timeout != other.run_timeout)
407  diff, "run_timeout",
410 
411  if (read_timeout != other.read_timeout)
413  diff, "read_timeout",
416 
417  if (program_name != other.program_name)
418  AddParameterToDiff(diff, "program",
419  program_name, other.program_name);
420 
421  if (failed_retries != other.failed_retries)
422  AddParameterToDiff(diff, "failed_retries",
424 
426  AddParameterToDiff(diff, "read_failed_retries",
428 
430  AddParameterToDiff(diff, "max_jobs_per_client",
432 
433  if (blacklist_time != other.blacklist_time)
435  diff, "blacklist_time",
438 
441  diff, "read_blacklist_time",
444 
445  if (max_input_size != other.max_input_size)
446  AddParameterToDiff(diff, "max_input_size",
448 
449  if (max_output_size != other.max_output_size)
450  AddParameterToDiff(diff, "max_output_size",
452 
453  if (subm_hosts != other.subm_hosts)
454  AddParameterToDiff(diff, "subm_host",
455  subm_hosts, other.subm_hosts);
456 
457  if (wnode_hosts != other.wnode_hosts)
458  AddParameterToDiff(diff, "wnode_host",
459  wnode_hosts, other.wnode_hosts);
460 
461  if (reader_hosts != other.reader_hosts)
462  AddParameterToDiff(diff, "reader_host",
463  reader_hosts, other.reader_hosts);
464 
465  if (wnode_timeout != other.wnode_timeout)
467  diff, "wnode_timeout",
470 
471  if (reader_timeout != other.reader_timeout)
473  diff, "reader_timeout",
476 
477  if (pending_timeout != other.pending_timeout)
479  diff, "pending_timeout",
482 
485  diff, "max_pending_wait_timeout",
488 
491  diff, "max_pending_read_wait_timeout",
494 
496  AddParameterToDiff(diff, "scramble_job_keys",
498 
499 
502  AddParameterToDiff(diff, "client_registry_timeout_worker_node",
507 
510  AddParameterToDiff(diff, "client_registry_min_worker_nodes",
513 
516  AddParameterToDiff(diff, "client_registry_timeout_admin",
521 
524  AddParameterToDiff(diff, "client_registry_min_admins",
527 
531  diff, "client_registry_timeout_submitter",
536 
539  AddParameterToDiff(diff, "client_registry_min_submitters",
542 
546  diff, "client_registry_timeout_reader",
551 
554  AddParameterToDiff(diff, "client_registry_min_readers",
557 
561  diff, "client_registry_timeout_unknown",
566 
569  AddParameterToDiff(diff, "client_registry_min_unknowns",
572 
573  if (include_description && description != other.description)
574  AddParameterToDiff(diff, "description",
575  description, other.description);
576 
577  if (linked_sections != other.linked_sections) {
578  list<string> added;
579  list<string> deleted;
580  list<string> changed;
581 
583  k != linked_sections.end(); ++k) {
584  string old_section = k->first;
585  map<string, string>::const_iterator found = other.linked_sections.find(old_section);
586 
587  if (found == other.linked_sections.end()) {
588  deleted.push_back(old_section);
589  continue;
590  }
591  if (k->second != found->second)
592  changed.push_back(old_section);
593  }
594 
596  k != other.linked_sections.end(); ++k) {
597  string new_section = k->first;
598 
599  if (linked_sections.find(new_section) == linked_sections.end())
600  added.push_back(new_section);
601  }
602 
603  if (!added.empty()) {
604  CJsonNode added_sections = CJsonNode::NewArrayNode();
605  for (list<string>::const_iterator k = added.begin();
606  k != added.end(); ++k)
607  added_sections.AppendString(NStr::PrintableString(*k));
608  diff.SetByKey("linked_section_added", added_sections);
609  }
610 
611  if (!deleted.empty()) {
612  CJsonNode deleted_sections = CJsonNode::NewArrayNode();
613  for (list<string>::const_iterator k = deleted.begin();
614  k != deleted.end(); ++k)
615  deleted_sections.AppendString(NStr::PrintableString(*k));
616  diff.SetByKey("linked_section_deleted", deleted_sections);
617  }
618 
619  if (!changed.empty()) {
620  CJsonNode changed_sections = CJsonNode::NewArrayNode();
621  for (list<string>::const_iterator k = changed.begin();
622  k != changed.end(); ++k) {
623  CJsonNode section_changes = CJsonNode::NewObjectNode();
625 
626  map<string,
627  string>::const_iterator val_iter;
628  string changed_section_name = *k;
629 
630  val_iter = linked_sections.find(changed_section_name);
631  string old_value = val_iter->second;
632  val_iter = other.linked_sections.find(changed_section_name);
633  string new_value = val_iter->second;
634 
635  values.AppendString(old_value);
636  values.AppendString(new_value);
637  section_changes.SetByKey(changed_section_name, values);
638  changed_sections.Append(section_changes);
639  }
640 
641  diff.SetByKey("linked_section_changed", changed_sections);
642  }
643  }
644 
645  return diff;
646 }
647 
648 
649 // Classes are included for queues only (not for queue classes)
650 string
652  bool url_encoded) const
653 {
654  string result;
655  result.reserve(4096);
656 
657  /* Initialized for multi-line output */
658  string prefix("OK:");
659  string suffix(": ");
660  string separator("\n");
661 
662  if (url_encoded) {
663  prefix = "";
664  suffix = "=";
665  separator = "&";
666  }
667 
668  if (include_class) {
669  // These parameters make sense for queues only
670  result.append(prefix)
671  .append("kind")
672  .append(suffix);
673  if (kind == CQueue::eKindStatic)
674  result.append("static");
675  else
676  result.append("dynamic");
677  result.append(separator);
678 
679  result.append(prefix).append("qclass").append(suffix).append(qclass).append(separator)
680  .append(prefix).append("refuse_submits").append(suffix).append(NStr::BoolToString(refuse_submits)).append(separator)
681  .append(prefix).append("max_aff_slots").append(suffix).append(to_string(max_aff_slots)).append(separator)
682  .append(prefix).append("aff_slots_used").append(suffix).append(to_string(aff_slots_used)).append(separator)
683  .append(prefix).append("max_group_slots").append(suffix).append(to_string(max_group_slots)).append(separator)
684  .append(prefix).append("group_slots_used").append(suffix).append(to_string(group_slots_used)).append(separator)
685  .append(prefix).append("max_scope_slots").append(suffix).append(to_string(max_scope_slots)).append(separator)
686  .append(prefix).append("scope_slots_used").append(suffix).append(to_string(scope_slots_used)).append(separator)
687  .append(prefix).append("clients").append(suffix).append(to_string(clients)).append(separator)
688  .append(prefix).append("groups").append(suffix).append(to_string(groups)).append(separator)
689  .append(prefix).append("gc_backlog").append(suffix).append(to_string(gc_backlog)).append(separator)
690  .append(prefix).append("notif_count").append(suffix).append(to_string(notif_count)).append(separator);
691 
692  result.append(prefix).append("pause").append(suffix);
694  result.append("pullback");
696  result.append("nopullback");
697  else
698  result.append("nopause");
699  result.append(separator);
700  }
701 
702  result.append(prefix).append("delete_request").append(suffix).append(NStr::BoolToString(delete_request)).append(separator)
703  .append(prefix).append("timeout").append(suffix).append(to_string(timeout.Sec())).append(separator)
704  .append(prefix).append("notif_hifreq_interval").append(suffix).append(NS_FormatPreciseTimeAsSec(notif_hifreq_interval)).append(separator)
705  .append(prefix).append("notif_hifreq_period").append(suffix).append(NS_FormatPreciseTimeAsSec(notif_hifreq_period)).append(separator)
706  .append(prefix).append("notif_lofreq_mult").append(suffix).append(to_string(notif_lofreq_mult)).append(separator)
707  .append(prefix).append("notif_handicap").append(suffix).append(NS_FormatPreciseTimeAsSec(notif_handicap)).append(separator)
708  .append(prefix).append("dump_buffer_size").append(suffix).append(to_string(dump_buffer_size)).append(separator)
709  .append(prefix).append("dump_client_buffer_size").append(suffix).append(to_string(dump_client_buffer_size)).append(separator)
710  .append(prefix).append("dump_aff_buffer_size").append(suffix).append(to_string(dump_aff_buffer_size)).append(separator)
711  .append(prefix).append("dump_group_buffer_size").append(suffix).append(to_string(dump_group_buffer_size)).append(separator)
712  .append(prefix).append("run_timeout").append(suffix).append(NS_FormatPreciseTimeAsSec(run_timeout)).append(separator)
713  .append(prefix).append("read_timeout").append(suffix).append(NS_FormatPreciseTimeAsSec(read_timeout)).append(separator)
714  .append(prefix).append("failed_retries").append(suffix).append(to_string(failed_retries)).append(separator)
715  .append(prefix).append("read_failed_retries").append(suffix).append(to_string(read_failed_retries)).append(separator)
716  .append(prefix).append("max_jobs_per_client").append(suffix).append(to_string(max_jobs_per_client)).append(separator)
717  .append(prefix).append("blacklist_time").append(suffix).append(NS_FormatPreciseTimeAsSec(blacklist_time)).append(separator)
718  .append(prefix).append("read_blacklist_time").append(suffix).append(NS_FormatPreciseTimeAsSec(read_blacklist_time)).append(separator)
719  .append(prefix).append("max_input_size").append(suffix).append(to_string(max_input_size)).append(separator)
720  .append(prefix).append("max_output_size").append(suffix).append(to_string(max_output_size)).append(separator)
721  .append(prefix).append("wnode_timeout").append(suffix).append(NS_FormatPreciseTimeAsSec(wnode_timeout)).append(separator)
722  .append(prefix).append("reader_timeout").append(suffix).append(NS_FormatPreciseTimeAsSec(reader_timeout)).append(separator)
723  .append(prefix).append("pending_timeout").append(suffix).append(NS_FormatPreciseTimeAsSec(pending_timeout)).append(separator)
724  .append(prefix).append("max_pending_wait_timeout").append(suffix).append(NS_FormatPreciseTimeAsSec(max_pending_wait_timeout)).append(separator)
725  .append(prefix).append("max_pending_read_wait_timeout").append(suffix).append(NS_FormatPreciseTimeAsSec(max_pending_read_wait_timeout)).append(separator)
726  .append(prefix).append("scramble_job_keys").append(suffix).append(NStr::BoolToString(scramble_job_keys)).append(separator)
727  .append(prefix).append("client_registry_timeout_worker_node").append(suffix).append(NS_FormatPreciseTimeAsSec(client_registry_timeout_worker_node)).append(separator)
728  .append(prefix).append("client_registry_min_worker_nodes").append(suffix).append(to_string(client_registry_min_worker_nodes)).append(separator)
729  .append(prefix).append("client_registry_timeout_admin").append(suffix).append(NS_FormatPreciseTimeAsSec(client_registry_timeout_admin)).append(separator)
730  .append(prefix).append("client_registry_min_admins").append(suffix).append(to_string(client_registry_min_admins)).append(separator)
731  .append(prefix).append("client_registry_timeout_submitter").append(suffix).append(NS_FormatPreciseTimeAsSec(client_registry_timeout_submitter)).append(separator)
732  .append(prefix).append("client_registry_min_submitters").append(suffix).append(to_string(client_registry_min_submitters)).append(separator)
733  .append(prefix).append("client_registry_timeout_reader").append(suffix).append(NS_FormatPreciseTimeAsSec(client_registry_timeout_reader)).append(separator)
734  .append(prefix).append("client_registry_min_readers").append(suffix).append(to_string(client_registry_min_readers)).append(separator)
735  .append(prefix).append("client_registry_timeout_unknown").append(suffix).append(NS_FormatPreciseTimeAsSec(client_registry_timeout_unknown)).append(separator)
736  .append(prefix).append("client_registry_min_unknowns").append(suffix).append(to_string(client_registry_min_unknowns)).append(separator);
737 
738  if (url_encoded) {
739  result.append(prefix).append("program_name").append(suffix).append(NStr::URLEncode(program_name)).append(separator)
740  .append(prefix).append("subm_hosts").append(suffix).append(NStr::URLEncode(subm_hosts)).append(separator)
741  .append(prefix).append("wnode_hosts").append(suffix).append(NStr::URLEncode(wnode_hosts)).append(separator)
742  .append(prefix).append("reader_hosts").append(suffix).append(NStr::URLEncode(reader_hosts)).append(separator)
743  .append(prefix).append("description").append(suffix).append(NStr::URLEncode(description));
744  for (const auto & linked_section : linked_sections)
745  result.append(separator)
746  .append(prefix)
747  .append(linked_section.first)
748  .append(suffix)
749  .append(NStr::URLEncode(linked_section.second));
750  } else {
751  result.append(prefix).append("program_name").append(suffix).append(NStr::PrintableString(program_name)).append(separator)
752  .append(prefix).append("subm_hosts").append(suffix).append(NStr::PrintableString(subm_hosts)).append(separator)
753  .append(prefix).append("wnode_hosts").append(suffix).append(NStr::PrintableString(wnode_hosts)).append(separator)
754  .append(prefix).append("reader_hosts").append(suffix).append(NStr::PrintableString(reader_hosts)).append(separator)
755  .append(prefix).append("description").append(suffix).append(NStr::PrintableString(description));
756  for (const auto & linked_section : linked_sections)
757  result.append(separator)
758  .append(prefix)
759  .append(linked_section.first)
760  .append(suffix)
761  .append(NStr::PrintableString(linked_section.second));
762  }
763 
764  return result;
765 }
766 
767 
768 string SQueueParameters::ConfigSection(bool is_class) const
769 {
770  string result = "description=\"" + description + "\"\n";
771 
772  if (!is_class)
773  result += "class=\"" + qclass + "\"\n";
774 
775  result +=
776  "timeout=\"" + to_string(timeout.Sec()) + "\"\n"
777  "notif_hifreq_interval=\"" + NS_FormatPreciseTimeAsSec(notif_hifreq_interval) + "\"\n"
778  "notif_hifreq_period=\"" + NS_FormatPreciseTimeAsSec(notif_hifreq_period) + "\"\n"
779  "notif_lofreq_mult=\"" + to_string(notif_lofreq_mult) + "\"\n"
780  "notif_handicap=\"" + NS_FormatPreciseTimeAsSec(notif_handicap) + "\"\n"
781  "dump_buffer_size=\"" + to_string(dump_buffer_size) + "\"\n"
782  "dump_client_buffer_size=\"" + to_string(dump_client_buffer_size) + "\"\n"
783  "dump_aff_buffer_size=\"" + to_string(dump_aff_buffer_size) + "\"\n"
784  "dump_group_buffer_size=\"" + to_string(dump_group_buffer_size) + "\"\n"
785  "run_timeout=\"" + NS_FormatPreciseTimeAsSec(run_timeout) + "\"\n"
786  "read_timeout=\"" + NS_FormatPreciseTimeAsSec(read_timeout) + "\"\n"
787  "program=\"" + program_name + "\"\n"
788  "failed_retries=\"" + to_string(failed_retries) + "\"\n"
789  "read_failed_retries=\"" + to_string(read_failed_retries) + "\"\n"
790  "max_jobs_per_client=\"" + to_string(max_jobs_per_client) + "\"\n"
791  "blacklist_time=\"" + NS_FormatPreciseTimeAsSec(blacklist_time) + "\"\n"
792  "read_blacklist_time=\"" + NS_FormatPreciseTimeAsSec(read_blacklist_time) + "\"\n"
793  "max_input_size=\"" + to_string(max_input_size) + "\"\n"
794  "max_output_size=\"" + to_string(max_output_size) + "\"\n"
795  "subm_host=\"" + subm_hosts + "\"\n"
796  "wnode_host=\"" + wnode_hosts + "\"\n"
797  "reader_host=\"" + reader_hosts + "\"\n"
798  "wnode_timeout=\"" + NS_FormatPreciseTimeAsSec(wnode_timeout) + "\"\n"
799  "reader_timeout=\"" + NS_FormatPreciseTimeAsSec(reader_timeout) + "\"\n"
800  "pending_timeout=\"" + NS_FormatPreciseTimeAsSec(pending_timeout) + "\"\n"
801  "max_pending_wait_timeout=\"" + NS_FormatPreciseTimeAsSec(max_pending_wait_timeout) + "\"\n"
802  "max_pending_read_wait_timeout=\"" + NS_FormatPreciseTimeAsSec(max_pending_read_wait_timeout) + "\"\n"
803  "scramble_job_keys=\"" + NStr::BoolToString(scramble_job_keys) + "\"\n"
804  "client_registry_timeout_worker_node=\"" + NS_FormatPreciseTimeAsSec(client_registry_timeout_worker_node) + "\"\n"
805  "client_registry_min_worker_nodes=\"" + to_string(client_registry_min_worker_nodes) + "\"\n"
806  "client_registry_timeout_admin=\"" + NS_FormatPreciseTimeAsSec(client_registry_timeout_admin) + "\"\n"
807  "client_registry_min_admins=\"" + to_string(client_registry_min_admins) + "\"\n"
808  "client_registry_timeout_submitter=\"" + NS_FormatPreciseTimeAsSec(client_registry_timeout_submitter) + "\"\n"
809  "client_registry_min_submitters=\"" + to_string(client_registry_min_submitters) + "\"\n"
810  "client_registry_timeout_reader=\"" + NS_FormatPreciseTimeAsSec(client_registry_timeout_reader) + "\"\n"
811  "client_registry_min_readers=\"" + to_string(client_registry_min_readers) + "\"\n"
812  "client_registry_timeout_unknown=\"" + NS_FormatPreciseTimeAsSec(client_registry_timeout_unknown) + "\"\n"
813  "client_registry_min_unknowns=\"" + to_string(client_registry_min_unknowns) + "\"\n";
814 
816  k != linked_sections.end(); ++k)
817  result += k->first + "=\"" + NStr::PrintableString(k->second) + "\"\n";
818 
819  return result;
820 }
821 
822 
825 {
826  // Min(run_timeout, read_timeout) / 10
827  // but no less that 0.2 seconds
828  CNSPreciseTime min_timeout = run_timeout;
829  if (read_timeout < min_timeout)
830  min_timeout = read_timeout;
831 
832  // Divide by ten
833  min_timeout.tv_sec = min_timeout.tv_sec / 10;
834  min_timeout.tv_nsec = min_timeout.tv_nsec / 10;
835  min_timeout.tv_nsec += (min_timeout.tv_sec % 10) * (kNSecsPerSecond / 10);
836 
837  static CNSPreciseTime limit(0.2);
838  if (min_timeout < limit)
839  return limit;
840  return min_timeout;
841 }
842 
843 
844 string
846  const string & sname,
847  vector<string> & warnings)
848 {
849  bool ok = NS_ValidateString(reg, sname, "class", warnings);
850  if (!ok)
851  return kEmptyStr;
852 
853  return reg.GetString(sname, "class", kEmptyStr);
854 }
855 
856 
859  const string & sname,
860  vector<string> & warnings)
861 {
862  bool ok = NS_ValidateDouble(reg, sname, "timeout", warnings);
863  if (!ok)
864  return default_timeout;
865 
866  double val = reg.GetDouble(sname, "timeout", double(default_timeout));
867  if (val <= 0.0) {
868  warnings.push_back(g_WarnPrefix + NS_RegValName(sname, "timeout") +
869  ". It must be > 0.0");
870  return default_timeout;
871  }
872  return CNSPreciseTime(val);
873 }
874 
877  const string & sname,
878  vector<string> & warnings)
879 {
880  bool ok = NS_ValidateDouble(reg, sname, "notif_hifreq_interval",
881  warnings);
882  if (!ok)
884 
885  double val = reg.GetDouble(sname, "notif_hifreq_interval",
887  val = (int(val * 10)) / 10.0;
888  if (val <= 0.0) {
889  warnings.push_back(g_WarnPrefix +
890  NS_RegValName(sname, "notif_hifreq_interval") +
891  ". It must be > 0.0");
893  }
894  return CNSPreciseTime(val);
895 }
896 
899  const string & sname,
900  vector<string> & warnings)
901 {
902  bool ok = NS_ValidateDouble(reg, sname, "notif_hifreq_period",
903  warnings);
904  if (!ok)
906 
907  double val = reg.GetDouble(sname, "notif_hifreq_period",
909  if (val <= 0.0) {
910  warnings.push_back(g_WarnPrefix +
911  NS_RegValName(sname, "notif_hifreq_period") +
912  ". It must be > 0.0");
914  }
915  return CNSPreciseTime(val);
916 }
917 
918 unsigned int
920  const string & sname,
921  vector<string> & warnings)
922 {
923  bool ok = NS_ValidateInt(reg, sname, "notif_lofreq_mult", warnings);
924  if (!ok)
926 
927  int val = reg.GetInt(sname, "notif_lofreq_mult",
929  if (val <= 0) {
930  warnings.push_back(g_WarnPrefix +
931  NS_RegValName(sname, "notif_lofreq_mult") +
932  ". It must be > 0");
934  }
935  return val;
936 }
937 
940  const string & sname,
941  vector<string> & warnings)
942 {
943  bool ok = NS_ValidateDouble(reg, sname, "notif_handicap", warnings);
944  if (!ok)
945  return default_notif_handicap;
946 
947  double val = reg.GetDouble(sname, "notif_handicap",
948  double(default_notif_handicap));
949  if (val < 0.0) {
950  warnings.push_back(g_WarnPrefix +
951  NS_RegValName(sname, "notif_handicap") +
952  ". It must be >= 0.0");
953  return default_notif_handicap;
954  }
955  return CNSPreciseTime(val);
956 }
957 
958 unsigned int
960  const string & sname,
961  vector<string> & warnings)
962 {
963  bool ok = NS_ValidateInt(reg, sname, "dump_buffer_size", warnings);
964  if (!ok)
966 
967  int val = reg.GetInt(sname, "dump_buffer_size",
969  if (val < int(default_dump_buffer_size)) {
970  warnings.push_back(g_WarnPrefix +
971  NS_RegValName(sname, "dump_buffer_size") +
972  ". It must be not less than " +
973  to_string(default_dump_buffer_size));
974  return default_dump_buffer_size; // Avoid too small buffer
975  }
976 
977  if (val > int(max_dump_buffer_size)) {
978  warnings.push_back(g_WarnPrefix +
979  NS_RegValName(sname, "dump_buffer_size") +
980  ". It must be not larger than " +
981  to_string(max_dump_buffer_size));
982  return max_dump_buffer_size; // Avoid too large buffer
983  }
984  return val;
985 }
986 
987 unsigned int
989  const string & sname,
990  vector<string> & warnings)
991 {
992  bool ok = NS_ValidateInt(reg, sname, "dump_client_buffer_size",
993  warnings);
994  if (!ok)
996 
997  int val = reg.GetInt(sname, "dump_client_buffer_size",
1000  warnings.push_back(g_WarnPrefix +
1001  NS_RegValName(sname, "dump_client_buffer_size") +
1002  ". It must be not less than " +
1003  to_string(default_dump_client_buffer_size));
1004  return default_dump_client_buffer_size; // Avoid too small buffer
1005  }
1006 
1007  if (val > int(max_dump_client_buffer_size)) {
1008  warnings.push_back(g_WarnPrefix +
1009  NS_RegValName(sname, "dump_client_buffer_size") +
1010  ". It must be not larger than " +
1011  to_string(max_dump_client_buffer_size));
1012  return max_dump_client_buffer_size; // Avoid too large buffer
1013  }
1014  return val;
1015 }
1016 
1017 unsigned int
1019  const string & sname,
1020  vector<string> & warnings)
1021 {
1022  bool ok = NS_ValidateInt(reg, sname, "dump_aff_buffer_size", warnings);
1023  if (!ok)
1025 
1026  int val = reg.GetInt(sname, "dump_aff_buffer_size",
1028  if (val < int(default_dump_aff_buffer_size)) {
1029  warnings.push_back(g_WarnPrefix +
1030  NS_RegValName(sname, "dump_aff_buffer_size") +
1031  ". It must be not less than " +
1032  to_string(default_dump_aff_buffer_size));
1033  return default_dump_aff_buffer_size; // Avoid too small buffer
1034  }
1035 
1036  if (val > int(max_dump_aff_buffer_size)) {
1037  warnings.push_back(g_WarnPrefix +
1038  NS_RegValName(sname, "dump_aff_buffer_size") +
1039  ". It must be not larger than " +
1040  to_string(max_dump_aff_buffer_size));
1041  return max_dump_aff_buffer_size; // Avoid too large buffer
1042  }
1043  return val;
1044 }
1045 
1046 unsigned int
1048  const string & sname,
1049  vector<string> & warnings)
1050 {
1051  bool ok = NS_ValidateInt(reg, sname, "dump_group_buffer_size", warnings);
1052  if (!ok)
1054 
1055  int val = reg.GetInt(sname, "dump_group_buffer_size",
1057  if (val < int(default_dump_group_buffer_size)) {
1058  warnings.push_back(g_WarnPrefix +
1059  NS_RegValName(sname, "dump_group_buffer_size") +
1060  ". It must be not less than " +
1061  to_string(default_dump_group_buffer_size));
1062  return default_dump_group_buffer_size; // Avoid too small buffer
1063  }
1064  if (val > int(max_dump_group_buffer_size)) {
1065  warnings.push_back(g_WarnPrefix +
1066  NS_RegValName(sname, "dump_group_buffer_size") +
1067  ". It must be not larger than " +
1068  to_string(max_dump_group_buffer_size));
1069  return max_dump_group_buffer_size; // Avoid too large buffer
1070  }
1071  return val;
1072 }
1073 
1076  const string & sname,
1077  vector<string> & warnings)
1078 {
1079  bool ok = NS_ValidateDouble(reg, sname, "run_timeout", warnings);
1080  if (!ok)
1081  return default_run_timeout;
1082 
1083  double val = reg.GetDouble(sname, "run_timeout",
1084  double(default_run_timeout));
1085  if (val < 0.0) {
1086  warnings.push_back(g_WarnPrefix + NS_RegValName(sname, "run_timeout") +
1087  ". It must be >= 0.0");
1088  return default_run_timeout;
1089  }
1090  return CNSPreciseTime(val);
1091 }
1092 
1093 
1096  const string & sname,
1097  vector<string> & warnings)
1098 {
1099  bool ok = NS_ValidateDouble(reg, sname, "read_timeout", warnings);
1100  if (!ok)
1101  return default_read_timeout;
1102 
1103  double val = reg.GetDouble(sname, "read_timeout",
1104  double(default_read_timeout));
1105  if (val < 0.0) {
1106  warnings.push_back(g_WarnPrefix + NS_RegValName(sname, "read_timeout") +
1107  ". It must be >= 0.0");
1108  return default_read_timeout;
1109  }
1110  return CNSPreciseTime(val);
1111 }
1112 
1113 
1114 string
1116  const string & sname,
1117  vector<string> & warnings)
1118 {
1119  bool ok = NS_ValidateString(reg, sname, "program", warnings);
1120  if (!ok)
1121  return kEmptyStr;
1122 
1123  string val = reg.GetString(sname, "program", kEmptyStr);
1124  if (val.size() > kMaxQueueLimitsSize) {
1125  // See CXX-2617
1126  warnings.push_back(g_WarnPrefix + NS_RegValName(sname, "program") +
1127  ". The value length (" +
1128  to_string(val.size()) + " bytes) "
1129  "exceeds the max allowed length (" +
1130  to_string(kMaxQueueLimitsSize - 1) + " bytes)");
1131  val = "";
1132  }
1133  return val;
1134 }
1135 
1136 unsigned int
1138  const string & sname,
1139  vector<string> & warnings)
1140 {
1141  bool ok = NS_ValidateInt(reg, sname, "failed_retries", warnings);
1142  if (!ok)
1143  return default_failed_retries;
1144 
1145  int val = reg.GetInt(sname, "failed_retries", default_failed_retries);
1146  if (val < 0) {
1147  warnings.push_back(g_WarnPrefix +
1148  NS_RegValName(sname, "failed_retries") +
1149  ". It must be >= 0");
1150  return default_failed_retries;
1151  }
1152  return val;
1153 }
1154 
1155 unsigned int
1157  const string & sname,
1158  vector<string> & warnings,
1159  unsigned int failed_retries)
1160 {
1161  // The default for the read retries is failed_retries
1162  bool ok = NS_ValidateInt(reg, sname, "read_failed_retries", warnings);
1163  if (!ok)
1164  return failed_retries;
1165 
1166  int val = reg.GetInt(sname, "read_failed_retries", failed_retries);
1167  if (val < 0) {
1168  warnings.push_back(g_WarnPrefix +
1169  NS_RegValName(sname, "read_failed_retries") +
1170  ". It must be >= 0");
1171  return failed_retries;
1172  }
1173  return val;
1174 }
1175 
1176 unsigned int
1178  const string & sname,
1179  vector<string> & warnings)
1180 {
1181  bool ok = NS_ValidateInt(reg, sname, "max_jobs_per_client", warnings);
1182  if (!ok)
1184 
1185  int val = reg.GetInt(sname, "max_jobs_per_client",
1187  if (val < 0) {
1188  warnings.push_back(g_WarnPrefix +
1189  NS_RegValName(sname, "max_jobs_per_client") +
1190  ". It must be >= 0");
1192  }
1193  return val;
1194 }
1195 
1198  const string & sname,
1199  vector<string> & warnings)
1200 {
1201  bool ok = NS_ValidateDouble(reg, sname, "blacklist_time", warnings);
1202  if (!ok)
1203  return default_blacklist_time;
1204 
1205  double val = reg.GetDouble(sname, "blacklist_time",
1206  double(default_blacklist_time));
1207  if (val < 0.0) {
1208  warnings.push_back(g_WarnPrefix +
1209  NS_RegValName(sname, "blacklist_time") +
1210  ". It must be >= 0.0");
1211  return default_blacklist_time;
1212  }
1213  return CNSPreciseTime(val);
1214 }
1215 
1218  const string & sname,
1219  vector<string> & warnings,
1220  const CNSPreciseTime & blacklist_time)
1221 {
1222  // The default for the read_blacklist_time is blacklist_time
1223  bool ok = NS_ValidateDouble(reg, sname, "read_blacklist_time", warnings);
1224  if (!ok)
1225  return blacklist_time;
1226 
1227  double val = reg.GetDouble(sname, "read_blacklist_time",
1228  double(blacklist_time));
1229  if (val < 0.0) {
1230  warnings.push_back(g_WarnPrefix +
1231  NS_RegValName(sname, "read_blacklist_time") +
1232  ". It must be >= 0.0");
1233  return blacklist_time;
1234  }
1235  return CNSPreciseTime(val);
1236 }
1237 
1238 unsigned int
1240  const string & sname,
1241  vector<string> & warnings)
1242 {
1243  // default is kNetScheduleMaxDBDataSize, i.e. 2048
1244  bool ok = NS_ValidateString(reg, sname, "max_input_size", warnings);
1245  if (!ok)
1247 
1248  string s = reg.GetString(sname, "max_input_size", kEmptyStr);
1249  if (!s.empty()) {
1250  unsigned int val = kNetScheduleMaxDBDataSize;
1251  try {
1252  val = (unsigned int) NStr::StringToUInt8_DataSize(s);
1253  } catch (const CStringException & ex) {
1254  warnings.push_back(g_WarnPrefix +
1255  NS_RegValName(sname, "max_input_size") +
1256  ". It could not be converted to "
1257  "unsigned integer: " + ex.what());
1259  } catch (...) {
1260  warnings.push_back(g_WarnPrefix +
1261  NS_RegValName(sname, "max_input_size") +
1262  ". It could not be converted to "
1263  "unsigned integer");
1265  }
1266 
1268  warnings.push_back(g_WarnPrefix +
1269  NS_RegValName(sname, "max_input_size") +
1270  ". It must not be larger than " +
1271  to_string(kNetScheduleMaxOverflowSize));
1273  }
1274  return val;
1275  }
1277 }
1278 
1279 unsigned int
1281  const string & sname,
1282  vector<string> & warnings)
1283 {
1284  // default is kNetScheduleMaxDBDataSize, i.e. 2048
1285  bool ok = NS_ValidateString(reg, sname, "max_output_size", warnings);
1286  if (!ok)
1288 
1289  string s = reg.GetString(sname, "max_output_size", kEmptyStr);
1290  if (!s.empty()) {
1291  unsigned int val = kNetScheduleMaxDBDataSize;
1292  try {
1293  val = (unsigned int) NStr::StringToUInt8_DataSize(s);
1294  } catch (const CStringException & ex) {
1295  warnings.push_back(g_WarnPrefix +
1296  NS_RegValName(sname, "max_output_size") +
1297  ". It could not be converted to "
1298  "unsigned integer: " + ex.what());
1300  } catch (...) {
1301  warnings.push_back(g_WarnPrefix +
1302  NS_RegValName(sname, "max_output_size") +
1303  ". It could not be converted to "
1304  "unsigned integer");
1306  }
1307 
1309  warnings.push_back(g_WarnPrefix +
1310  NS_RegValName(sname, "max_output_size") +
1311  ". It must not be larger than " +
1312  to_string(kNetScheduleMaxOverflowSize));
1314  }
1315  return val;
1316  }
1318 }
1319 
1320 string
1322  const string & sname,
1323  vector<string> & warnings)
1324 {
1325  bool ok = NS_ValidateString(reg, sname, "subm_host", warnings);
1326  if (!ok)
1327  return kEmptyStr;
1328 
1329  string val = reg.GetString(sname, "subm_host", kEmptyStr);
1330  if (val.size() > kMaxQueueLimitsSize) {
1331  // See CXX-2617
1332  warnings.push_back(g_WarnPrefix + NS_RegValName(sname, "subm_host") +
1333  ". The value length (" +
1334  to_string(val.size()) + " bytes) "
1335  "exceeds the max allowed length (" +
1336  to_string(kMaxQueueLimitsSize - 1) + " bytes)");
1337  val = "";
1338  }
1339  return val;
1340 }
1341 
1342 string
1344  const string & sname,
1345  vector<string> & warnings)
1346 {
1347  bool ok = NS_ValidateString(reg, sname, "wnode_host", warnings);
1348  if (!ok)
1349  return kEmptyStr;
1350 
1351  string val = reg.GetString(sname, "wnode_host", kEmptyStr);
1352  if (val.size() > kMaxQueueLimitsSize) {
1353  // See CXX-2617
1354  warnings.push_back(g_WarnPrefix + NS_RegValName(sname, "wnode_host") +
1355  ". The value length (" +
1356  to_string(val.size()) + " bytes) "
1357  "exceeds the max allowed length (" +
1358  to_string(kMaxQueueLimitsSize - 1) + " bytes)");
1359  val = "";
1360  }
1361  return val;
1362 }
1363 
1364 string
1366  const string & sname,
1367  vector<string> & warnings)
1368 {
1369  bool ok = NS_ValidateString(reg, sname, "reader_host", warnings);
1370  if (!ok)
1371  return kEmptyStr;
1372 
1373  string val = reg.GetString(sname, "reader_host", kEmptyStr);
1374  if (val.size() > kMaxQueueLimitsSize) {
1375  // See CXX-2617
1376  warnings.push_back(g_WarnPrefix + NS_RegValName(sname, "reader_host") +
1377  ". The value length (" +
1378  to_string(val.size()) + " bytes) "
1379  "exceeds the max allowed length (" +
1380  to_string(kMaxQueueLimitsSize - 1) + " bytes)");
1381  val = "";
1382  }
1383  return val;
1384 }
1385 
1388  const string & sname,
1389  vector<string> & warnings)
1390 {
1391  bool ok = NS_ValidateDouble(reg, sname, "wnode_timeout", warnings);
1392  if (!ok)
1393  return default_wnode_timeout;
1394 
1395  double val = reg.GetDouble(sname, "wnode_timeout",
1396  double(default_wnode_timeout));
1397  if (val <= 0.0) {
1398  warnings.push_back(g_WarnPrefix +
1399  NS_RegValName(sname, "wnode_timeout") +
1400  ". It must be > 0.0");
1401  return default_wnode_timeout;
1402  }
1403  return CNSPreciseTime(val);
1404 }
1405 
1408  const string & sname,
1409  vector<string> & warnings)
1410 {
1411  bool ok = NS_ValidateDouble(reg, sname, "reader_timeout", warnings);
1412  if (!ok)
1413  return default_reader_timeout;
1414 
1415  double val = reg.GetDouble(sname, "reader_timeout",
1416  double(default_reader_timeout));
1417  if (val <= 0.0) {
1418  warnings.push_back(g_WarnPrefix +
1419  NS_RegValName(sname, "reader_timeout") +
1420  ". It must be > 0.0");
1421  return default_reader_timeout;
1422  }
1423  return CNSPreciseTime(val);
1424 }
1425 
1428  const string & sname,
1429  vector<string> & warnings)
1430 {
1431  bool ok = NS_ValidateDouble(reg, sname, "pending_timeout", warnings);
1432  if (!ok)
1433  return default_pending_timeout;
1434 
1435  double val = reg.GetDouble(sname, "pending_timeout",
1436  double(default_pending_timeout));
1437  if (val <= 0.0) {
1438  warnings.push_back(g_WarnPrefix +
1439  NS_RegValName(sname, "pending_timeout") +
1440  ". It must be > 0.0");
1441  return default_pending_timeout;
1442  }
1443  return CNSPreciseTime(val);
1444 }
1445 
1448  const string & sname,
1449  vector<string> & warnings)
1450 {
1451  bool ok = NS_ValidateDouble(reg, sname, "max_pending_wait_timeout",
1452  warnings);
1453  if (!ok)
1455 
1456  double val = reg.GetDouble(sname, "max_pending_wait_timeout",
1458  if (val < 0.0) {
1459  warnings.push_back(g_WarnPrefix +
1460  NS_RegValName(sname, "max_pending_wait_timeout") +
1461  ". It must be >= 0.0");
1463  }
1464  return CNSPreciseTime(val);
1465 }
1466 
1469  const string & sname,
1470  vector<string> & warnings)
1471 {
1472  bool ok = NS_ValidateDouble(reg, sname, "max_pending_read_wait_timeout",
1473  warnings);
1474  if (!ok)
1476 
1477  double val = reg.GetDouble(sname, "max_pending_read_wait_timeout",
1479  if (val < 0.0) {
1480  warnings.push_back(g_WarnPrefix +
1481  NS_RegValName(sname, "max_pending_read_wait_timeout")
1482  + ". It must be >= 0.0");
1484  }
1485  return CNSPreciseTime(val);
1486 }
1487 
1488 string
1490  const string & sname,
1491  vector<string> & warnings)
1492 {
1493  bool ok = NS_ValidateString(reg, sname, "description", warnings);
1494  if (!ok)
1495  return kEmptyStr;
1496 
1497  string descr = reg.GetString(sname, "description", kEmptyStr);
1498  if (descr.size() > kMaxDescriptionSize - 1) {
1499  warnings.push_back(g_WarnPrefix + NS_RegValName(sname, "description") +
1500  ". The value length (" +
1501  to_string(descr.size()) + " bytes) "
1502  "exceeds the max allowed length (" +
1503  to_string(kMaxDescriptionSize - 1) + " bytes)");
1504  descr = descr.substr(0, kMaxDescriptionSize - 1);
1505  }
1506  return descr;
1507 }
1508 
1509 bool
1511  const string & sname,
1512  vector<string> & warnings)
1513 {
1514  bool ok = NS_ValidateBool(reg, sname, "scramble_job_keys", warnings);
1515  if (!ok)
1517 
1518  return reg.GetBool(sname, "scramble_job_keys", default_scramble_job_keys);
1519 }
1520 
1523  const IRegistry & reg,
1524  const string & sname,
1525  vector<string> & warnings)
1526 {
1527  double calc_default =
1528  max(
1530  double(wnode_timeout + wnode_timeout)),
1531  double(run_timeout + run_timeout));
1532  bool ok = NS_ValidateDouble(reg, sname,
1533  "client_registry_timeout_worker_node",
1534  warnings);
1535  if (!ok)
1536  return CNSPreciseTime(calc_default);
1537 
1538  double val = reg.GetDouble(sname, "client_registry_timeout_worker_node",
1540  if (val <= 0.0 || val <= double(wnode_timeout)) {
1541  warnings.push_back(g_WarnPrefix +
1542  NS_RegValName(sname,
1543  "client_registry_timeout_worker_node")
1544  + ". It must be > " +
1545  to_string(double(wnode_timeout)));
1546  return CNSPreciseTime(calc_default);
1547  }
1548  return CNSPreciseTime(val);
1549 }
1550 
1551 
1552 unsigned int
1554  const string & sname,
1555  vector<string> & warnings)
1556 {
1557  bool ok = NS_ValidateInt(reg, sname, "client_registry_min_worker_nodes",
1558  warnings);
1559  if (!ok)
1561 
1562  int val = reg.GetInt(sname, "client_registry_min_worker_nodes",
1564  if (val <= 0) {
1565  warnings.push_back(g_WarnPrefix +
1566  NS_RegValName(sname,
1567  "client_registry_min_worker_nodes") +
1568  ". It must be > 0");
1570  }
1571  return val;
1572 }
1573 
1574 
1577  const string & sname,
1578  vector<string> & warnings)
1579 {
1580  bool ok = NS_ValidateDouble(reg, sname, "client_registry_timeout_admin",
1581  warnings);
1582  if (!ok)
1584 
1585  double val = reg.GetDouble(sname, "client_registry_timeout_admin",
1587  if (val <= 0.0) {
1588  warnings.push_back(g_WarnPrefix +
1589  NS_RegValName(sname,
1590  "client_registry_timeout_admin") +
1591  ". It must be > 0.0");
1593  }
1594  return CNSPreciseTime(val);
1595 }
1596 
1597 
1598 unsigned int
1600  const string & sname,
1601  vector<string> & warnings)
1602 {
1603  bool ok = NS_ValidateInt(reg, sname, "client_registry_min_admins",
1604  warnings);
1605  if (!ok)
1607 
1608  int val = reg.GetInt(sname, "client_registry_min_admins",
1610  if (val <= 0) {
1611  warnings.push_back(g_WarnPrefix +
1612  NS_RegValName(sname,
1613  "client_registry_min_admins") +
1614  ". It must be > 0");
1616  }
1617  return val;
1618 }
1619 
1620 
1623  const IRegistry & reg,
1624  const string & sname,
1625  vector<string> & warnings)
1626 {
1627  bool ok = NS_ValidateDouble(reg, sname,
1628  "client_registry_timeout_submitter",
1629  warnings);
1630  if (!ok)
1632 
1633  double val = reg.GetDouble(sname, "client_registry_timeout_submitter",
1635  if (val <= 0.0) {
1636  warnings.push_back(g_WarnPrefix +
1637  NS_RegValName(sname,
1638  "client_registry_timeout_submitter") +
1639  ". It must be > 0.0");
1641  }
1642  return CNSPreciseTime(val);
1643 }
1644 
1645 
1646 unsigned int
1648  const string & sname,
1649  vector<string> & warnings)
1650 {
1651  bool ok = NS_ValidateInt(reg, sname,
1652  "client_registry_min_submitters", warnings);
1653  if (!ok)
1655 
1656  int val = reg.GetInt(sname, "client_registry_min_submitters",
1658  if (val <= 0) {
1659  warnings.push_back(g_WarnPrefix +
1660  NS_RegValName(sname,
1661  "client_registry_min_submitters") +
1662  ". It must be > 0");
1664  }
1665  return val;
1666 }
1667 
1668 
1671  const string & sname,
1672  vector<string> & warnings)
1673 {
1674  double calc_default =
1675  max(
1677  double(reader_timeout + reader_timeout)),
1678  double(read_timeout + read_timeout));
1679  bool ok = NS_ValidateDouble(reg, sname,
1680  "client_registry_timeout_reader",
1681  warnings);
1682  if (!ok)
1683  return CNSPreciseTime(calc_default);
1684 
1685  double val = reg.GetDouble(sname, "client_registry_timeout_reader",
1687  if (val <= 0.0 || val <= double(reader_timeout)) {
1688  warnings.push_back(g_WarnPrefix +
1689  NS_RegValName(sname,
1690  "client_registry_timeout_reader")
1691  + ". It must be > " +
1692  to_string(double(reader_timeout)));
1693  return CNSPreciseTime(calc_default);
1694  }
1695  return CNSPreciseTime(val);
1696 }
1697 
1698 
1699 unsigned int
1701  const string & sname,
1702  vector<string> & warnings)
1703 {
1704  bool ok = NS_ValidateInt(reg, sname, "client_registry_min_readers",
1705  warnings);
1706  if (!ok)
1708 
1709  int val = reg.GetInt(sname, "client_registry_min_readers",
1711  if (val <= 0) {
1712  warnings.push_back(g_WarnPrefix +
1713  NS_RegValName(sname,
1714  "client_registry_min_readers") +
1715  ". It must be > 0");
1717  }
1718  return val;
1719 }
1720 
1721 
1724  const string & sname,
1725  vector<string> & warnings)
1726 {
1727  bool ok = NS_ValidateDouble(reg, sname,
1728  "client_registry_timeout_unknown", warnings);
1729  if (!ok)
1731 
1732  double val = reg.GetDouble(sname, "client_registry_timeout_unknown",
1734  if (val <= 0.0) {
1735  warnings.push_back(g_WarnPrefix +
1736  NS_RegValName(sname,
1737  "client_registry_timeout_unknown") +
1738  ". It must be > 0.0");
1740  }
1741  return CNSPreciseTime(val);
1742 }
1743 
1744 
1745 unsigned int
1747  const string & sname,
1748  vector<string> & warnings)
1749 {
1750  bool ok = NS_ValidateInt(reg, sname,
1751  "client_registry_min_unknowns", warnings);
1752  if (!ok)
1754 
1755  int val = reg.GetInt(sname, "client_registry_min_unknowns",
1757  if (val <= 0) {
1758  warnings.push_back(g_WarnPrefix +
1759  NS_RegValName(sname,
1760  "client_registry_min_unknowns") +
1761  ". It must be > 0");
1763  }
1764  return val;
1765 }
1766 
1767 
1770  const string & sname,
1771  vector<string> & warnings,
1772  bool * linked_sections_ok)
1773 {
1774  map<string, string> conf_linked_sections;
1775  list<string> entries;
1776  list<string> available_sections;
1777 
1778  *linked_sections_ok = true;
1779 
1780  reg.EnumerateEntries(sname, &entries);
1781  reg.EnumerateSections(&available_sections);
1782 
1783  for (list<string>::const_iterator k = entries.begin();
1784  k != entries.end(); ++k) {
1785  const string & entry = *k;
1786 
1787  if (!NStr::StartsWith(entry, "linked_section_", NStr::eCase))
1788  continue;
1789  if (entry == "linked_section_") {
1790  warnings.push_back("Validating config file: unexpected entry name "
1791  + NS_RegValName(sname, "linked_section_") +
1792  ". Referring name is missed");
1793  continue;
1794  }
1795 
1796  bool ok = NS_ValidateString(reg, sname, entry, warnings);
1797  if (!ok)
1798  continue;
1799 
1800  string ref_section = reg.GetString(sname, entry, kEmptyStr);
1801  if (ref_section.empty()) {
1802  warnings.push_back(g_WarnPrefix + NS_RegValName(sname, entry) +
1803  ". Referred section name is missed");
1804  continue;
1805  }
1806  if (find(available_sections.begin(),
1807  available_sections.end(),
1808  ref_section) == available_sections.end()) {
1809  warnings.push_back(g_WarnPrefix + NS_RegValName(sname, entry) +
1810  ". It refers to an unknown section");
1811  continue;
1812  }
1813 
1814  // Here: linked section exists and the prefix is fine
1815  conf_linked_sections[entry] = ref_section;
1816  }
1817 
1818  // Check the limit of the serialized sections/prefixes lengths
1819  // See how the serialization is done
1820  string prefixes;
1821  string sections;
1823  k = conf_linked_sections.begin(); k != conf_linked_sections.end();
1824  ++k) {
1825  if (!prefixes.empty())
1826  prefixes += ",";
1827  prefixes += k->first;
1828  if (!sections.empty())
1829  sections += ",";
1830  sections += k->second;
1831  }
1832  if (prefixes.size() > kLinkedSectionsList - 1) {
1833  warnings.push_back("Validating config file: total length of the "
1834  "serialized linked section prefixes (" +
1835  to_string(prefixes.size()) +
1836  " bytes) exceeds the limit (" +
1837  to_string(kLinkedSectionsList - 1) +
1838  "bytes) in the section " + sname);
1839  *linked_sections_ok = false;
1840  }
1841  if (sections.size() > kLinkedSectionsList - 1) {
1842  warnings.push_back("Validating config file: total length of the "
1843  "serialized linked section names (" +
1844  to_string(prefixes.size()) +
1845  " bytes) exceeds the limit (" +
1846  to_string(kLinkedSectionsList - 1) +
1847  "bytes) in the section " + sname);
1848  *linked_sections_ok = false;
1849  }
1850 
1851  // Check each individual value in the linked section
1853  k = conf_linked_sections.begin(); k != conf_linked_sections.end();
1854  ++k) {
1855  entries.clear();
1856  reg.EnumerateEntries(k->second, &entries);
1857  for (list<string>::const_iterator j = entries.begin();
1858  j != entries.end(); ++j) {
1859  if (j->size() > kLinkedSectionValueNameSize - 1) {
1860  string limit_as_str =
1861  to_string(kLinkedSectionValueNameSize - 1);
1862  warnings.push_back("Validating config file: linked section [" +
1863  k->second + "]/" + *j + " name length (" +
1864  to_string(j->size()) +
1865  " bytes) exceeds the limit (" +
1866  limit_as_str + " bytes)");
1867  *linked_sections_ok = false;
1868  }
1869  string value = reg.GetString(k->second, *j, kEmptyStr);
1870  if (value.size() > kLinkedSectionValueSize - 1) {
1871  string limit_as_str =
1872  to_string(kLinkedSectionValueSize - 1);
1873  warnings.push_back("Validating config file: linked section [" +
1874  k->second + "]/" + *j + " value length (" +
1875  to_string(value.size()) +
1876  " bytes) exceeds the limit (" +
1877  limit_as_str + " bytes)");
1878  *linked_sections_ok = false;
1879  }
1880  }
1881  }
1882 
1883  return conf_linked_sections;
1884 }
1885 
1887 
JSON node abstraction.
static CJsonNode NewArrayNode()
Create a new JSON array node.
void AppendString(const string &value)
For an array node, add a string node at the end of the array.
void SetByKey(const string &key, CJsonNode::TInstance value)
For a JSON object node, insert a new element or update an existing element.
static CJsonNode NewObjectNode()
Create a new JSON object node.
void Append(CJsonNode::TInstance value)
For an array node, add a new element at the end of the array.
time_t & Sec(void)
@ ePauseWithoutPullback
Definition: ns_queue.hpp:92
@ ePauseWithPullback
Definition: ns_queue.hpp:91
@ eKindStatic
Definition: ns_queue.hpp:83
CStringException –.
Definition: ncbistr.hpp:4506
IRegistry –.
Definition: ncbireg.hpp:73
const_iterator begin() const
Definition: map.hpp:151
const_iterator end() const
Definition: map.hpp:152
const_iterator find(const key_type &key) const
Definition: map.hpp:153
#define false
Definition: bool.h:36
string
Definition: cgiapp.hpp:687
virtual bool GetBool(const string &section, const string &name, bool default_value, TFlags flags=0, EErrAction err_action=eThrow) const
Get boolean value of specified parameter name.
Definition: ncbireg.cpp:391
virtual void EnumerateSections(list< string > *sections, TFlags flags=fAllLayers) const
Enumerate section names.
Definition: ncbireg.cpp:497
virtual int GetInt(const string &section, const string &name, int default_value, TFlags flags=0, EErrAction err_action=eThrow) const
Get integer value of specified parameter name.
Definition: ncbireg.cpp:362
virtual double GetDouble(const string &section, const string &name, double default_value, TFlags flags=0, EErrAction err_action=eThrow) const
Get double value of specified parameter name.
Definition: ncbireg.cpp:420
virtual void EnumerateEntries(const string &section, list< string > *entries, TFlags flags=fAllLayers) const
Enumerate parameter names for a specified section.
Definition: ncbireg.cpp:514
virtual string GetString(const string &section, const string &name, const string &default_value, TFlags flags=0) const
Get the parameter string value.
Definition: ncbireg.cpp:321
#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:3953
#define kEmptyStr
Definition: ncbistr.hpp:123
static Uint8 StringToUInt8_DataSize(const CTempString str, TStringToNumFlags flags=0)
Convert string that can contain "software" qualifiers to Uint8.
Definition: ncbistr.cpp:1539
static const string BoolToString(bool value)
Convert bool to string.
Definition: ncbistr.cpp:2815
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Definition: ncbistr.hpp:5412
static string URLEncode(const CTempString str, EUrlEncode flag=eUrlEnc_SkipMarkChars)
URL-encode string.
Definition: ncbistr.cpp:6062
@ eCase
Case sensitive compare.
Definition: ncbistr.hpp:1205
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
NetSchedule client specs.
const unsigned int kNetScheduleMaxDBDataSize
T max(T x_, T y_)
const CNSPreciseTime default_client_registry_timeout_unknown
const CNSPreciseTime default_max_pending_read_wait_timeout(0, 0)
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 max_dump_aff_buffer_size
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 CNSPreciseTime default_notif_handicap(0, 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 max_dump_client_buffer_size
const unsigned int default_dump_buffer_size
const unsigned int default_client_registry_min_worker_nodes
const unsigned int max_dump_buffer_size
const unsigned int default_failed_retries
const CNSPreciseTime default_client_registry_timeout_admin
const CNSPreciseTime default_max_pending_wait_timeout(0, 0)
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 unsigned int max_dump_group_buffer_size
const bool default_scramble_job_keys
string NS_FormatPreciseTimeAsSec(const CNSPreciseTime &t)
void AddParameterToDiff(CJsonNode &output, const string &param_name, const TValueType &value_from, const TValueType &value_to)
const unsigned kLinkedSectionsList
Definition: ns_types.hpp:114
const unsigned kLinkedSectionValueSize
Definition: ns_types.hpp:113
const unsigned kLinkedSectionValueNameSize
Definition: ns_types.hpp:112
const unsigned kMaxDescriptionSize
Definition: ns_types.hpp:116
const unsigned kNetScheduleMaxOverflowSize
Definition: ns_types.hpp:118
const unsigned kMaxQueueLimitsSize
Definition: ns_types.hpp:115
bool NS_ValidateDouble(const IRegistry &reg, const string &section, const string &entry, vector< string > &warnings)
Definition: ns_util.cpp:88
bool NS_ValidateBool(const IRegistry &reg, const string &section, const string &entry, vector< string > &warnings)
Definition: ns_util.cpp:102
string NS_RegValName(const string &section, const string &entry)
Definition: ns_util.cpp:83
bool NS_ValidateInt(const IRegistry &reg, const string &section, const string &entry, vector< string > &warnings)
Definition: ns_util.cpp:116
bool NS_ValidateString(const IRegistry &reg, const string &section, const string &entry, vector< string > &warnings)
Definition: ns_util.cpp:130
const string g_WarnPrefix
Definition: ns_util.hpp:47
static const char * suffix[]
Definition: pcregrep.c:408
static const char * prefix[]
Definition: pcregrep.c:405
@ kNSecsPerSecond
Definition: srv_time.hpp:48
unsigned int dump_buffer_size
unsigned int ReadReadFailedRetries(const IRegistry &, const string &, vector< string > &, unsigned int failed_retries)
unsigned int client_registry_min_submitters
string ReadProgram(const IRegistry &, const string &, vector< string > &)
unsigned int ReadClientRegistryMinAdmins(const IRegistry &, const string &, vector< string > &)
string ReadWnodeHosts(const IRegistry &, const string &, vector< string > &)
unsigned int ReadClientRegistryMinWorkerNodes(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime blacklist_time
unsigned int ReadClientRegistryMinReaders(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime ReadBlacklistTime(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime timeout
CJsonNode Diff(const SQueueParameters &other, bool include_class_cmp, bool include_description) const
map< string, string > linked_sections
CNSPreciseTime ReadMaxPendingWaitTimeout(const IRegistry &, const string &, vector< string > &)
string ReadSubmHosts(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime ReadReaderTimeout(const IRegistry &, const string &, vector< string > &)
string ConfigSection(bool is_class) const
CNSPreciseTime read_timeout
unsigned int client_registry_min_unknowns
CNSPreciseTime notif_hifreq_interval
unsigned int ReadDumpClientBufferSize(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime ReadPendingTimeout(const IRegistry &, const string &, vector< string > &)
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 ReadClientRegistryTimeoutUnknown(const IRegistry &, const string &, vector< string > &)
unsigned int ReadClientRegistryMinSubmitters(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime notif_handicap
unsigned int max_jobs_per_client
unsigned int ReadClientRegistryMinUnknowns(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime ReadReadBlacklistTime(const IRegistry &, const string &, vector< string > &, const CNSPreciseTime &)
CNSPreciseTime ReadClientRegistryTimeoutSubmitter(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime client_registry_timeout_submitter
unsigned int ReadDumpBufferSize(const IRegistry &, const string &, vector< string > &)
unsigned int read_failed_retries
CNSPreciseTime client_registry_timeout_unknown
CNSPreciseTime ReadNotifHandicap(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime ReadClientRegistryTimeoutAdmin(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime CalculateRuntimePrecision(void) const
unsigned int ReadMaxOutputSize(const IRegistry &, const string &, vector< string > &)
string ReadDescription(const IRegistry &, const string &, vector< string > &)
unsigned int notif_lofreq_mult
map< string, string > ReadLinkedSections(const IRegistry &, const string &sname, vector< string > &warnings, bool *linked_sections_ok)
unsigned int dump_client_buffer_size
CNSPreciseTime reader_timeout
unsigned int failed_retries
CNSPreciseTime max_pending_read_wait_timeout
unsigned int ReadNotifLofreqMult(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime ReadNotifHifreqInterval(const IRegistry &, const string &, vector< string > &)
unsigned int dump_group_buffer_size
unsigned int client_registry_min_worker_nodes
CNSPreciseTime max_pending_wait_timeout
CNSPreciseTime client_registry_timeout_admin
bool ReadQueueClass(const IRegistry &reg, const string &sname, vector< string > &warnings)
CNSPreciseTime client_registry_timeout_reader
CNSPreciseTime ReadReadTimeout(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime ReadClientRegistryTimeoutWorkerNode(const IRegistry &, const string &, vector< string > &)
bool ReadQueue(const IRegistry &reg, const string &sname, const map< string, SQueueParameters, PNocase > &queue_classes, vector< string > &warnings)
bool ReadScrambleJobKeys(const IRegistry &, const string &, vector< string > &)
string GetPrintableParameters(bool include_class, bool url_encoded) const
CNSPreciseTime ReadClientRegistryTimeoutReader(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime run_timeout
unsigned int ReadMaxJobsPerClient(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime ReadRunTimeout(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime ReadNotifHifreqPeriod(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime client_registry_timeout_worker_node
CNSPreciseTime wnode_timeout
unsigned int ReadDumpAffBufferSize(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime ReadWnodeTimeout(const IRegistry &, const string &, vector< string > &)
unsigned int ReadMaxInputSize(const IRegistry &, const string &, vector< string > &)
string ReadClass(const IRegistry &, const string &, vector< string > &)
unsigned int ReadDumpGroupBufferSize(const IRegistry &, const string &, vector< string > &)
unsigned int ReadFailedRetries(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime ReadMaxPendingReadWaitTimeout(const IRegistry &, const string &, vector< string > &)
string ReadReaderHosts(const IRegistry &, const string &, vector< string > &)
CNSPreciseTime ReadTimeout(const IRegistry &, const string &, vector< string > &)
unsigned int client_registry_min_admins
unsigned int client_registry_min_readers
else result
Definition: token2.c:20
static wxAcceleratorEntry entries[3]
Modified on Wed May 15 15:10:14 2024 by modify_doxy.py rev. 669887