97 const string kDefaultSSLCiphers =
"EECDH+aRSA+AESGCM EDH+aRSA+AESGCM EECDH+aRSA EDH+aRSA !SHA !SHA256 !SHA384";
121 const string kDefaultMyNCBIURL =
"http://txproxy.linkerd.ncbi.nlm.nih.gov/v1/service/MyNCBIAccount?txsvc=MyNCBIAccount";
143 m_ShutdownIfTooManyOpenFD(0),
230 "]/port value is not found in the configuration "
231 "file. The port must be provided to run the server. "
260 "send_blob_if_small",
269 "ProcessorMaxConcurrency",
272 "split_info_blob_cache_size",
286 string err_msg =
"Invalid [SERVER]/maxconnsoftlimit value. "
287 "It must be > 0. Resetting to the default value (" +
297 string err_msg =
"Inconsistent configuration of the [SERVER]/maxconn value. "
298 "It must be >= [SERVER]/maxconnsoftlimit value. "
308 string err_msg =
"Inconsistent configuration of the [SERVER]/maxconn value. "
309 "It must be so that ([SERVER]/maxconn value - [SERVER]/maxconnsoftlimit value) >= 16. "
333 "only_for_processor",
341 "dbfile_si2csi",
"");
343 "dbfile_bioseq_info",
"");
345 "dbfile_blob_prop",
"");
401 "critical_data_sources",
430 PSG_WARNING(
"The [HEALTH]/critical_data_sources value "
431 "has NONE together with other items. "
432 "The NONE item is ignored.");
440 "The health timeout is out of range. It must be > 0. "
470 "The cassandra health timeout is out of range. It must be >= 0. "
497 "The LMDB health timeout is out of range. It must be >= 0. "
527 "The CDD health timeout is out of range. It must be >= 0. "
557 "The WGS health timeout is out of range. It must be >= 0. "
587 "The SNP health timeout is out of range. It must be >= 0. "
603 "not_found_cache_size",
612 "error_cache_back_off_ms",
624 "resolve_timeout_ms",
634 for(
const auto & value_id :
entries) {
644 name <<
" information. Expected <name>:::<description");
657 string msg =
"Decrypting error detected while reading "
667 string msg =
"Unknown decrypting error detected while reading "
691 const unsigned short kHttpPortMin = 1;
692 const unsigned short kHttpPortMax = 65534;
693 const unsigned short kWorkersMin = 1;
694 const unsigned short kWorkersMax = 100;
695 const unsigned int kListenerBacklogMin = 5;
696 const unsigned int kListenerBacklogMax = 2048;
697 const unsigned short kTcpMaxConnMax = 65000;
698 const unsigned short kTcpMaxConnMin = 5;
699 const unsigned int kTimeoutMsMin = 0;
700 const unsigned int kTimeoutMsMax = UINT_MAX;
701 const unsigned int kMaxRetriesMin = 0;
702 const unsigned int kMaxRetriesMax = UINT_MAX;
705 if (m_HttpPort < kHttpPortMin || m_HttpPort > kHttpPortMax) {
708 "]/port value is out of range. Allowed range: " +
709 to_string(kHttpPortMin) +
"..." +
710 to_string(kHttpPortMax) +
". Received: " +
716 "in the ini file. No si2csi cache will be used.");
721 "in the ini file. No bioseq_info cache will be used.");
726 "in the ini file. No blob_prop cache will be used.");
729 if (m_HttpWorkers < kWorkersMin || m_HttpWorkers > kWorkersMax) {
731 "The number of HTTP workers is out of range. Allowed "
732 "range: " + to_string(kWorkersMin) +
"..." +
733 to_string(kWorkersMax) +
". Received: " +
744 "The listener backlog is out of range. Allowed "
745 "range: " + to_string(kListenerBacklogMin) +
"..." +
746 to_string(kListenerBacklogMax) +
". Received: " +
754 if (m_TcpMaxConn < kTcpMaxConnMin || m_TcpMaxConn > kTcpMaxConnMax) {
756 "The max number of connections is out of range. Allowed "
757 "range: " + to_string(kTcpMaxConnMin) +
"..." +
758 to_string(kTcpMaxConnMax) +
". Received: " +
766 if (m_TimeoutMs < kTimeoutMsMin || m_TimeoutMs > kTimeoutMsMax) {
768 "The operation timeout is out of range. Allowed "
769 "range: " + to_string(kTimeoutMsMin) +
"..." +
770 to_string(kTimeoutMsMax) +
". Received: " +
778 if (m_MaxRetries < kMaxRetriesMin || m_MaxRetries > kMaxRetriesMax) {
780 "The max retries is out of range. Allowed "
781 "range: " + to_string(kMaxRetriesMin) +
"..." +
782 to_string(kMaxRetriesMax) +
". Received: " +
792 "The max exclude cache size must be a positive integer. "
794 "Reset to 0 (exclude blobs cache is disabled)";
800 if (m_ExcludeCachePurgePercentage < 0 || m_ExcludeCachePurgePercentage > 100) {
801 string err_msg =
"The exclude cache purge percentage is out of range. "
802 "Allowed: 0...100. Received: " +
805 err_msg +=
"Reset to " +
809 err_msg +=
"The provided value has no effect "
810 "because the exclude cache is disabled.";
818 string err_msg =
"The exclude cache inactivity purge timeout must be "
819 "a positive integer greater than zero. Received: " +
822 err_msg +=
"Reset to " +
826 err_msg +=
"The provided value has no effect "
827 "because the exclude cache is disabled.";
837 "The http max backlog must be greater than 0. The http max backlog is "
838 "reset to the default value (" +
846 "The http max running must be greater than 0. The http max running is "
847 "reset to the default value (" +
855 "The log sampling ratio must be greater or equal 0. The log sampling ratio is "
856 "reset to the default value (" +
864 "The log timing threshold must be greater or equal 0. The log timing threshold is "
865 "reset to the default value (" +
873 "The max hops must be greater than 0. The max hops is "
874 "reset to the default value (" +
879 bool stat_settings_good =
true;
884 "'. Allowed values are: log, linear. "
885 "The statistics parameters are reset to default.";
888 stat_settings_good =
false;
896 if (stat_settings_good) {
899 "]/min and max values. The "
900 "max cannot be less than min. "
901 "The statistics parameters are reset to default.";
904 stat_settings_good =
false;
913 if (stat_settings_good) {
916 "]/n_bins value. The "
917 "number of bins must be greater than 0. "
918 "The statistics parameters are reset to default.";
935 "The tick span must be greater than 0. The tick span is "
936 "reset to the default value (" +
944 "The resend timeout must be greater or equal to 0. The resend "
945 "timeout is reset to the default value (" +
953 "The request timeout must be greater than 0. The request "
954 "timeout is reset to the default value (" +
961 "]/ProcessorMaxConcurrency value (" +
963 "The processor max concurrency must be greater than 0. "
964 "The processor max concurrency is reset to the default value (" +
971 "The [" +
kIPGSection +
"]/page_size is switched to the "
979 "[" +
kSSLSection +
"]/ssl_cert_file value must be provided "
980 "if [" +
kSSLSection +
"]/ssl_enable is set to true");
984 "[" +
kSSLSection +
"]/ssl_key_file value must be provided "
985 "if [" +
kSSLSection +
"]/ssl_enable is set to true");
990 "[" +
kSSLSection +
"]/ssl_cert_file is not found");
994 "[" +
kSSLSection +
"]/ssl_key_file is not found");
1018 "The [" +
kMyNCBISection +
"]/resolve_timeout_ms is switched to the "
1027 const string & section,
1028 const string & entry,
1029 unsigned long default_val)
1047 const string & processor_id)
1049 string section = processor_id +
"_PROCESSOR";
1053 "ProcessorMaxConcurrency",
1056 PSG_WARNING(
"Invalid [" + section +
"]/ProcessorMaxConcurrency value (" +
1057 to_string(limit) +
"). "
1058 "The processor max concurrency must be greater than 0. "
1059 "The processor max concurrency is reset to the "
1060 "non-processor specific default value (" +
@ ePSGS_ConfigListenerBacklog
@ ePSGS_ConfigAuthDecrypt
@ ePSGS_ConfigExcludeCachePurgeSize
@ ePSGS_ConfigSNPHealthTimeout
@ ePSGS_ConfigHttpWorkers
@ ePSGS_ConfigStatScaleType
@ ePSGS_ConfigMaxConnections
@ ePSGS_ConfigLMDBHealthTimeout
@ ePSGS_ConfigCassandraHealthTimeout
@ ePSGS_ConfigTcpMaxConnSoftLimit
@ ePSGS_ConfigExcludeCacheInactivity
@ ePSGS_ConfigWGSHealthTimeout
@ ePSGS_ConfigHealthTimeout
@ ePSGS_ConfigStatMinMaxVal
@ ePSGS_ConfigCDDHealthTimeout
@ ePSGS_ConfigExcludeCacheSize
void transform(Container &c, UnaryFunction *op)
void Register(EPSGS_AlertType alert_type, const string &message)
definition of a Culling tree
@ eNoOwnership
No ownership is assumed.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
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.
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 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.
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 list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
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.
@ fSplit_MergeDelimiters
Merge adjacent delimiters.
@ fSplit_ByPattern
Require full delimiter strings.
const TTreeType * FindSubNode(const TKeyType &key) const
Non recursive linear scan of all subnodes, with key comparison.
constexpr auto sort(_Init &&init)
Parameters initialization model.
Plugin manager (using class factory paradigm).
#define PSG_ERROR(message)
#define PSG_WARNING(message)
const string kAutoExcludeSection
const size_t kDefaultLogTimingThreshold
const string kDefaultAuthToken
const size_t kDefaultShutdownIfTooManyOpenFDforHTTPS
const size_t kDefaultHttpMaxBacklog
const string kHealthSection
const size_t kDefaultIPGPageSize
const unsigned int kDefaultMaxHops
const unsigned long kDefaultSendBlobIfSmall
const bool kDefaultSSLEnable
const bool kDefaultAllowProcessorTiming
const double kDefaultLMDBHealthTimeoutSec
const string kDefaultCDDProcessorHealthCommand
const string kWGSProcessorSection
const size_t kTcpConnHardSoftDiffDefault
const unsigned short kTcpMaxConnDefault
const string kDefaultSSLKeyFile
const string kDefaultOnlyForProcessor
const string kDefaultSSLCertFile
const string kServerSection
const size_t kDefaultHttpMaxRunning
const string kCassandraProcessorSection
const string kCDDProcessorSection
const bool kDefaultCassandraProcessorsEnabled
const unsigned short kWorkersDefault
const bool kDefaultSNPProcessorsEnabled
const string kDefaultConfigurationDomain
const size_t kDefaultMyNCBINotFoundCacheExpirationSec
const string kDebugSection
const unsigned int kListenerBacklogDefault
const double kDefaultRequestTimeoutSec
const string kCountersSection
const size_t kDefaultSplitInfoBlobCacheSize
const string kDefaultSNPProcessorHealthCommand
const size_t kDefaultMyNCBIErrorCacheSize
const size_t kDefaultMyNCBIOKCacheSize
const string kDefaultRootKeyspace
const size_t kDefaultLogSamplingRatio
const double kDefaultCassandraHealthTimeoutSec
const size_t kDefaultProcessorMaxConcurrency
const string kDefaultCriticalDataSources
const double kDefaultSNPHealthTimeoutSec
const size_t kDefaultMyNCBIResolveTimeoutMs
const unsigned long kDefaultSmallBlobSize
const size_t kDefaultShutdownIfTooManyOpenFDforHTTP
const unsigned int kDefaultExcludeCachePurgePercentage
const string kMyNCBISection
const unsigned int kDefaultExcludeCacheMaxSize
const string kLMDBProcessorSection
const size_t kDefaultMyNCBIErrorCacheBackOffMs
const string kLmdbCacheSection
const string kSNPProcessorSection
const bool kDefaultCDDProcessorsEnabled
const bool kDefaultAllowIOTest
const bool kDefaultLmdbReadAhead
const double kDefaultWGSHealthTimeoutSec
const size_t kTcpMaxConnSoftLimitDefault
const double kDefaultHealthTimeout
const string kDefaultSSLCiphers
const string kDefaultLMDBProcessorHealthCommand
const string kDefaultCassandraProcessorHealthCommand
const string kDefaultAuthCommands
const size_t kDefaultMyNCBINotFoundCacheSize
const double kDefaultResendTimeoutSec
const unsigned int kMaxRetriesDefault
const string kDefaultMyNCBIURL
const bool kDefaultWGSProcessorsEnabled
const string kDefaultMyNCBIHttpProxy
const string kAdminSection
const bool kDefaultEnableHugeIPG
const unsigned int kTimeoutDefault
const size_t kDefaultMyNCBITimeoutMs
const string kDefaultWGSProcessorHealthCommand
const unsigned int kDefaultExcludeCacheInactivityPurge
const string kStatisticsSection
const double kDefaultCDDHealthTimeoutSec
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
void Read(const CNcbiRegistry ®istry, CPSGAlerts &alerts)
bool m_SNPProcessorsEnabled
unsigned long m_MinStatValue
double m_CassandraHealthTimeoutSec
string m_WGSProcessorHealthCommand
void x_ReadCountersSection(const CNcbiRegistry ®istry)
size_t m_TcpMaxConnSoftLimit
size_t m_SplitInfoBlobCacheSize
void x_ReadServerSection(const CNcbiRegistry ®istry, CPSGAlerts &alerts)
double m_ResendTimeoutSec
string m_OnlyForProcessor
unsigned long x_GetDataSize(const CNcbiRegistry ®istry, const string §ion, const string &entry, unsigned long default_val)
vector< string > m_CriticalDataSources
void x_ReadSNPProcessorSection(const CNcbiRegistry ®istry, CPSGAlerts &alerts)
string m_BioseqInfoDbFile
string m_SNPProcessorHealthCommand
double m_RequestTimeoutSec
size_t m_LogTimingThreshold
string m_CassandraProcessorHealthCommand
map< string, tuple< string, string > > m_IdToNameAndDescription
unsigned int m_ExcludeCachePurgePercentage
double m_LMDBHealthTimeoutSec
void x_ReadLMDBProcessorSection(const CNcbiRegistry ®istry, CPSGAlerts &alerts)
void x_ReadIPGSection(const CNcbiRegistry ®istry)
size_t m_MyNCBINotFoundCacheSize
unsigned short m_HttpPort
double m_SNPHealthTimeoutSec
unsigned long m_MaxStatValue
void x_ReadStatisticsSection(const CNcbiRegistry ®istry)
size_t m_LogSamplingRatio
void x_ReadCassandraProcessorSection(const CNcbiRegistry ®istry, CPSGAlerts &alerts)
unsigned short m_HttpWorkers
double m_WGSHealthTimeoutSec
string m_ConfigurationDomain
void x_ReadAutoExcludeSection(const CNcbiRegistry ®istry)
bool IsAuthProtectedCommand(const string &cmd) const
size_t m_MyNCBIErrorCacheBackOffMs
void x_ReadCDDProcessorSection(const CNcbiRegistry ®istry, CPSGAlerts &alerts)
size_t m_MyNCBIOKCacheSize
void x_ReadMyNCBISection(const CNcbiRegistry ®istry)
unsigned int m_ExcludeCacheMaxSize
void Validate(CPSGAlerts &alerts)
unsigned short m_TcpMaxConn
void x_ReadWGSProcessorSection(const CNcbiRegistry ®istry, CPSGAlerts &alerts)
void x_ReadAdminSection(const CNcbiRegistry ®istry, CPSGAlerts &alerts)
string m_LMDBProcessorHealthCommand
unsigned long m_SmallBlobSize
void x_ReadHealthSection(const CNcbiRegistry ®istry, CPSGAlerts &alerts)
size_t GetProcessorMaxConcurrency(const CNcbiRegistry ®istry, const string &processor_id)
void x_ReadSSLSection(const CNcbiRegistry ®istry)
bool m_CassandraProcessorsEnabled
size_t m_ProcessorMaxConcurrency
unsigned int m_MaxRetries
size_t m_ShutdownIfTooManyOpenFD
~SPubseqGatewaySettings()
unsigned int m_ListenerBacklog
bool m_AllowProcessorTiming
string m_CDDProcessorHealthCommand
bool m_CDDProcessorsEnabled
unsigned int m_ExcludeCacheInactivityPurge
double m_CDDHealthTimeoutSec
size_t m_MyNCBINotFoundCacheExpirationSec
unsigned long m_SendBlobIfSmall
size_t m_MyNCBIErrorCacheSize
bool m_WGSProcessorsEnabled
void x_ReadLmdbCacheSection(const CNcbiRegistry ®istry)
vector< string > m_AuthCommands
void x_ReadDebugSection(const CNcbiRegistry ®istry)
unsigned long m_NStatBins
double m_HealthTimeoutSec
size_t m_MyNCBIResolveTimeoutMs
const unsigned long kNStatBins
const unsigned long kMinStatValue
const string kStatScaleType
const unsigned long kMaxStatValue
const unsigned long kTickSpan
static wxAcceleratorEntry entries[3]