92 const string kDefaultSSLCiphers =
"EECDH+aRSA+AESGCM EDH+aRSA+AESGCM EECDH+aRSA EDH+aRSA !SHA !SHA256 !SHA384";
107 const string kDefaultMyNCBIURL =
"http://txproxy.linkerd.ncbi.nlm.nih.gov/v1/service/MyNCBIAccount?txsvc=MyNCBIAccount";
127 m_ShutdownIfTooManyOpenFD(0),
201 "]/port value is not found in the configuration "
202 "file. The port must be provided to run the server. "
229 "send_blob_if_small",
238 "ProcessorMaxConcurrency",
241 "split_info_blob_cache_size",
271 "only_for_processor",
279 "dbfile_si2csi",
"");
281 "dbfile_bioseq_info",
"");
283 "dbfile_blob_prop",
"");
337 "test_seq_id_ignore_error",
388 "not_found_cache_size",
397 "error_cache_back_off_ms",
416 for(
const auto & value_id :
entries) {
426 name <<
" information. Expected <name>:::<description");
439 string msg =
"Decrypting error detected while reading "
449 string msg =
"Unknown decrypting error detected while reading "
463 const unsigned short kHttpPortMin = 1;
464 const unsigned short kHttpPortMax = 65534;
465 const unsigned short kWorkersMin = 1;
466 const unsigned short kWorkersMax = 100;
467 const unsigned int kListenerBacklogMin = 5;
468 const unsigned int kListenerBacklogMax = 2048;
469 const unsigned short kTcpMaxConnMax = 65000;
470 const unsigned short kTcpMaxConnMin = 5;
471 const unsigned int kTimeoutMsMin = 0;
472 const unsigned int kTimeoutMsMax = UINT_MAX;
473 const unsigned int kMaxRetriesMin = 0;
474 const unsigned int kMaxRetriesMax = UINT_MAX;
477 if (m_HttpPort < kHttpPortMin || m_HttpPort > kHttpPortMax) {
480 "]/port value is out of range. Allowed range: " +
481 to_string(kHttpPortMin) +
"..." +
482 to_string(kHttpPortMax) +
". Received: " +
488 "in the ini file. No si2csi cache will be used.");
493 "in the ini file. No bioseq_info cache will be used.");
498 "in the ini file. No blob_prop cache will be used.");
501 if (m_HttpWorkers < kWorkersMin || m_HttpWorkers > kWorkersMax) {
503 "The number of HTTP workers is out of range. Allowed "
504 "range: " + to_string(kWorkersMin) +
"..." +
505 to_string(kWorkersMax) +
". Received: " +
516 "The listener backlog is out of range. Allowed "
517 "range: " + to_string(kListenerBacklogMin) +
"..." +
518 to_string(kListenerBacklogMax) +
". Received: " +
526 if (m_TcpMaxConn < kTcpMaxConnMin || m_TcpMaxConn > kTcpMaxConnMax) {
528 "The max number of connections is out of range. Allowed "
529 "range: " + to_string(kTcpMaxConnMin) +
"..." +
530 to_string(kTcpMaxConnMax) +
". Received: " +
538 if (m_TimeoutMs < kTimeoutMsMin || m_TimeoutMs > kTimeoutMsMax) {
540 "The operation timeout is out of range. Allowed "
541 "range: " + to_string(kTimeoutMsMin) +
"..." +
542 to_string(kTimeoutMsMax) +
". Received: " +
550 if (m_MaxRetries < kMaxRetriesMin || m_MaxRetries > kMaxRetriesMax) {
552 "The max retries is out of range. Allowed "
553 "range: " + to_string(kMaxRetriesMin) +
"..." +
554 to_string(kMaxRetriesMax) +
". Received: " +
564 "The max exclude cache size must be a positive integer. "
566 "Reset to 0 (exclude blobs cache is disabled)";
572 if (m_ExcludeCachePurgePercentage < 0 || m_ExcludeCachePurgePercentage > 100) {
573 string err_msg =
"The exclude cache purge percentage is out of range. "
574 "Allowed: 0...100. Received: " +
577 err_msg +=
"Reset to " +
581 err_msg +=
"The provided value has no effect "
582 "because the exclude cache is disabled.";
590 string err_msg =
"The exclude cache inactivity purge timeout must be "
591 "a positive integer greater than zero. Received: " +
594 err_msg +=
"Reset to " +
598 err_msg +=
"The provided value has no effect "
599 "because the exclude cache is disabled.";
609 "The http max backlog must be greater than 0. The http max backlog is "
610 "reset to the default value (" +
618 "The http max running must be greater than 0. The http max running is "
619 "reset to the default value (" +
627 "The log sampling ratio must be greater or equal 0. The log sampling ratio is "
628 "reset to the default value (" +
636 "The log timing threshold must be greater or equal 0. The log timing threshold is "
637 "reset to the default value (" +
645 "The max hops must be greater than 0. The max hops is "
646 "reset to the default value (" +
651 bool stat_settings_good =
true;
656 "'. Allowed values are: log, linear. "
657 "The statistics parameters are reset to default.";
660 stat_settings_good =
false;
668 if (stat_settings_good) {
671 "]/min and max values. The "
672 "max cannot be less than min. "
673 "The statistics parameters are reset to default.";
676 stat_settings_good =
false;
685 if (stat_settings_good) {
688 "]/n_bins value. The "
689 "number of bins must be greater than 0. "
690 "The statistics parameters are reset to default.";
707 "The tick span must be greater than 0. The tick span is "
708 "reset to the default value (" +
716 "The resend timeout must be greater or equal to 0. The resend "
717 "timeout is reset to the default value (" +
725 "The request timeout must be greater than 0. The request "
726 "timeout is reset to the default value (" +
733 "]/ProcessorMaxConcurrency value (" +
735 "The processor max concurrency must be greater than 0. "
736 "The processor max concurrency is reset to the default value (" +
743 "The [" +
kIPGSection +
"]/page_size is switched to the "
751 "[" +
kSSLSection +
"]/ssl_cert_file value must be provided "
752 "if [" +
kSSLSection +
"]/ssl_enable is set to true");
756 "[" +
kSSLSection +
"]/ssl_key_file value must be provided "
757 "if [" +
kSSLSection +
"]/ssl_enable is set to true");
762 "[" +
kSSLSection +
"]/ssl_cert_file is not found");
766 "[" +
kSSLSection +
"]/ssl_key_file is not found");
792 const string & section,
793 const string & entry,
794 unsigned long default_val)
812 const string & processor_id)
814 string section = processor_id +
"_PROCESSOR";
818 "ProcessorMaxConcurrency",
821 PSG_WARNING(
"Invalid [" + section +
"]/ProcessorMaxConcurrency value (" +
822 to_string(limit) +
"). "
823 "The processor max concurrency must be greater than 0. "
824 "The processor max concurrency is reset to the "
825 "non-processor specific default value (" +
@ ePSGS_ConfigListenerBacklog
@ ePSGS_ConfigAuthDecrypt
@ ePSGS_ConfigExcludeCachePurgeSize
@ ePSGS_ConfigHttpWorkers
@ ePSGS_ConfigStatScaleType
@ ePSGS_ConfigMaxConnections
@ ePSGS_ConfigExcludeCacheInactivity
@ ePSGS_ConfigStatMinMaxVal
@ ePSGS_ConfigExcludeCacheSize
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 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_ByPattern
Require full delimiter strings.
const TTreeType * FindSubNode(const TKeyType &key) const
Non recursive linear scan of all subnodes, with key comparison.
Parameters initialization model.
Plugin manager (using class factory paradigm).
#define PSG_ERROR(message)
#define PSG_WARNING(message)
const bool kDefaultTestSeqIdIgnoreError
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 string kOSGProcessorSection
const bool kDefaultAllowProcessorTiming
const string kWGSProcessorSection
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 size_t kDefaultMyNCBIErrorCacheSize
const size_t kDefaultMyNCBIOKCacheSize
const string kDefaultRootKeyspace
const size_t kDefaultLogSamplingRatio
const size_t kDefaultProcessorMaxConcurrency
const unsigned long kDefaultSmallBlobSize
const size_t kDefaultShutdownIfTooManyOpenFDforHTTP
const unsigned int kDefaultExcludeCachePurgePercentage
const string kDefaultTestSeqId
size_t kDefaultMyNCBITimeoutMs
const string kMyNCBISection
const unsigned int kDefaultExcludeCacheMaxSize
const size_t kDefaultMyNCBIErrorCacheBackOffMs
const string kLmdbCacheSection
const string kSNPProcessorSection
const bool kDefaultCDDProcessorsEnabled
const bool kDefaultAllowIOTest
const bool kDefaultOSGProcessorsEnabled
const string kDefaultSSLCiphers
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 unsigned int kDefaultExcludeCacheInactivityPurge
const string kStatisticsSection
void x_ReadOSGProcessorSection(const CNcbiRegistry ®istry)
void Read(const CNcbiRegistry ®istry, CPSGAlerts &alerts)
bool m_SNPProcessorsEnabled
unsigned long m_MinStatValue
void x_ReadCountersSection(const CNcbiRegistry ®istry)
size_t m_SplitInfoBlobCacheSize
double m_ResendTimeoutSec
string m_OnlyForProcessor
unsigned long x_GetDataSize(const CNcbiRegistry ®istry, const string §ion, const string &entry, unsigned long default_val)
void x_ReadCDDProcessorSection(const CNcbiRegistry ®istry)
string m_BioseqInfoDbFile
double m_RequestTimeoutSec
size_t m_LogTimingThreshold
map< string, tuple< string, string > > m_IdToNameAndDescription
unsigned int m_ExcludeCachePurgePercentage
void x_ReadIPGSection(const CNcbiRegistry ®istry)
size_t m_MyNCBINotFoundCacheSize
unsigned short m_HttpPort
void x_ReadSNPProcessorSection(const CNcbiRegistry ®istry)
unsigned long m_MaxStatValue
void x_ReadStatisticsSection(const CNcbiRegistry ®istry)
void x_ReadWGSProcessorSection(const CNcbiRegistry ®istry)
size_t m_LogSamplingRatio
void x_ReadServerSection(const CNcbiRegistry ®istry)
unsigned short m_HttpWorkers
bool m_TestSeqIdIgnoreError
string m_ConfigurationDomain
void x_ReadAutoExcludeSection(const CNcbiRegistry ®istry)
bool m_OSGProcessorsEnabled
size_t m_MyNCBIErrorCacheBackOffMs
size_t m_MyNCBIOKCacheSize
void x_ReadMyNCBISection(const CNcbiRegistry ®istry)
unsigned int m_ExcludeCacheMaxSize
void Validate(CPSGAlerts &alerts)
unsigned short m_TcpMaxConn
void x_ReadAdminSection(const CNcbiRegistry ®istry, CPSGAlerts &alerts)
unsigned long m_SmallBlobSize
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
void x_ReadHealthSection(const CNcbiRegistry ®istry)
size_t m_ShutdownIfTooManyOpenFD
~SPubseqGatewaySettings()
unsigned int m_ListenerBacklog
bool m_AllowProcessorTiming
bool m_CDDProcessorsEnabled
unsigned int m_ExcludeCacheInactivityPurge
size_t m_MyNCBINotFoundCacheExpirationSec
unsigned long m_SendBlobIfSmall
size_t m_MyNCBIErrorCacheSize
bool m_WGSProcessorsEnabled
void x_ReadLmdbCacheSection(const CNcbiRegistry ®istry)
void x_ReadCassandraProcessorSection(const CNcbiRegistry ®istry)
void x_ReadDebugSection(const CNcbiRegistry ®istry)
unsigned long m_NStatBins
const unsigned long kNStatBins
const unsigned long kMinStatValue
const string kStatScaleType
const unsigned long kMaxStatValue
const unsigned long kTickSpan
static wxAcceleratorEntry entries[3]