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

Go to the SVN repository for this file.

1 /* $Id: settings.cpp 103185 2024-09-20 12:14:40Z 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: Sergey Satskiy
27  *
28  * File Description:
29  *
30  */
31 #include <ncbi_pch.hpp>
32 
33 #include <corelib/ncbi_config.hpp>
35 
36 #include "settings.hpp"
39 #include "alerts.hpp"
40 #include "timing.hpp"
41 
42 
43 const string kServerSection = "SERVER";
44 const string kLmdbCacheSection = "LMDB_CACHE";
45 const string kStatisticsSection = "STATISTICS";
46 const string kAutoExcludeSection = "AUTO_EXCLUDE";
47 const string kDebugSection = "DEBUG";
48 const string kIPGSection = "IPG";
49 const string kSSLSection = "SSL";
50 const string kHealthSection = "HEALTH";
51 const string kCDDProcessorSection = "CDD_PROCESSOR";
52 const string kWGSProcessorSection = "WGS_PROCESSOR";
53 const string kSNPProcessorSection = "SNP_PROCESSOR";
54 const string kCassandraProcessorSection = "CASSANDRA_PROCESSOR";
55 const string kLMDBProcessorSection = "LMDB_PROCESSOR";
56 const string kAdminSection = "ADMIN";
57 const string kMyNCBISection = "MY_NCBI";
58 const string kCountersSection = "COUNTERS";
59 
60 
61 const unsigned short kWorkersDefault = 64;
62 const unsigned int kListenerBacklogDefault = 256;
63 const unsigned short kTcpMaxConnDefault = 4096;
64 const size_t kTcpConnHardSoftDiffDefault = 256;
66 const unsigned int kTimeoutDefault = 30000;
67 const unsigned int kMaxRetriesDefault = 2;
68 const string kDefaultRootKeyspace = "sat_info3";
69 const string kDefaultConfigurationDomain = "PSG";
70 const size_t kDefaultHttpMaxBacklog = 1024;
71 const size_t kDefaultHttpMaxRunning = 64;
72 const size_t kDefaultLogSamplingRatio = 0;
73 const size_t kDefaultLogTimingThreshold = 1000;
74 const unsigned long kDefaultSendBlobIfSmall = 10 * 1024;
75 const unsigned long kDefaultSmallBlobSize = 16;
76 const bool kDefaultLog = true;
77 const unsigned int kDefaultExcludeCacheMaxSize = 1000;
78 const unsigned int kDefaultExcludeCachePurgePercentage = 20;
79 const unsigned int kDefaultExcludeCacheInactivityPurge = 60;
80 const unsigned int kDefaultMaxHops = 2;
81 const bool kDefaultAllowIOTest = false;
82 const bool kDefaultAllowProcessorTiming = false;
83 const string kDefaultOnlyForProcessor = "";
84 const bool kDefaultLmdbReadAhead = false;
85 const double kDefaultResendTimeoutSec = 0.2;
86 const double kDefaultRequestTimeoutSec = 30.0;
87 const size_t kDefaultProcessorMaxConcurrency = 1200;
88 const size_t kDefaultSplitInfoBlobCacheSize = 1000;
89 const size_t kDefaultIPGPageSize = 1024;
90 const bool kDefaultEnableHugeIPG = true;
91 const string kDefaultAuthToken = "";
92 // All ADMIN/ urls except of 'info'
93 const string kDefaultAuthCommands = "config status shutdown get_alerts ack_alert statistics";
94 const bool kDefaultSSLEnable = false;
95 const string kDefaultSSLCertFile = "";
96 const string kDefaultSSLKeyFile = "";
97 const string kDefaultSSLCiphers = "EECDH+aRSA+AESGCM EDH+aRSA+AESGCM EECDH+aRSA EDH+aRSA !SHA !SHA256 !SHA384";
100 const string kDefaultCriticalDataSources = "cassandra";
101 const double kDefaultHealthTimeout = 0.5;
103 const string kDefaultLMDBProcessorHealthCommand = "/ID/resolve?seq_id=gi|2&use_cache=yes";
104 const double kDefaultLMDBHealthTimeoutSec = 0.0;
105 const string kDefaultCassandraProcessorHealthCommand = "/ID/resolve?seq_id=gi|2&use_cache=no";
108 const string kDefaultCDDProcessorHealthCommand = "/ID/get_na?seq_id=6&names=CDD";
109 const double kDefaultCDDHealthTimeoutSec = 0.0;
111 const string kDefaultWGSProcessorHealthCommand = "/ID/resolve?seq_id=EAB1000000&disable_processor=cassandra";
112 const double kDefaultWGSHealthTimeoutSec = 0.0;
114 const string kDefaultSNPProcessorHealthCommand = "/ID/get_na?seq_id_type=12&seq_id=568801899&seq_ids=ref|NT_187403.1&names=SNP";
115 const double kDefaultSNPHealthTimeoutSec = 0.0;
116 const size_t kDefaultMyNCBIOKCacheSize = 10000;
117 const size_t kDefaultMyNCBINotFoundCacheSize = 10000;
119 const size_t kDefaultMyNCBIErrorCacheSize = 10000;
121 const string kDefaultMyNCBIURL = "http://txproxy.linkerd.ncbi.nlm.nih.gov/v1/service/MyNCBIAccount?txsvc=MyNCBIAccount";
122 const string kDefaultMyNCBIHttpProxy = "linkerd:4140";
123 const size_t kDefaultMyNCBITimeoutMs = 100;
125 
126 
127 
129  m_HttpPort(0),
130  m_HttpWorkers(kWorkersDefault),
131  m_ListenerBacklog(kListenerBacklogDefault),
132  m_TcpMaxConn(kTcpMaxConnDefault),
133  m_TcpMaxConnSoftLimit(kTcpMaxConnSoftLimitDefault),
134  m_TimeoutMs(kTimeoutDefault),
135  m_MaxRetries(kMaxRetriesDefault),
136  m_SendBlobIfSmall(kDefaultSendBlobIfSmall),
137  m_Log(kDefaultLog),
138  m_MaxHops(kDefaultMaxHops),
139  m_ResendTimeoutSec(kDefaultResendTimeoutSec),
140  m_RequestTimeoutSec(kDefaultRequestTimeoutSec),
141  m_ProcessorMaxConcurrency(kDefaultProcessorMaxConcurrency),
142  m_SplitInfoBlobCacheSize(kDefaultSplitInfoBlobCacheSize),
143  m_ShutdownIfTooManyOpenFD(0),
144  m_RootKeyspace(kDefaultRootKeyspace),
145  m_ConfigurationDomain(kDefaultConfigurationDomain),
146  m_HttpMaxBacklog(kDefaultHttpMaxBacklog),
147  m_HttpMaxRunning(kDefaultHttpMaxRunning),
148  m_LogSamplingRatio(kDefaultLogSamplingRatio),
149  m_LogTimingThreshold(kDefaultLogTimingThreshold),
150  m_SmallBlobSize(kDefaultSmallBlobSize),
151  m_MinStatValue(kMinStatValue),
152  m_MaxStatValue(kMaxStatValue),
153  m_NStatBins(kNStatBins),
154  m_StatScaleType(kStatScaleType),
155  m_TickSpan(kTickSpan),
156  m_OnlyForProcessor(kDefaultOnlyForProcessor),
157  m_LmdbReadAhead(kDefaultLmdbReadAhead),
158  m_ExcludeCacheMaxSize(kDefaultExcludeCacheMaxSize),
159  m_ExcludeCachePurgePercentage(kDefaultExcludeCachePurgePercentage),
160  m_ExcludeCacheInactivityPurge(kDefaultExcludeCacheInactivityPurge),
161  m_AllowIOTest(kDefaultAllowIOTest),
162  m_AllowProcessorTiming(kDefaultAllowProcessorTiming),
163  m_SSLEnable(kDefaultSSLEnable),
164  m_SSLCiphers(kDefaultSSLCiphers),
165  m_HealthTimeoutSec(kDefaultHealthTimeout),
166  m_CassandraProcessorsEnabled(kDefaultCassandraProcessorsEnabled),
167  m_CassandraProcessorHealthCommand(kDefaultCassandraProcessorHealthCommand),
168  m_CassandraHealthTimeoutSec(kDefaultCassandraHealthTimeoutSec),
169  m_LMDBProcessorHealthCommand(kDefaultLMDBProcessorHealthCommand),
170  m_LMDBHealthTimeoutSec(kDefaultLMDBHealthTimeoutSec),
171  m_CDDProcessorsEnabled(kDefaultCDDProcessorsEnabled),
172  m_CDDProcessorHealthCommand(kDefaultCDDProcessorHealthCommand),
173  m_CDDHealthTimeoutSec(kDefaultCDDHealthTimeoutSec),
174  m_WGSProcessorsEnabled(kDefaultWGSProcessorsEnabled),
175  m_WGSProcessorHealthCommand(kDefaultWGSProcessorHealthCommand),
176  m_WGSHealthTimeoutSec(kDefaultWGSHealthTimeoutSec),
177  m_SNPProcessorsEnabled(kDefaultSNPProcessorsEnabled),
178  m_SNPProcessorHealthCommand(kDefaultSNPProcessorHealthCommand),
179  m_SNPHealthTimeoutSec(kDefaultSNPHealthTimeoutSec),
180  m_MyNCBIOKCacheSize(kDefaultMyNCBIOKCacheSize),
181  m_MyNCBINotFoundCacheSize(kDefaultMyNCBINotFoundCacheSize),
182  m_MyNCBINotFoundCacheExpirationSec(kDefaultMyNCBINotFoundCacheExpirationSec),
183  m_MyNCBIErrorCacheSize(kDefaultMyNCBIErrorCacheSize),
184  m_MyNCBIErrorCacheBackOffMs(kDefaultMyNCBIErrorCacheBackOffMs),
185  m_MyNCBIURL(kDefaultMyNCBIURL),
186  m_MyNCBIHttpProxy(kDefaultMyNCBIHttpProxy),
187  m_MyNCBITimeoutMs(kDefaultMyNCBITimeoutMs),
188  m_MyNCBIResolveTimeoutMs(kDefaultMyNCBIResolveTimeoutMs)
189 {}
190 
191 
193 {}
194 
195 
197  CPSGAlerts & alerts)
198 {
199  // Note: reading of some values in the [SERVER] depends if SSL is on/off
200  // So, reading of the SSL settings is done first
202 
203  x_ReadServerSection(registry, alerts);
209  x_ReadHealthSection(registry, alerts);
210  x_ReadAdminSection(registry, alerts);
211 
212  x_ReadCassandraProcessorSection(registry, alerts); // Must be after x_ReadHealthSection()
213  x_ReadLMDBProcessorSection(registry, alerts); // Must be after x_ReadHealthSection()
214  x_ReadCDDProcessorSection(registry, alerts); // Must be after x_ReadHealthSection()
215  x_ReadWGSProcessorSection(registry, alerts); // Must be after x_ReadHealthSection()
216  x_ReadSNPProcessorSection(registry, alerts); // Must be after x_ReadHealthSection()
217 
220 }
221 
222 
224  CPSGAlerts & alerts)
225 {
226 
227  if (!registry.HasEntry(kServerSection, "port"))
228  NCBI_THROW(CPubseqGatewayException, eConfigurationError,
229  "[" + kServerSection +
230  "]/port value is not found in the configuration "
231  "file. The port must be provided to run the server. "
232  "Exiting.");
233 
241  m_TcpMaxConnSoftLimit = registry.GetInt(kServerSection, "maxconnsoftlimit",
243  m_TimeoutMs = registry.GetInt(kServerSection, "optimeout",
245  m_MaxRetries = registry.GetInt(kServerSection, "maxretries",
247  m_RootKeyspace = registry.GetString(kServerSection, "root_keyspace",
249  m_ConfigurationDomain = registry.GetString(kServerSection, "configuration_domain",
251  m_HttpMaxBacklog = registry.GetInt(kServerSection, "http_max_backlog",
253  m_HttpMaxRunning = registry.GetInt(kServerSection, "http_max_running",
255  m_LogSamplingRatio = registry.GetInt(kServerSection, "log_sampling_ratio",
257  m_LogTimingThreshold = registry.GetInt(kServerSection, "log_timing_threshold",
260  "send_blob_if_small",
269  "ProcessorMaxConcurrency",
272  "split_info_blob_cache_size",
274 
275  if (m_SSLEnable) {
277  registry.GetInt(kServerSection, "ShutdownIfTooManyOpenFD",
279  } else {
281  registry.GetInt(kServerSection, "ShutdownIfTooManyOpenFD",
283  }
284 
285  if (m_TcpMaxConnSoftLimit == 0) {
286  string err_msg = "Invalid [SERVER]/maxconnsoftlimit value. "
287  "It must be > 0. Resetting to the default value (" +
288  to_string(kTcpMaxConnSoftLimitDefault) + ")";
289  alerts.Register(ePSGS_ConfigTcpMaxConnSoftLimit, err_msg);
290  PSG_ERROR(err_msg);
292  }
293 
294 
297  string err_msg = "Inconsistent configuration of the [SERVER]/maxconn value. "
298  "It must be >= [SERVER]/maxconnsoftlimit value. "
299  "Resetting to " +
300  to_string(m_TcpMaxConn);
301  alerts.Register(ePSGS_ConfigTcpMaxConn, err_msg);
302  PSG_ERROR(err_msg);
303  }
304 
305  // Min spare connections must not be less than
306  if (m_TcpMaxConn - m_TcpMaxConnSoftLimit < 16) {
308  string err_msg = "Inconsistent configuration of the [SERVER]/maxconn value. "
309  "It must be so that ([SERVER]/maxconn value - [SERVER]/maxconnsoftlimit value) >= 16. "
310  "Resetting to " +
311  to_string(m_TcpMaxConn);
312  alerts.Register(ePSGS_ConfigTcpMaxConn, err_msg);
313  PSG_ERROR(err_msg);
314  }
315 }
316 
317 
319 {
321  "small_blob_size", kDefaultSmallBlobSize);
323  "min", kMinStatValue);
325  "max", kMaxStatValue);
327  "n_bins", kNStatBins);
329  "type", kStatScaleType);
331  "tick_span", kTickSpan);
333  "only_for_processor",
335 }
336 
337 
339 {
341  "dbfile_si2csi", "");
343  "dbfile_bioseq_info", "");
345  "dbfile_blob_prop", "");
348 }
349 
350 
352 {
354  kAutoExcludeSection, "max_cache_size",
357  kAutoExcludeSection, "purge_percentage",
360  kAutoExcludeSection, "inactivity_purge_timeout",
362 }
363 
364 
366 {
367  m_AllowIOTest = registry.GetBool(kDebugSection, "psg_allow_io_test",
369  m_AllowProcessorTiming = registry.GetBool(kDebugSection, "allow_processor_timing",
371 }
372 
373 
375 {
376  m_IPGPageSize = registry.GetInt(kIPGSection, "page_size",
378  m_EnableHugeIPG = registry.GetBool(kIPGSection, "enable_huge_ipg",
380 }
381 
382 
384 {
386  "ssl_enable", kDefaultSSLEnable);
388  "ssl_cert_file", kDefaultSSLCertFile);
390  "ssl_key_file", kDefaultSSLKeyFile);
392  "ssl_ciphers", kDefaultSSLCiphers);
393 }
394 
395 
397  CPSGAlerts & alerts)
398 {
399  // Read a list of critical backends
400  string critical_data_sources = registry.GetString(kHealthSection,
401  "critical_data_sources",
403  NStr::Split(critical_data_sources, ", ", m_CriticalDataSources,
405  if (!m_CriticalDataSources.empty()) {
406  for (size_t k = 0; k < m_CriticalDataSources.size(); ++k) {
408  m_CriticalDataSources[k].begin(), ::tolower);
409  }
410  }
411 
412  // Remove duplicates
414  m_CriticalDataSources.erase(unique(m_CriticalDataSources.begin(),
415  m_CriticalDataSources.end()),
416  m_CriticalDataSources.end());
417 
418  // Sanity check
419  if (m_CriticalDataSources.size() == 1) {
420  if (m_CriticalDataSources[0] == "none") {
421  // Special case: only one item and this item is "none"
422  m_CriticalDataSources.clear();
423  }
424  } else {
425  vector<string>::iterator none_it = find(m_CriticalDataSources.begin(),
426  m_CriticalDataSources.end(),
427  "none");
428  if (none_it != m_CriticalDataSources.end()) {
429  m_CriticalDataSources.erase(none_it);
430  PSG_WARNING("The [HEALTH]/critical_data_sources value "
431  "has NONE together with other items. "
432  "The NONE item is ignored.");
433  }
434  }
435 
438  if (m_HealthTimeoutSec <= 0) {
439  string err_msg =
440  "The health timeout is out of range. It must be > 0. "
441  "Received: " + to_string(m_HealthTimeoutSec) + ". Reset to "
442  "default: " + to_string(kDefaultHealthTimeout);
443  alerts.Register(ePSGS_ConfigHealthTimeout, err_msg);
444  PSG_ERROR(err_msg);
446  }
447 }
448 
449 
451  CPSGAlerts & alerts)
452 {
459 
463  if (m_CassandraHealthTimeoutSec == 0.0) {
464  // Valid configuration: fall back to the default value from
465  // the [HEALTH] section
467  } else if (m_CassandraHealthTimeoutSec < 0) {
468  // Error
469  string err_msg =
470  "The cassandra health timeout is out of range. It must be >= 0. "
471  "Received: " + to_string(m_CassandraHealthTimeoutSec) + ". Reset to "
472  "default from the [HEALTH]/timeout: " + to_string(m_HealthTimeoutSec);
474  PSG_ERROR(err_msg);
476  }
477 }
478 
479 
481  CPSGAlerts & alerts)
482 {
484  registry.GetString(kLMDBProcessorSection, "health_command",
486 
488  registry.GetDouble(kLMDBProcessorSection, "health_timeout",
490  if (m_LMDBHealthTimeoutSec == 0.0) {
491  // Valid configuration: fall back to the default value from
492  // the [HEALTH] section
494  } else if (m_LMDBHealthTimeoutSec < 0) {
495  // Error
496  string err_msg =
497  "The LMDB health timeout is out of range. It must be >= 0. "
498  "Received: " + to_string(m_LMDBHealthTimeoutSec) + ". Reset to "
499  "default from the [HEALTH]/timeout: " + to_string(m_HealthTimeoutSec);
500  alerts.Register(ePSGS_ConfigLMDBHealthTimeout, err_msg);
501  PSG_ERROR(err_msg);
503  }
504 }
505 
506 
508  CPSGAlerts & alerts)
509 {
511  "enabled",
514  registry.GetString(kCDDProcessorSection, "health_command",
516 
518  registry.GetDouble(kCDDProcessorSection, "health_timeout",
520  if (m_CDDHealthTimeoutSec == 0.0) {
521  // Valid configuration: fall back to the default value from
522  // the [HEALTH] section
524  } else if (m_CDDHealthTimeoutSec < 0) {
525  // Error
526  string err_msg =
527  "The CDD health timeout is out of range. It must be >= 0. "
528  "Received: " + to_string(m_CDDHealthTimeoutSec) + ". Reset to "
529  "default from the [HEALTH]/timeout: " + to_string(m_HealthTimeoutSec);
530  alerts.Register(ePSGS_ConfigCDDHealthTimeout, err_msg);
531  PSG_ERROR(err_msg);
533  }
534 }
535 
536 
538  CPSGAlerts & alerts)
539 {
541  "enabled",
544  registry.GetString(kWGSProcessorSection, "health_command",
546 
548  registry.GetDouble(kWGSProcessorSection, "health_timeout",
550  if (m_WGSHealthTimeoutSec == 0.0) {
551  // Valid configuration: fall back to the default value from
552  // the [HEALTH] section
554  } else if (m_WGSHealthTimeoutSec < 0) {
555  // Error
556  string err_msg =
557  "The WGS health timeout is out of range. It must be >= 0. "
558  "Received: " + to_string(m_WGSHealthTimeoutSec) + ". Reset to "
559  "default from the [HEALTH]/timeout: " + to_string(m_HealthTimeoutSec);
560  alerts.Register(ePSGS_ConfigWGSHealthTimeout, err_msg);
561  PSG_ERROR(err_msg);
563  }
564 }
565 
566 
568  CPSGAlerts & alerts)
569 {
571  "enabled",
574  registry.GetString(kSNPProcessorSection, "health_command",
576 
578  registry.GetDouble(kSNPProcessorSection, "health_timeout",
580  if (m_SNPHealthTimeoutSec == 0.0) {
581  // Valid configuration: fall back to the default value from
582  // the [HEALTH] section
584  } else if (m_SNPHealthTimeoutSec < 0) {
585  // Error
586  string err_msg =
587  "The SNP health timeout is out of range. It must be >= 0. "
588  "Received: " + to_string(m_SNPHealthTimeoutSec) + ". Reset to "
589  "default from the [HEALTH]/timeout: " + to_string(m_HealthTimeoutSec);
590  alerts.Register(ePSGS_ConfigSNPHealthTimeout, err_msg);
591  PSG_ERROR(err_msg);
593  }
594 }
595 
596 
598 {
600  "ok_cache_size",
603  "not_found_cache_size",
606  kMyNCBISection, "not_found_cache_expiration_sec",
609  "error_cache_size",
612  "error_cache_back_off_ms",
615  "url",
618  "http_proxy",
621  "timeout_ms",
624  "resolve_timeout_ms",
626 }
627 
628 
630 {
631  list<string> entries;
633 
634  for(const auto & value_id : entries) {
635  string name_and_description = registry.Get(kCountersSection,
636  value_id);
637  string name;
638  string description;
639  if (NStr::SplitInTwo(name_and_description, ":::", name, description,
641  m_IdToNameAndDescription[value_id] = {name, description};
642  } else {
643  PSG_WARNING("Malformed counter [" << kCountersSection << "]/" <<
644  name << " information. Expected <name>:::<description");
645  }
646  }
647 }
648 
649 
651  CPSGAlerts & alerts)
652 {
653  try {
656  } catch (const CRegistryException & ex) {
657  string msg = "Decrypting error detected while reading "
658  "[" + kAdminSection + "]/auth_token value: " +
659  string(ex.what());
660  ERR_POST(msg);
662 
663  // Treat the value as a clear text
664  m_AuthToken = registry.GetString("ADMIN", "auth_token",
666  } catch (...) {
667  string msg = "Unknown decrypting error detected while reading "
668  "[" + kAdminSection + "]/auth_token value";
669  ERR_POST(msg);
671 
672  // Treat the value as a clear text
673  m_AuthToken = registry.GetString("ADMIN", "auth_token",
675  }
676 
677  string auth_commands = registry.GetString(kAdminSection, "auth_commands",
679  NStr::Split(auth_commands, " ", m_AuthCommands);
680  if (!m_AuthCommands.empty()) {
681  for (size_t k = 0; k < m_AuthCommands.size(); ++k) {
682  transform(m_AuthCommands[k].begin(), m_AuthCommands[k].end(),
683  m_AuthCommands[k].begin(), ::tolower);
684  }
685  }
686 }
687 
688 
690 {
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;
703 
704 
705  if (m_HttpPort < kHttpPortMin || m_HttpPort > kHttpPortMax) {
706  NCBI_THROW(CPubseqGatewayException, eConfigurationError,
707  "[" + kServerSection +
708  "]/port value is out of range. Allowed range: " +
709  to_string(kHttpPortMin) + "..." +
710  to_string(kHttpPortMax) + ". Received: " +
711  to_string(m_HttpPort));
712  }
713 
714  if (m_Si2csiDbFile.empty()) {
715  PSG_WARNING("[" + kLmdbCacheSection + "]/dbfile_si2csi is not found "
716  "in the ini file. No si2csi cache will be used.");
717  }
718 
719  if (m_BioseqInfoDbFile.empty()) {
720  PSG_WARNING("[" + kLmdbCacheSection + "]/dbfile_bioseq_info is not found "
721  "in the ini file. No bioseq_info cache will be used.");
722  }
723 
724  if (m_BlobPropDbFile.empty()) {
725  PSG_WARNING("[" + kLmdbCacheSection + "]/dbfile_blob_prop is not found "
726  "in the ini file. No blob_prop cache will be used.");
727  }
728 
729  if (m_HttpWorkers < kWorkersMin || m_HttpWorkers > kWorkersMax) {
730  string err_msg =
731  "The number of HTTP workers is out of range. Allowed "
732  "range: " + to_string(kWorkersMin) + "..." +
733  to_string(kWorkersMax) + ". Received: " +
734  to_string(m_HttpWorkers) + ". Reset to "
735  "default: " + to_string(kWorkersDefault);
736  alerts.Register(ePSGS_ConfigHttpWorkers, err_msg);
737  PSG_ERROR(err_msg);
739  }
740 
741  if (m_ListenerBacklog < kListenerBacklogMin ||
742  m_ListenerBacklog > kListenerBacklogMax) {
743  string err_msg =
744  "The listener backlog is out of range. Allowed "
745  "range: " + to_string(kListenerBacklogMin) + "..." +
746  to_string(kListenerBacklogMax) + ". Received: " +
747  to_string(m_ListenerBacklog) + ". Reset to "
748  "default: " + to_string(kListenerBacklogDefault);
749  alerts.Register(ePSGS_ConfigListenerBacklog, err_msg);
750  PSG_ERROR(err_msg);
752  }
753 
754  if (m_TcpMaxConn < kTcpMaxConnMin || m_TcpMaxConn > kTcpMaxConnMax) {
755  string err_msg =
756  "The max number of connections is out of range. Allowed "
757  "range: " + to_string(kTcpMaxConnMin) + "..." +
758  to_string(kTcpMaxConnMax) + ". Received: " +
759  to_string(m_TcpMaxConn) + ". Reset to "
760  "default: " + to_string(kTcpMaxConnDefault);
761  alerts.Register(ePSGS_ConfigMaxConnections, err_msg);
762  PSG_ERROR(err_msg);
764  }
765 
766  if (m_TimeoutMs < kTimeoutMsMin || m_TimeoutMs > kTimeoutMsMax) {
767  string err_msg =
768  "The operation timeout is out of range. Allowed "
769  "range: " + to_string(kTimeoutMsMin) + "..." +
770  to_string(kTimeoutMsMax) + ". Received: " +
771  to_string(m_TimeoutMs) + ". Reset to "
772  "default: " + to_string(kTimeoutDefault);
773  alerts.Register(ePSGS_ConfigTimeout, err_msg);
774  PSG_ERROR(err_msg);
776  }
777 
778  if (m_MaxRetries < kMaxRetriesMin || m_MaxRetries > kMaxRetriesMax) {
779  string err_msg =
780  "The max retries is out of range. Allowed "
781  "range: " + to_string(kMaxRetriesMin) + "..." +
782  to_string(kMaxRetriesMax) + ". Received: " +
783  to_string(m_MaxRetries) + ". Reset to "
784  "default: " + to_string(kMaxRetriesDefault);
785  alerts.Register(ePSGS_ConfigRetries, err_msg);
786  PSG_ERROR(err_msg);
788  }
789 
790  if (m_ExcludeCacheMaxSize < 0) {
791  string err_msg =
792  "The max exclude cache size must be a positive integer. "
793  "Received: " + to_string(m_ExcludeCacheMaxSize) + ". "
794  "Reset to 0 (exclude blobs cache is disabled)";
795  alerts.Register(ePSGS_ConfigExcludeCacheSize, err_msg);
796  PSG_ERROR(err_msg);
798  }
799 
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: " +
803  to_string(m_ExcludeCachePurgePercentage) + ". ";
804  if (m_ExcludeCacheMaxSize > 0) {
805  err_msg += "Reset to " +
807  PSG_ERROR(err_msg);
808  } else {
809  err_msg += "The provided value has no effect "
810  "because the exclude cache is disabled.";
811  PSG_WARNING(err_msg);
812  }
815  }
816 
818  string err_msg = "The exclude cache inactivity purge timeout must be "
819  "a positive integer greater than zero. Received: " +
820  to_string(m_ExcludeCacheInactivityPurge) + ". ";
821  if (m_ExcludeCacheMaxSize > 0) {
822  err_msg += "Reset to " +
824  PSG_ERROR(err_msg);
825  } else {
826  err_msg += "The provided value has no effect "
827  "because the exclude cache is disabled.";
828  PSG_WARNING(err_msg);
829  }
832  }
833 
834  if (m_HttpMaxBacklog <= 0) {
835  PSG_WARNING("Invalid " + kServerSection + "]/http_max_backlog value (" +
836  to_string(m_HttpMaxBacklog) + "). "
837  "The http max backlog must be greater than 0. The http max backlog is "
838  "reset to the default value (" +
839  to_string(kDefaultHttpMaxBacklog) + ").");
841  }
842 
843  if (m_HttpMaxRunning <= 0) {
844  PSG_WARNING("Invalid " + kServerSection + "]/http_max_running value (" +
845  to_string(m_HttpMaxRunning) + "). "
846  "The http max running must be greater than 0. The http max running is "
847  "reset to the default value (" +
848  to_string(kDefaultHttpMaxRunning) + ").");
850  }
851 
852  if (m_LogSamplingRatio < 0) {
853  PSG_WARNING("Invalid " + kServerSection + "]/log_sampling_ratio value (" +
854  to_string(m_LogSamplingRatio) + "). "
855  "The log sampling ratio must be greater or equal 0. The log sampling ratio is "
856  "reset to the default value (" +
857  to_string(kDefaultLogSamplingRatio) + ").");
859  }
860 
861  if (m_LogTimingThreshold < 0) {
862  PSG_WARNING("Invalid " + kServerSection + "]/log_timing_threshold value (" +
863  to_string(m_LogTimingThreshold) + "). "
864  "The log timing threshold must be greater or equal 0. The log timing threshold is "
865  "reset to the default value (" +
866  to_string(kDefaultLogTimingThreshold) + ").");
868  }
869 
870  if (m_MaxHops <= 0) {
871  PSG_WARNING("Invalid " + kServerSection + "]/max_hops value (" +
872  to_string(m_MaxHops) + "). "
873  "The max hops must be greater than 0. The max hops is "
874  "reset to the default value (" +
875  to_string(kDefaultMaxHops) + ").");
877  }
878 
879  bool stat_settings_good = true;
880  if (NStr::CompareNocase(m_StatScaleType, "log") != 0 &&
881  NStr::CompareNocase(m_StatScaleType, "linear") != 0) {
882  string err_msg = "Invalid [" + kStatisticsSection +
883  "]/type value '" + m_StatScaleType +
884  "'. Allowed values are: log, linear. "
885  "The statistics parameters are reset to default.";
886  alerts.Register(ePSGS_ConfigStatScaleType, err_msg);
887  PSG_ERROR(err_msg);
888  stat_settings_good = false;
889 
894  }
895 
896  if (stat_settings_good) {
898  string err_msg = "Invalid [" + kStatisticsSection +
899  "]/min and max values. The "
900  "max cannot be less than min. "
901  "The statistics parameters are reset to default.";
902  alerts.Register(ePSGS_ConfigStatMinMaxVal, err_msg);
903  PSG_ERROR(err_msg);
904  stat_settings_good = false;
905 
910  }
911  }
912 
913  if (stat_settings_good) {
914  if (m_NStatBins <= 0) {
915  string err_msg = "Invalid [" + kStatisticsSection +
916  "]/n_bins value. The "
917  "number of bins must be greater than 0. "
918  "The statistics parameters are reset to default.";
919  alerts.Register(ePSGS_ConfigStatNBins, err_msg);
920  PSG_ERROR(err_msg);
921 
922  // Uncomment if there will be more [STATISTICS] section parameters
923  // stat_settings_good = false;
924 
929  }
930  }
931 
932  if (m_TickSpan <= 0) {
933  PSG_WARNING("Invalid [" + kStatisticsSection + "]/tick_span value (" +
934  to_string(m_TickSpan) + "). "
935  "The tick span must be greater than 0. The tick span is "
936  "reset to the default value (" +
937  to_string(kTickSpan) + ").");
939  }
940 
941  if (m_ResendTimeoutSec < 0.0) {
942  PSG_WARNING("Invalid [" + kServerSection + "]/resend_timeout value (" +
943  to_string(m_ResendTimeoutSec) + "). "
944  "The resend timeout must be greater or equal to 0. The resend "
945  "timeout is reset to the default value (" +
946  to_string(kDefaultResendTimeoutSec) + ").");
948  }
949 
950  if (m_RequestTimeoutSec <= 0.0) {
951  PSG_WARNING("Invalid [" + kServerSection + "]/request_timeout value (" +
952  to_string(m_RequestTimeoutSec) + "). "
953  "The request timeout must be greater than 0. The request "
954  "timeout is reset to the default value (" +
955  to_string(kDefaultRequestTimeoutSec) + ").");
957  }
958 
959  if (m_ProcessorMaxConcurrency == 0) {
960  PSG_WARNING("Invalid [" + kServerSection +
961  "]/ProcessorMaxConcurrency value (" +
962  to_string(m_ProcessorMaxConcurrency) + "). "
963  "The processor max concurrency must be greater than 0. "
964  "The processor max concurrency is reset to the default value (" +
965  to_string(kDefaultProcessorMaxConcurrency) + ").");
967  }
968 
969  if (m_IPGPageSize <= 0) {
970  PSG_WARNING("The [" + kIPGSection + "]/page_size value must be > 0. "
971  "The [" + kIPGSection + "]/page_size is switched to the "
972  "default value: " + to_string(kDefaultIPGPageSize));
974  }
975 
976  if (m_SSLEnable) {
977  if (m_SSLCertFile.empty()) {
978  NCBI_THROW(CPubseqGatewayException, eConfigurationError,
979  "[" + kSSLSection + "]/ssl_cert_file value must be provided "
980  "if [" + kSSLSection + "]/ssl_enable is set to true");
981  }
982  if (m_SSLKeyFile.empty()) {
983  NCBI_THROW(CPubseqGatewayException, eConfigurationError,
984  "[" + kSSLSection + "]/ssl_key_file value must be provided "
985  "if [" + kSSLSection + "]/ssl_enable is set to true");
986  }
987 
988  if (!CFile(m_SSLCertFile).Exists()) {
989  NCBI_THROW(CPubseqGatewayException, eConfigurationError,
990  "[" + kSSLSection + "]/ssl_cert_file is not found");
991  }
992  if (!CFile(m_SSLKeyFile).Exists()) {
993  NCBI_THROW(CPubseqGatewayException, eConfigurationError,
994  "[" + kSSLSection + "]/ssl_key_file is not found");
995  }
996 
997  if (m_SSLCiphers.empty()) {
999  }
1000  }
1001 
1002  if (m_MyNCBIURL.empty()) {
1003  PSG_WARNING("The [" + kMyNCBISection + "]/url value must be not empty. "
1004  "The [" + kMyNCBISection + "]/url is switched to the "
1005  "default value: " + kDefaultMyNCBIURL);
1007  }
1008 
1009  if (m_MyNCBITimeoutMs <= 0) {
1010  PSG_WARNING("The [" + kMyNCBISection + "]/timeout_ms value must be > 0. "
1011  "The [" + kMyNCBISection + "]/timeout_ms is switched to the "
1012  "default value: " + to_string(kDefaultMyNCBITimeoutMs));
1014  }
1015 
1016  if (m_MyNCBIResolveTimeoutMs <= 0) {
1017  PSG_WARNING("The [" + kMyNCBISection + "]/resolve_timeout_ms value must be > 0. "
1018  "The [" + kMyNCBISection + "]/resolve_timeout_ms is switched to the "
1019  "default value: " + to_string(kDefaultMyNCBIResolveTimeoutMs));
1021  }
1022 }
1023 
1024 
1025 unsigned long
1027  const string & section,
1028  const string & entry,
1029  unsigned long default_val)
1030 {
1031  CConfig conf(registry);
1032  const CConfig::TParamTree * param_tree = conf.GetTree();
1033  const TPluginManagerParamTree * section_tree =
1034  param_tree->FindSubNode(section);
1035 
1036  if (!section_tree)
1037  return default_val;
1038 
1039  CConfig c((CConfig::TParamTree*)section_tree, eNoOwnership);
1040  return c.GetDataSize("psg", entry, CConfig::eErr_NoThrow,
1041  default_val);
1042 }
1043 
1044 
1046  const CNcbiRegistry & registry,
1047  const string & processor_id)
1048 {
1049  string section = processor_id + "_PROCESSOR";
1050 
1051  if (registry.HasEntry(section, "ProcessorMaxConcurrency")) {
1052  size_t limit = registry.GetInt(section,
1053  "ProcessorMaxConcurrency",
1055  if (limit == 0) {
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 (" +
1061  to_string(m_ProcessorMaxConcurrency) + ").");
1062  limit = m_ProcessorMaxConcurrency;
1063  }
1064 
1065  return limit;
1066  }
1067 
1068  // No processor specific value => server wide (or default)
1070 }
1071 
1072 
1074 {
1075  for (const auto & item: m_AuthCommands) {
1076  if (item == cmd) {
1077  return true;
1078  }
1079  }
1080  return false;
1081 }
1082 
@ ePSGS_ConfigListenerBacklog
Definition: alerts.hpp:50
@ ePSGS_ConfigRetries
Definition: alerts.hpp:53
@ ePSGS_ConfigAuthDecrypt
Definition: alerts.hpp:48
@ ePSGS_ConfigExcludeCachePurgeSize
Definition: alerts.hpp:55
@ ePSGS_ConfigSNPHealthTimeout
Definition: alerts.hpp:74
@ ePSGS_ConfigTcpMaxConn
Definition: alerts.hpp:76
@ ePSGS_ConfigHttpWorkers
Definition: alerts.hpp:49
@ ePSGS_ConfigStatScaleType
Definition: alerts.hpp:57
@ ePSGS_ConfigMaxConnections
Definition: alerts.hpp:51
@ ePSGS_ConfigLMDBHealthTimeout
Definition: alerts.hpp:71
@ ePSGS_ConfigCassandraHealthTimeout
Definition: alerts.hpp:70
@ ePSGS_ConfigTcpMaxConnSoftLimit
Definition: alerts.hpp:75
@ ePSGS_ConfigStatNBins
Definition: alerts.hpp:59
@ ePSGS_ConfigExcludeCacheInactivity
Definition: alerts.hpp:56
@ ePSGS_ConfigWGSHealthTimeout
Definition: alerts.hpp:73
@ ePSGS_ConfigTimeout
Definition: alerts.hpp:52
@ ePSGS_ConfigHealthTimeout
Definition: alerts.hpp:69
@ ePSGS_ConfigStatMinMaxVal
Definition: alerts.hpp:58
@ ePSGS_ConfigCDDHealthTimeout
Definition: alerts.hpp:72
@ ePSGS_ConfigExcludeCacheSize
Definition: alerts.hpp:54
void transform(Container &c, UnaryFunction *op)
Definition: chainer.hpp:86
CFile –.
Definition: ncbifile.hpp:1605
CNcbiRegistry –.
Definition: ncbireg.hpp:913
void Register(EPSGS_AlertType alert_type, const string &message)
Definition: alerts.cpp:101
CRegistryException –.
Definition: ncbireg.hpp:1005
definition of a Culling tree
Definition: ncbi_tree.hpp:100
static CMemoryRegistry registry
Definition: cn3d_tools.cpp:81
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
@ eNoOwnership
No ownership is assumed.
Definition: ncbi_types.h:135
string
Definition: cgiapp.hpp:690
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
Definition: ncbidiag.hpp:186
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
const TParamTree * GetTree() const
Uint8 GetDataSize(const string &driver_name, const string &param_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 &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 const string & Get(const string &section, const string &name, TFlags flags=0) const
Get the parameter value.
Definition: ncbireg.cpp:262
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 bool HasEntry(const string &section, const string &name=kEmptyStr, TFlags flags=0) const
Definition: ncbireg.cpp:290
virtual void EnumerateEntries(const string &section, list< string > *entries, TFlags flags=fAllLayers) const
Enumerate parameter names for a specified section.
Definition: ncbireg.cpp:514
string GetEncryptedString(const string &section, const string &name, TFlags flags=0, const string &password=kEmptyStr) const
Get a value that was (potentially) stored encrypted.
Definition: ncbireg.cpp:329
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
@ fPlaintextAllowed
Definition: ncbireg.hpp:99
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
Definition: ncbistr.cpp:219
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.
Definition: ncbistr.cpp:3452
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.
Definition: ncbistr.cpp:3545
@ fSplit_Truncate
Definition: ncbistr.hpp:2503
@ fSplit_MergeDelimiters
Merge adjacent delimiters.
Definition: ncbistr.hpp:2500
@ fSplit_ByPattern
Require full delimiter strings.
Definition: ncbistr.hpp:2504
const TTreeType * FindSubNode(const TKeyType &key) const
Non recursive linear scan of all subnodes, with key comparison.
Definition: ncbi_tree.hpp:940
constexpr auto sort(_Init &&init)
Parameters initialization model.
int tolower(Uchar c)
Definition: ncbictype.hpp:72
Plugin manager (using class factory paradigm).
#define PSG_ERROR(message)
#define PSG_WARNING(message)
const string kAutoExcludeSection
Definition: settings.cpp:46
const size_t kDefaultLogTimingThreshold
Definition: settings.cpp:73
const string kDefaultAuthToken
Definition: settings.cpp:91
const size_t kDefaultShutdownIfTooManyOpenFDforHTTPS
Definition: settings.cpp:99
const size_t kDefaultHttpMaxBacklog
Definition: settings.cpp:70
const string kHealthSection
Definition: settings.cpp:50
const size_t kDefaultIPGPageSize
Definition: settings.cpp:89
const unsigned int kDefaultMaxHops
Definition: settings.cpp:80
const unsigned long kDefaultSendBlobIfSmall
Definition: settings.cpp:74
const bool kDefaultSSLEnable
Definition: settings.cpp:94
const bool kDefaultAllowProcessorTiming
Definition: settings.cpp:82
const double kDefaultLMDBHealthTimeoutSec
Definition: settings.cpp:104
const string kDefaultCDDProcessorHealthCommand
Definition: settings.cpp:108
const string kWGSProcessorSection
Definition: settings.cpp:52
const size_t kTcpConnHardSoftDiffDefault
Definition: settings.cpp:64
const unsigned short kTcpMaxConnDefault
Definition: settings.cpp:63
const string kDefaultSSLKeyFile
Definition: settings.cpp:96
const string kDefaultOnlyForProcessor
Definition: settings.cpp:83
const bool kDefaultLog
Definition: settings.cpp:76
const string kDefaultSSLCertFile
Definition: settings.cpp:95
const string kServerSection
Definition: settings.cpp:43
const size_t kDefaultHttpMaxRunning
Definition: settings.cpp:71
const string kCassandraProcessorSection
Definition: settings.cpp:54
const string kCDDProcessorSection
Definition: settings.cpp:51
const bool kDefaultCassandraProcessorsEnabled
Definition: settings.cpp:102
const unsigned short kWorkersDefault
Definition: settings.cpp:61
const bool kDefaultSNPProcessorsEnabled
Definition: settings.cpp:113
const string kDefaultConfigurationDomain
Definition: settings.cpp:69
const size_t kDefaultMyNCBINotFoundCacheExpirationSec
Definition: settings.cpp:118
const string kDebugSection
Definition: settings.cpp:47
const unsigned int kListenerBacklogDefault
Definition: settings.cpp:62
const string kSSLSection
Definition: settings.cpp:49
const double kDefaultRequestTimeoutSec
Definition: settings.cpp:86
const string kCountersSection
Definition: settings.cpp:58
const size_t kDefaultSplitInfoBlobCacheSize
Definition: settings.cpp:88
const string kDefaultSNPProcessorHealthCommand
Definition: settings.cpp:114
const size_t kDefaultMyNCBIErrorCacheSize
Definition: settings.cpp:119
const size_t kDefaultMyNCBIOKCacheSize
Definition: settings.cpp:116
const string kDefaultRootKeyspace
Definition: settings.cpp:68
const size_t kDefaultLogSamplingRatio
Definition: settings.cpp:72
const double kDefaultCassandraHealthTimeoutSec
Definition: settings.cpp:106
const size_t kDefaultProcessorMaxConcurrency
Definition: settings.cpp:87
const string kDefaultCriticalDataSources
Definition: settings.cpp:100
const double kDefaultSNPHealthTimeoutSec
Definition: settings.cpp:115
const size_t kDefaultMyNCBIResolveTimeoutMs
Definition: settings.cpp:124
const unsigned long kDefaultSmallBlobSize
Definition: settings.cpp:75
const size_t kDefaultShutdownIfTooManyOpenFDforHTTP
Definition: settings.cpp:98
const unsigned int kDefaultExcludeCachePurgePercentage
Definition: settings.cpp:78
const string kMyNCBISection
Definition: settings.cpp:57
const unsigned int kDefaultExcludeCacheMaxSize
Definition: settings.cpp:77
const string kLMDBProcessorSection
Definition: settings.cpp:55
const size_t kDefaultMyNCBIErrorCacheBackOffMs
Definition: settings.cpp:120
const string kLmdbCacheSection
Definition: settings.cpp:44
const string kSNPProcessorSection
Definition: settings.cpp:53
const bool kDefaultCDDProcessorsEnabled
Definition: settings.cpp:107
const bool kDefaultAllowIOTest
Definition: settings.cpp:81
const bool kDefaultLmdbReadAhead
Definition: settings.cpp:84
const double kDefaultWGSHealthTimeoutSec
Definition: settings.cpp:112
const size_t kTcpMaxConnSoftLimitDefault
Definition: settings.cpp:65
const double kDefaultHealthTimeout
Definition: settings.cpp:101
const string kDefaultSSLCiphers
Definition: settings.cpp:97
const string kDefaultLMDBProcessorHealthCommand
Definition: settings.cpp:103
const string kDefaultCassandraProcessorHealthCommand
Definition: settings.cpp:105
const string kDefaultAuthCommands
Definition: settings.cpp:93
const size_t kDefaultMyNCBINotFoundCacheSize
Definition: settings.cpp:117
const double kDefaultResendTimeoutSec
Definition: settings.cpp:85
const unsigned int kMaxRetriesDefault
Definition: settings.cpp:67
const string kDefaultMyNCBIURL
Definition: settings.cpp:121
const bool kDefaultWGSProcessorsEnabled
Definition: settings.cpp:110
const string kDefaultMyNCBIHttpProxy
Definition: settings.cpp:122
const string kAdminSection
Definition: settings.cpp:56
const bool kDefaultEnableHugeIPG
Definition: settings.cpp:90
const unsigned int kTimeoutDefault
Definition: settings.cpp:66
const size_t kDefaultMyNCBITimeoutMs
Definition: settings.cpp:123
const string kIPGSection
Definition: settings.cpp:48
const string kDefaultWGSProcessorHealthCommand
Definition: settings.cpp:111
const unsigned int kDefaultExcludeCacheInactivityPurge
Definition: settings.cpp:79
const string kStatisticsSection
Definition: settings.cpp:45
const double kDefaultCDDHealthTimeoutSec
Definition: settings.cpp:109
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
void Read(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:196
unsigned long m_MinStatValue
Definition: settings.hpp:79
double m_CassandraHealthTimeoutSec
Definition: settings.hpp:122
unsigned int m_TimeoutMs
Definition: settings.hpp:60
string m_WGSProcessorHealthCommand
Definition: settings.hpp:135
void x_ReadCountersSection(const CNcbiRegistry &registry)
Definition: settings.cpp:629
size_t m_TcpMaxConnSoftLimit
Definition: settings.hpp:59
size_t m_SplitInfoBlobCacheSize
Definition: settings.hpp:68
void x_ReadServerSection(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:223
unsigned long x_GetDataSize(const CNcbiRegistry &registry, const string &section, const string &entry, unsigned long default_val)
Definition: settings.cpp:1026
vector< string > m_CriticalDataSources
Definition: settings.hpp:116
void x_ReadSNPProcessorSection(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:567
string m_SNPProcessorHealthCommand
Definition: settings.hpp:140
string m_CassandraProcessorHealthCommand
Definition: settings.hpp:121
map< string, tuple< string, string > > m_IdToNameAndDescription
Definition: settings.hpp:145
unsigned int m_ExcludeCachePurgePercentage
Definition: settings.hpp:94
void x_ReadLMDBProcessorSection(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:480
void x_ReadIPGSection(const CNcbiRegistry &registry)
Definition: settings.cpp:374
size_t m_MyNCBINotFoundCacheSize
Definition: settings.hpp:149
unsigned short m_HttpPort
Definition: settings.hpp:55
unsigned long m_MaxStatValue
Definition: settings.hpp:80
void x_ReadStatisticsSection(const CNcbiRegistry &registry)
Definition: settings.cpp:318
void x_ReadCassandraProcessorSection(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:450
unsigned short m_HttpWorkers
Definition: settings.hpp:56
string m_ConfigurationDomain
Definition: settings.hpp:71
void x_ReadAutoExcludeSection(const CNcbiRegistry &registry)
Definition: settings.cpp:351
bool IsAuthProtectedCommand(const string &cmd) const
Definition: settings.cpp:1073
size_t m_MyNCBIErrorCacheBackOffMs
Definition: settings.hpp:152
void x_ReadCDDProcessorSection(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:507
void x_ReadMyNCBISection(const CNcbiRegistry &registry)
Definition: settings.cpp:597
unsigned int m_ExcludeCacheMaxSize
Definition: settings.hpp:93
void Validate(CPSGAlerts &alerts)
Definition: settings.cpp:689
unsigned short m_TcpMaxConn
Definition: settings.hpp:58
void x_ReadWGSProcessorSection(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:537
void x_ReadAdminSection(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:650
string m_LMDBProcessorHealthCommand
Definition: settings.hpp:125
unsigned long m_TickSpan
Definition: settings.hpp:83
unsigned long m_SmallBlobSize
Definition: settings.hpp:78
void x_ReadHealthSection(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:396
size_t GetProcessorMaxConcurrency(const CNcbiRegistry &registry, const string &processor_id)
Definition: settings.cpp:1045
void x_ReadSSLSection(const CNcbiRegistry &registry)
Definition: settings.cpp:383
size_t m_ProcessorMaxConcurrency
Definition: settings.hpp:67
unsigned int m_MaxRetries
Definition: settings.hpp:61
size_t m_ShutdownIfTooManyOpenFD
Definition: settings.hpp:69
unsigned int m_ListenerBacklog
Definition: settings.hpp:57
string m_CDDProcessorHealthCommand
Definition: settings.hpp:130
unsigned int m_ExcludeCacheInactivityPurge
Definition: settings.hpp:95
size_t m_MyNCBINotFoundCacheExpirationSec
Definition: settings.hpp:150
unsigned long m_SendBlobIfSmall
Definition: settings.hpp:62
void x_ReadLmdbCacheSection(const CNcbiRegistry &registry)
Definition: settings.cpp:338
vector< string > m_AuthCommands
Definition: settings.hpp:107
void x_ReadDebugSection(const CNcbiRegistry &registry)
Definition: settings.cpp:365
unsigned long m_NStatBins
Definition: settings.hpp:81
size_t m_MyNCBIResolveTimeoutMs
Definition: settings.hpp:156
const unsigned long kNStatBins
Definition: timing.hpp:52
const unsigned long kMinStatValue
Definition: timing.hpp:50
const string kStatScaleType
Definition: timing.hpp:53
const unsigned long kMaxStatValue
Definition: timing.hpp:51
const unsigned long kTickSpan
Definition: timing.hpp:54
static wxAcceleratorEntry entries[3]
Modified on Fri Sep 20 14:58:30 2024 by modify_doxy.py rev. 669887