vector<string> & warnings,
51 boolthrow_port_exception,
52 bool& decrypting_error);
54list<string> & queues,
55vector<string> & warnings);
57vector<string> & warnings);
60list<string> & queues,
61vector<string> & warnings);
63 constlist<string> & queues,
64vector<string> & warnings);
67 unsigned intlow_limit,
68 unsigned inthigh_limit);
71 const string& section,
73 unsigned intdefault_max,
74 unsigned intdefault_high_mark_percentage,
75 unsigned intdefault_low_mark_percentage,
76 unsigned intdefault_high_removal,
77 unsigned intdefault_low_removal,
78 unsigned intdefault_dirt_percentage,
79vector<string> & warnings);
85 return "["+ section +
"]/"+ entry;
89 const string& section,
const string& entry,
90vector<string> & warnings)
96 ". Expected a floating point value.");
103 const string& section,
const string& entry,
104vector<string> & warnings)
107reg.
GetBool(section, entry,
false);
110 ". Expected boolean value.");
117 const string& section,
const string& entry,
118vector<string> & warnings)
121reg.
GetInt(section, entry, 0);
124 ". Expected integer value.");
131 const string& section,
const string& entry,
132vector<string> & warnings)
138 ". Expected string value.");
146 const string& section,
const string& entry,
147vector<string> & warnings)
149 if(!reg.
HasEntry(section, entry))
165 ". Expected data size value.");
173 const string& section,
const string& entry,
174 unsigned intdefault_val)
191 boolthrow_port_exception,
192 bool& decrypting_error)
205vector<string> & warnings,
206 boolthrow_port_exception,
207 bool& decrypting_error)
209 const stringsection =
"server";
215 intport_val = reg.
GetInt(section,
"port", 0);
218 " value. Allowed range: "+
221 if(throw_port_exception)
223warnings.push_back(
msg);
226 if(throw_port_exception)
234 int val= reg.
GetInt(section,
"max_connections",
243message +=
" Value "+ to_string(
248warnings.push_back(message +
" will be used when restarted");
262max_threads_val =
val;
275init_threads_val =
val;
278 if(init_threads_val > max_threads_val)
282 " break the mandatory condition " 283 "init_threads <= max_threads");
290 int val= reg.
GetInt(section,
"network_timeout",
300 int val= reg.
GetInt(section,
"max_queues",
312 NS_ValidateBool(reg, section,
"log_execution_watcher_thread", warnings);
320 int val= reg.
GetInt(section,
"del_batch_size",
327del_batch_size_val =
val;
333 int val= reg.
GetInt(section,
"markdel_batch_size",
340markdel_batch_size_val =
val;
346 int val= reg.
GetInt(section,
"scan_batch_size",
353scan_batch_size_val =
val;
366 if(scan_batch_size_val < markdel_batch_size_val)
370 " break the mandatory condition " 371 "markdel_batch_size <= scan_batch_size");
373 if(markdel_batch_size_val < del_batch_size_val)
377 " break the mandatory condition " 378 "del_batch_size <= markdel_batch_size");
383 int val= reg.
GetInt(section,
"stat_interval",
393 int val= reg.
GetInt(section,
"job_counters_interval",
403 int val= reg.
GetInt(section,
"max_client_data",
439 "state_transition_perf_log_queues", warnings);
441 "state_transition_perf_log_classes", warnings);
444decrypting_error =
false;
451 " decrypting error detected. "+
453decrypting_error =
true;
457 " unknown decrypting error");
458decrypting_error =
true;
468list<string> & queues,
469vector<string> & warnings)
479vector<string> & warnings)
482list<string> sections;
486 ITERATE(list<string>, it, sections) {
489 const string& section_name = *it;
494 if(queue_class.empty()) {
495warnings.push_back(
g_ValidPrefix+
"section "+ section_name +
496 " does not have a queue class name");
500warnings.push_back(
g_ValidPrefix+
"section "+ section_name +
501 " introduces a queue class which name length" 502 " exceeds the max allowed lenght of "+
511queue_classes[queue_class] = params;
515 returnqueue_classes;
522list<string> & queues,
523vector<string> & warnings)
525list<string> sections;
528 for(list<string>::const_iterator k = sections.begin();
529k != sections.end(); ++k) {
532 stringsection_name = *k;
538 if(queue_name.empty()) {
539warnings.push_back(
g_ValidPrefix+
"section "+ section_name +
540 " does not have a queue name");
544warnings.push_back(
g_ValidPrefix+
"section "+ section_name +
545 " introduces a queue which name length" 546 " exceeds the max allowed lenght of "+
552 if(params.
ReadQueue(reg, section_name, qclasses, warnings)) {
554queues.push_back(queue_name);
562 constlist<string> & queues,
563vector<string> & warnings)
565 const stringsection =
"service_to_queue";
569 for(list<string>::const_iterator k =
entries.begin();
571 stringservice_name = *k;
572 stringqname = reg.
Get(section, service_name);
576 " does not specify a queue name");
581 if(find(queues.begin(), queues.end(), qname) == queues.end())
584 " does not point to an existing static queue");
591 const string& entry,
592 unsigned intlow_limit,
593 unsigned inthigh_limit)
596 " is out of limits ("+ to_string(low_limit) +
"..."+
597to_string(high_limit) +
")";
606vector<string> & warnings)
617 if(access(
file_name.c_str(), F_OK) != 0) {
618warnings.push_back(
"Error computing config file checksum, " 619 "the file does not exist: "+
file_name);
623 if(access(
file_name.c_str(), R_OK) != 0) {
624warnings.push_back(
"Error computing config file checksum, " 625 "there are no read permissions: "+
file_name);
630 stringchecksum_as_string;
635 returnchecksum_as_string;
636}
catch(
constexception & ex) {
637warnings.push_back(
"Error computing config file checksum. "+
641warnings.push_back(
"Unknown error of computing config file checksum");
649 const string& section,
651 unsigned intdefault_max,
652 unsigned intdefault_high_mark_percentage,
653 unsigned intdefault_low_mark_percentage,
654 unsigned intdefault_high_removal,
655 unsigned intdefault_low_removal,
656 unsigned intdefault_dirt_percentage,
657vector<string> & warnings)
662 if(name ==
"affinity")
663plural =
"affinities";
665plural = name +
"s";
670 int val= reg.
GetInt(section,
"max_"+ plural, default_max);
679 unsigned inthigh_mark_percentage_val =
680default_high_mark_percentage;
682 int val= reg.
GetInt(section, name +
"_high_mark_percentage",
683default_high_mark_percentage);
684 if(val <= 0 || val >= 100)
687 " must be between 0 and 100");
689high_mark_percentage_val =
val;
694 unsigned intlow_mark_percentage_val =
695default_low_mark_percentage;
697 int val= reg.
GetInt(section, name +
"_low_mark_percentage",
698default_low_mark_percentage);
699 if(val <= 0 || val >= 100)
702 " must be between 0 and 100");
704low_mark_percentage_val =
val;
708 unsigned inthigh_removal_val = default_high_removal;
710 int val= reg.
GetInt(section, name +
"_high_removal",
711default_high_removal);
717high_removal_val =
val;
721 unsigned intlow_removal_val = default_low_removal;
723 int val= reg.
GetInt(section, name +
"_low_removal",
724default_low_removal);
730low_removal_val =
val;
734 unsigned intdirt_percentage_val = default_dirt_percentage;
736 int val= reg.
GetInt(section, name +
"_dirt_percentage",
737default_dirt_percentage);
738 if(val <= 0 || val >= 100)
741 " must be between 0 and 100");
743dirt_percentage_val =
val;
746 if(low_mark_percentage_val >= high_mark_percentage_val)
751 " break the mandatory condition "+
752name +
"_low_mark_percentage < "+
753name +
"_high_mark_percentage");
755 if(dirt_percentage_val >= low_mark_percentage_val)
760 " break the mandatory condition "+
761name +
"_dirt_percentage < "+
762name +
"_low_mark_percentage");
764 if(high_removal_val < low_removal_val)
769 " break the mandatory condition "+
770name +
"_low_removal <= "+
771name +
"_high_removal");
Algorithms for bvector<> (main include)
Checksum and hash calculation classes.
CChecksum â Checksum calculator.
NetSchedule internal exception.
definition of a Culling tree
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
@ eNoOwnership
No ownership is assumed.
void AddFile(const string &file_path)
Update checksum with the file data.
void GetMD5Digest(unsigned char digest[16]) const
Return calculated MD5 digest.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const TParamTree * GetTree() const
Uint8 GetDataSize(const string &driver_name, const string ¶m_name, EErrAction on_error, unsigned int default_value, const list< string > *synonyms=NULL)
Utility function to get an integer element of parameter tree Throws an exception when mandatory param...
@ eErr_NoThrow
Return default value on error.
@ eErr_Throw
Throw an exception on error.
virtual bool GetBool(const string §ion, const string &name, bool default_value, TFlags flags=0, EErrAction err_action=eThrow) const
Get boolean value of specified parameter name.
virtual void EnumerateSections(list< string > *sections, TFlags flags=fAllLayers) const
Enumerate section names.
virtual const string & Get(const string §ion, const string &name, TFlags flags=0) const
Get the parameter value.
virtual int GetInt(const string §ion, const string &name, int default_value, TFlags flags=0, EErrAction err_action=eThrow) const
Get integer value of specified parameter name.
virtual double GetDouble(const string §ion, const string &name, double default_value, TFlags flags=0, EErrAction err_action=eThrow) const
Get double value of specified parameter name.
virtual bool HasEntry(const string §ion, const string &name=kEmptyStr, TFlags flags=0) const
virtual void EnumerateEntries(const string §ion, list< string > *entries, TFlags flags=fAllLayers) const
Enumerate parameter names for a specified section.
string GetEncryptedString(const string §ion, const string &name, TFlags flags=0, const string &password=kEmptyStr) const
Get a value that was (potentially) stored encrypted.
virtual string GetString(const string §ion, const string &name, const string &default_value, TFlags flags=0) const
Get the parameter string value.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
const TTreeType * FindSubNode(const TKeyType &key) const
Non recursive linear scan of all subnodes, with key comparison.
const unsigned short port_high_limit
const unsigned int default_group_low_removal
const unsigned int default_affinity_low_mark_percentage
const unsigned int default_group_dirt_percentage
const unsigned int default_max_threads
const unsigned int default_scope_high_removal
const unsigned int default_scope_high_mark_percentage
const double default_purge_timeout
const unsigned int default_group_high_mark_percentage
const unsigned int default_init_threads
const unsigned int default_stat_interval
const unsigned int default_max_scopes
const unsigned int default_max_client_data
const unsigned int default_max_groups
const unsigned int default_group_high_removal
const unsigned short port_low_limit
const unsigned int default_group_low_mark_percentage
const unsigned int default_scope_low_removal
const unsigned int default_markdel_batch_size
const unsigned int default_max_queues
const unsigned int max_threads_high_limit
const unsigned int default_affinity_low_removal
const unsigned int default_affinity_high_mark_percentage
const unsigned int default_del_batch_size
const unsigned int default_job_counters_interval
const unsigned int default_scope_low_mark_percentage
const unsigned int max_connections_low_limit
const unsigned int default_max_connections
const unsigned int default_affinity_high_removal
const unsigned int default_max_affinities
const unsigned int default_scope_dirt_percentage
const unsigned int max_threads_low_limit
const unsigned int init_threads_high_limit
const unsigned int init_threads_low_limit
const unsigned int max_connections_high_limit
const unsigned int default_affinity_dirt_percentage
const unsigned int default_scan_batch_size
const unsigned int default_network_timeout
const unsigned kMaxQueueNameSize
bool NS_ValidateDouble(const IRegistry ®, const string §ion, const string &entry, vector< string > &warnings)
void NS_ValidateConfigFile(const IRegistry ®, vector< string > &warnings, bool throw_port_exception, bool &decrypting_error)
bool NS_ValidateBool(const IRegistry ®, const string §ion, const string &entry, vector< string > &warnings)
static void NS_ValidateRegistrySettings(const IRegistry ®, const string §ion, const string &name, unsigned int default_max, unsigned int default_high_mark_percentage, unsigned int default_low_mark_percentage, unsigned int default_high_removal, unsigned int default_low_removal, unsigned int default_dirt_percentage, vector< string > &warnings)
static void NS_ValidateQueuesAndClasses(const IRegistry ®, list< string > &queues, vector< string > &warnings)
string NS_RegValName(const string §ion, const string &entry)
static string NS_OutOfLimitMessage(const string §ion, const string &entry, unsigned int low_limit, unsigned int high_limit)
string NS_GetConfigFileChecksum(const string &file_name, vector< string > &warnings)
unsigned int NS_GetDataSize(const IRegistry ®, const string §ion, const string &entry, unsigned int default_val)
static const string s_ErrorGettingChecksum
static TQueueParams NS_ValidateClasses(const IRegistry ®, vector< string > &warnings)
static void NS_ValidateServiceToQueueSection(const IRegistry ®, const list< string > &queues, vector< string > &warnings)
static void NS_ValidateServerSection(const IRegistry ®, vector< string > &warnings, bool throw_port_exception, bool &decrypting_error)
static void NS_ValidateQueues(const IRegistry ®, const TQueueParams &qclasses, list< string > &queues, vector< string > &warnings)
bool NS_ValidateInt(const IRegistry ®, const string §ion, const string &entry, vector< string > &warnings)
bool NS_ValidateDataSize(const IRegistry ®, const string §ion, const string &entry, vector< string > &warnings)
bool NS_ValidateString(const IRegistry ®, const string §ion, const string &entry, vector< string > &warnings)
const string g_WarnPrefix
const string g_ValidPrefix
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
bool ReadQueueClass(const IRegistry ®, const string &sname, vector< string > &warnings)
bool ReadQueue(const IRegistry ®, const string &sname, const map< string, SQueueParameters, PNocase > &queue_classes, vector< string > &warnings)
static wxAcceleratorEntry entries[3]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4