NCBI C++ ToolKit
|
#include <ncbi_pch.hpp>
#include "ns_util.hpp"
#include "ns_queue.hpp"
#include "ns_ini_params.hpp"
#include "ns_queue_parameters.hpp"
#include "queue_database.hpp"
#include <util/bitset/bmalgo.h>
#include <util/checksum.hpp>
#include <connect/ncbi_socket.hpp>
#include <unistd.h>
Go to the source code of this file.
Go to the SVN repository for this file.
Functions | |
static void | NS_ValidateServerSection (const IRegistry ®, vector< string > &warnings, bool throw_port_exception, bool &decrypting_error) |
static void | NS_ValidateQueuesAndClasses (const IRegistry ®, list< string > &queues, vector< string > &warnings) |
static TQueueParams | NS_ValidateClasses (const IRegistry ®, vector< string > &warnings) |
static void | NS_ValidateQueues (const IRegistry ®, const TQueueParams &qclasses, list< string > &queues, vector< string > &warnings) |
static void | NS_ValidateServiceToQueueSection (const IRegistry ®, const list< string > &queues, vector< string > &warnings) |
static string | NS_OutOfLimitMessage (const string §ion, const string &entry, unsigned int low_limit, unsigned int high_limit) |
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) |
string | NS_RegValName (const string §ion, const string &entry) |
bool | NS_ValidateDouble (const IRegistry ®, const string §ion, const string &entry, vector< string > &warnings) |
bool | NS_ValidateBool (const IRegistry ®, const string §ion, const string &entry, vector< string > &warnings) |
bool | NS_ValidateInt (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) |
bool | NS_ValidateDataSize (const IRegistry ®, const string §ion, const string &entry, vector< string > &warnings) |
unsigned int | NS_GetDataSize (const IRegistry ®, const string §ion, const string &entry, unsigned int default_val) |
void | NS_ValidateConfigFile (const IRegistry ®, vector< string > &warnings, bool throw_port_exception, bool &decrypting_error) |
string | NS_GetConfigFileChecksum (const string &file_name, vector< string > &warnings) |
Variables | |
static const string | s_ErrorGettingChecksum = "error detected" |
Definition at line 605 of file ns_util.cpp.
References CChecksum::AddFile(), CChecksum::eMD5, file_name, CChecksum::GetMD5Digest(), and s_ErrorGettingChecksum.
Referenced by CNetScheduleDApp::Run(), CServiceThread::x_CheckConfigFile(), and CNetScheduleHandler::x_ProcessReloadConfig().
unsigned int NS_GetDataSize | ( | const IRegistry & | reg, |
const string & | section, | ||
const string & | entry, | ||
unsigned int | default_val | ||
) |
Definition at line 172 of file ns_util.cpp.
References CConfig::eErr_NoThrow, eNoOwnership, CTreeNode< TValue, TKeyGetterP >::FindSubNode(), CConfig::GetDataSize(), and CConfig::GetTree().
Referenced by SNS_Parameters::Read().
|
static |
Definition at line 590 of file ns_util.cpp.
References g_ValidPrefix, and NS_RegValName().
Referenced by NS_ValidateServerSection().
Definition at line 83 of file ns_util.cpp.
Referenced by NS_OutOfLimitMessage(), NS_ValidateBool(), NS_ValidateDataSize(), NS_ValidateDouble(), NS_ValidateInt(), NS_ValidateRegistrySettings(), NS_ValidateServerSection(), NS_ValidateServiceToQueueSection(), NS_ValidateString(), SQueueParameters::ReadBlacklistTime(), SQueueParameters::ReadClientRegistryMinAdmins(), SQueueParameters::ReadClientRegistryMinReaders(), SQueueParameters::ReadClientRegistryMinSubmitters(), SQueueParameters::ReadClientRegistryMinUnknowns(), SQueueParameters::ReadClientRegistryMinWorkerNodes(), SQueueParameters::ReadClientRegistryTimeoutAdmin(), SQueueParameters::ReadClientRegistryTimeoutReader(), SQueueParameters::ReadClientRegistryTimeoutSubmitter(), SQueueParameters::ReadClientRegistryTimeoutUnknown(), SQueueParameters::ReadClientRegistryTimeoutWorkerNode(), SQueueParameters::ReadDescription(), SQueueParameters::ReadDumpAffBufferSize(), SQueueParameters::ReadDumpBufferSize(), SQueueParameters::ReadDumpClientBufferSize(), SQueueParameters::ReadDumpGroupBufferSize(), SQueueParameters::ReadFailedRetries(), SQueueParameters::ReadLinkedSections(), SQueueParameters::ReadMaxInputSize(), SQueueParameters::ReadMaxJobsPerClient(), SQueueParameters::ReadMaxOutputSize(), SQueueParameters::ReadMaxPendingReadWaitTimeout(), SQueueParameters::ReadMaxPendingWaitTimeout(), SQueueParameters::ReadNotifHandicap(), SQueueParameters::ReadNotifHifreqInterval(), SQueueParameters::ReadNotifHifreqPeriod(), SQueueParameters::ReadNotifLofreqMult(), SQueueParameters::ReadPendingTimeout(), SQueueParameters::ReadProgram(), SQueueParameters::ReadQueue(), SQueueParameters::ReadReadBlacklistTime(), SQueueParameters::ReadReaderHosts(), SQueueParameters::ReadReaderTimeout(), SQueueParameters::ReadReadFailedRetries(), SQueueParameters::ReadReadTimeout(), SQueueParameters::ReadRunTimeout(), SQueueParameters::ReadSubmHosts(), SQueueParameters::ReadTimeout(), SQueueParameters::ReadWnodeHosts(), and SQueueParameters::ReadWnodeTimeout().
bool NS_ValidateBool | ( | const IRegistry & | reg, |
const string & | section, | ||
const string & | entry, | ||
vector< string > & | warnings | ||
) |
Definition at line 102 of file ns_util.cpp.
References g_WarnPrefix, IRegistry::GetBool(), and NS_RegValName().
Referenced by NS_ValidateServerSection(), and SQueueParameters::ReadScrambleJobKeys().
|
static |
Definition at line 478 of file ns_util.cpp.
References NStr::CompareNocase(), IRegistry::EnumerateSections(), g_ValidPrefix, ITERATE, kMaxQueueNameSize, SQueueParameters::ReadQueueClass(), and NStr::SplitInTwo().
Referenced by NS_ValidateQueuesAndClasses().
void NS_ValidateConfigFile | ( | const IRegistry & | reg, |
vector< string > & | warnings, | ||
bool | throw_port_exception, | ||
bool & | decrypting_error | ||
) |
Definition at line 190 of file ns_util.cpp.
References NS_ValidateQueuesAndClasses(), NS_ValidateServerSection(), and NS_ValidateServiceToQueueSection().
Referenced by CNetScheduleDApp::Run(), and CNetScheduleHandler::x_ProcessReloadConfig().
bool NS_ValidateDataSize | ( | const IRegistry & | reg, |
const string & | section, | ||
const string & | entry, | ||
vector< string > & | warnings | ||
) |
Definition at line 145 of file ns_util.cpp.
References CConfig::eErr_Throw, eNoOwnership, CTreeNode< TValue, TKeyGetterP >::FindSubNode(), g_WarnPrefix, CConfig::GetDataSize(), CConfig::GetTree(), IRegistry::HasEntry(), and NS_RegValName().
Referenced by NS_ValidateServerSection().
bool NS_ValidateDouble | ( | const IRegistry & | reg, |
const string & | section, | ||
const string & | entry, | ||
vector< string > & | warnings | ||
) |
Definition at line 88 of file ns_util.cpp.
References g_WarnPrefix, IRegistry::GetDouble(), and NS_RegValName().
Referenced by NS_ValidateServerSection(), SQueueParameters::ReadBlacklistTime(), SQueueParameters::ReadClientRegistryTimeoutAdmin(), SQueueParameters::ReadClientRegistryTimeoutReader(), SQueueParameters::ReadClientRegistryTimeoutSubmitter(), SQueueParameters::ReadClientRegistryTimeoutUnknown(), SQueueParameters::ReadClientRegistryTimeoutWorkerNode(), SQueueParameters::ReadMaxPendingReadWaitTimeout(), SQueueParameters::ReadMaxPendingWaitTimeout(), SQueueParameters::ReadNotifHandicap(), SQueueParameters::ReadNotifHifreqInterval(), SQueueParameters::ReadNotifHifreqPeriod(), SQueueParameters::ReadPendingTimeout(), SQueueParameters::ReadReadBlacklistTime(), SQueueParameters::ReadReaderTimeout(), SQueueParameters::ReadReadTimeout(), SQueueParameters::ReadRunTimeout(), SQueueParameters::ReadTimeout(), and SQueueParameters::ReadWnodeTimeout().
bool NS_ValidateInt | ( | const IRegistry & | reg, |
const string & | section, | ||
const string & | entry, | ||
vector< string > & | warnings | ||
) |
Definition at line 116 of file ns_util.cpp.
References g_WarnPrefix, IRegistry::GetInt(), and NS_RegValName().
Referenced by NS_ValidateRegistrySettings(), NS_ValidateServerSection(), SQueueParameters::ReadClientRegistryMinAdmins(), SQueueParameters::ReadClientRegistryMinReaders(), SQueueParameters::ReadClientRegistryMinSubmitters(), SQueueParameters::ReadClientRegistryMinUnknowns(), SQueueParameters::ReadClientRegistryMinWorkerNodes(), SQueueParameters::ReadDumpAffBufferSize(), SQueueParameters::ReadDumpBufferSize(), SQueueParameters::ReadDumpClientBufferSize(), SQueueParameters::ReadDumpGroupBufferSize(), SQueueParameters::ReadFailedRetries(), SQueueParameters::ReadMaxJobsPerClient(), SQueueParameters::ReadNotifLofreqMult(), and SQueueParameters::ReadReadFailedRetries().
|
static |
Definition at line 520 of file ns_util.cpp.
References NStr::CompareNocase(), IRegistry::EnumerateSections(), g_ValidPrefix, kMaxQueueNameSize, SQueueParameters::ReadQueue(), and NStr::SplitInTwo().
Referenced by NS_ValidateQueuesAndClasses().
|
static |
Definition at line 467 of file ns_util.cpp.
References NS_ValidateClasses(), and NS_ValidateQueues().
Referenced by NS_ValidateConfigFile().
|
static |
Definition at line 648 of file ns_util.cpp.
References g_ValidPrefix, IRegistry::GetInt(), NS_RegValName(), NS_ValidateInt(), ok, and val.
Referenced by NS_ValidateServerSection().
|
static |
Definition at line 204 of file ns_util.cpp.
References default_affinity_dirt_percentage, default_affinity_high_mark_percentage, default_affinity_high_removal, default_affinity_low_mark_percentage, default_affinity_low_removal, default_del_batch_size, default_group_dirt_percentage, default_group_high_mark_percentage, default_group_high_removal, default_group_low_mark_percentage, default_group_low_removal, default_init_threads, default_job_counters_interval, default_markdel_batch_size, default_max_affinities, default_max_client_data, default_max_connections, default_max_groups, default_max_queues, default_max_scopes, default_max_threads, default_network_timeout, default_purge_timeout, default_scan_batch_size, default_scope_dirt_percentage, default_scope_high_mark_percentage, default_scope_high_removal, default_scope_low_mark_percentage, default_scope_low_removal, default_stat_interval, IRegistry::fPlaintextAllowed, g_ValidPrefix, IRegistry::GetDouble(), IRegistry::GetEncryptedString(), IRegistry::GetInt(), init_threads_high_limit, init_threads_low_limit, max_connections_high_limit, max_connections_low_limit, max_threads_high_limit, max_threads_low_limit, msg(), NCBI_THROW, NS_OutOfLimitMessage(), NS_RegValName(), NS_ValidateBool(), NS_ValidateDataSize(), NS_ValidateDouble(), NS_ValidateInt(), NS_ValidateRegistrySettings(), NS_ValidateString(), ok, port_high_limit, port_low_limit, and val.
Referenced by NS_ValidateConfigFile().
|
static |
Definition at line 561 of file ns_util.cpp.
References entries, IRegistry::EnumerateEntries(), g_ValidPrefix, IRegistry::Get(), and NS_RegValName().
Referenced by NS_ValidateConfigFile().
bool NS_ValidateString | ( | const IRegistry & | reg, |
const string & | section, | ||
const string & | entry, | ||
vector< string > & | warnings | ||
) |
Definition at line 130 of file ns_util.cpp.
References g_WarnPrefix, IRegistry::GetString(), and NS_RegValName().
Referenced by NS_ValidateServerSection(), SQueueParameters::ReadClass(), SQueueParameters::ReadDescription(), SQueueParameters::ReadLinkedSections(), SQueueParameters::ReadMaxInputSize(), SQueueParameters::ReadMaxOutputSize(), SQueueParameters::ReadProgram(), SQueueParameters::ReadReaderHosts(), SQueueParameters::ReadSubmHosts(), and SQueueParameters::ReadWnodeHosts().
Definition at line 602 of file ns_util.cpp.
Referenced by NS_GetConfigFileChecksum().