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

Go to the SVN repository for this file.

1 #ifndef SETTINGS__HPP
2 #define SETTINGS__HPP
3 
4 /* $Id: settings.hpp 103042 2024-08-27 13:27:46Z satskyse $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Sergey Satskiy
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbireg.hpp>
36 
38 
39 class CPSGAlerts;
40 
41 
43 {
46 
47  void Read(const CNcbiRegistry & registry,
48  CPSGAlerts & alerts);
49  void Validate(CPSGAlerts & alerts);
51  const string & processor_id);
52  bool IsAuthProtectedCommand(const string & cmd) const;
53 
54  // [SERVER]
55  unsigned short m_HttpPort;
56  unsigned short m_HttpWorkers;
57  unsigned int m_ListenerBacklog;
58  unsigned short m_TcpMaxConn;
59  unsigned int m_TimeoutMs;
60  unsigned int m_MaxRetries;
61  unsigned long m_SendBlobIfSmall;
62  bool m_Log;
63  int m_MaxHops;
75 
76  // [STATISTICS]
77  unsigned long m_SmallBlobSize;
78  unsigned long m_MinStatValue;
79  unsigned long m_MaxStatValue;
80  unsigned long m_NStatBins;
82  unsigned long m_TickSpan;
84 
85 
86  // [LMDB_CACHE]
90 
91  // [AUTO_EXCLUDE]
92  unsigned int m_ExcludeCacheMaxSize;
95 
96  // [DEBUG]
99 
100  // [IPG]
103 
104  // [ADMIN]
105  string m_AuthToken;
106  vector<string> m_AuthCommands;
107 
108  // [SSL]
111  string m_SSLKeyFile;
112  string m_SSLCiphers;
113 
114  // [HEALTH]
115  vector<string> m_CriticalDataSources;
117 
118  // [CASSANDRA_PROCESSOR]
122 
123  // [LMDB_PROCESSOR]
126 
127  // [CDD_PROCESSOR]
131 
132  // [WGS_PROCESSOR]
136 
137  // [SNP_PROCESSOR]
141 
142  // [COUNTERS]
143  // Configured counter/statistics ID to name/description
145 
146  // [MY_NCBI]
152  string m_MyNCBIURL;
156 
157 private:
165  CPSGAlerts & alerts);
168  CPSGAlerts & alerts);
170  CPSGAlerts & alerts);
172  CPSGAlerts & alerts);
174  CPSGAlerts & alerts);
176  CPSGAlerts & alerts);
178  CPSGAlerts & alerts);
181 
182  unsigned long x_GetDataSize(const CNcbiRegistry & registry,
183  const string & section,
184  const string & entry,
185  unsigned long default_val);
186 };
187 
188 
189 #endif
190 
CNcbiRegistry –.
Definition: ncbireg.hpp:913
Definition: map.hpp:338
static CMemoryRegistry registry
Definition: cn3d_tools.cpp:81
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
Process information in the NCBI Registry, including working with configuration files.
USING_NCBI_SCOPE
Definition: settings.hpp:37
void Read(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:191
unsigned long m_MinStatValue
Definition: settings.hpp:78
double m_CassandraHealthTimeoutSec
Definition: settings.hpp:121
unsigned int m_TimeoutMs
Definition: settings.hpp:59
string m_WGSProcessorHealthCommand
Definition: settings.hpp:134
void x_ReadCountersSection(const CNcbiRegistry &registry)
Definition: settings.cpp:588
size_t m_SplitInfoBlobCacheSize
Definition: settings.hpp:67
unsigned long x_GetDataSize(const CNcbiRegistry &registry, const string &section, const string &entry, unsigned long default_val)
Definition: settings.cpp:985
vector< string > m_CriticalDataSources
Definition: settings.hpp:115
void x_ReadSNPProcessorSection(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:526
string m_SNPProcessorHealthCommand
Definition: settings.hpp:139
string m_CassandraProcessorHealthCommand
Definition: settings.hpp:120
map< string, tuple< string, string > > m_IdToNameAndDescription
Definition: settings.hpp:144
unsigned int m_ExcludeCachePurgePercentage
Definition: settings.hpp:93
void x_ReadLMDBProcessorSection(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:439
void x_ReadIPGSection(const CNcbiRegistry &registry)
Definition: settings.cpp:333
size_t m_MyNCBINotFoundCacheSize
Definition: settings.hpp:148
unsigned short m_HttpPort
Definition: settings.hpp:55
unsigned long m_MaxStatValue
Definition: settings.hpp:79
void x_ReadStatisticsSection(const CNcbiRegistry &registry)
Definition: settings.cpp:279
void x_ReadCassandraProcessorSection(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:409
void x_ReadServerSection(const CNcbiRegistry &registry)
Definition: settings.cpp:218
unsigned short m_HttpWorkers
Definition: settings.hpp:56
string m_ConfigurationDomain
Definition: settings.hpp:70
void x_ReadAutoExcludeSection(const CNcbiRegistry &registry)
Definition: settings.cpp:310
bool IsAuthProtectedCommand(const string &cmd) const
Definition: settings.cpp:1032
size_t m_MyNCBIErrorCacheBackOffMs
Definition: settings.hpp:151
void x_ReadCDDProcessorSection(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:466
void x_ReadMyNCBISection(const CNcbiRegistry &registry)
Definition: settings.cpp:556
unsigned int m_ExcludeCacheMaxSize
Definition: settings.hpp:92
void Validate(CPSGAlerts &alerts)
Definition: settings.cpp:648
unsigned short m_TcpMaxConn
Definition: settings.hpp:58
void x_ReadWGSProcessorSection(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:496
void x_ReadAdminSection(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:609
string m_LMDBProcessorHealthCommand
Definition: settings.hpp:124
unsigned long m_TickSpan
Definition: settings.hpp:82
unsigned long m_SmallBlobSize
Definition: settings.hpp:77
void x_ReadHealthSection(const CNcbiRegistry &registry, CPSGAlerts &alerts)
Definition: settings.cpp:355
size_t GetProcessorMaxConcurrency(const CNcbiRegistry &registry, const string &processor_id)
Definition: settings.cpp:1004
void x_ReadSSLSection(const CNcbiRegistry &registry)
Definition: settings.cpp:342
size_t m_ProcessorMaxConcurrency
Definition: settings.hpp:66
unsigned int m_MaxRetries
Definition: settings.hpp:60
size_t m_ShutdownIfTooManyOpenFD
Definition: settings.hpp:68
unsigned int m_ListenerBacklog
Definition: settings.hpp:57
string m_CDDProcessorHealthCommand
Definition: settings.hpp:129
unsigned int m_ExcludeCacheInactivityPurge
Definition: settings.hpp:94
size_t m_MyNCBINotFoundCacheExpirationSec
Definition: settings.hpp:149
unsigned long m_SendBlobIfSmall
Definition: settings.hpp:61
void x_ReadLmdbCacheSection(const CNcbiRegistry &registry)
Definition: settings.cpp:299
vector< string > m_AuthCommands
Definition: settings.hpp:106
void x_ReadDebugSection(const CNcbiRegistry &registry)
Definition: settings.cpp:324
unsigned long m_NStatBins
Definition: settings.hpp:80
size_t m_MyNCBIResolveTimeoutMs
Definition: settings.hpp:155
Modified on Wed Sep 04 14:59:34 2024 by modify_doxy.py rev. 669887