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

Go to the SVN repository for this file.

1 #ifndef PUBSEQ_GATEWAY__HPP
2 #define PUBSEQ_GATEWAY__HPP
3 
4 /* $Id: pubseq_gateway.hpp 102077 2024-03-27 16:04:29Z 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: Dmitri Dmitrienko
30  *
31  * File Description:
32  *
33  */
34 #include <string>
35 
36 #include <corelib/ncbiapp.hpp>
37 #include <corelib/ncbi_system.hpp>
38 #include <util/checksum.hpp>
39 
47 
48 #include "pending_operation.hpp"
49 #include "http_daemon.hpp"
51 #include "pubseq_gateway_stat.hpp"
52 #include "pubseq_gateway_utils.hpp"
53 #include "pubseq_gateway_types.hpp"
54 #include "exclude_blob_cache.hpp"
55 #include "split_info_cache.hpp"
56 #include "my_ncbi_cache.hpp"
57 #include "alerts.hpp"
58 #include "timing.hpp"
59 #include "psgs_dispatcher.hpp"
60 #include "osg_connection.hpp"
61 #include "psgs_uv_loop_binder.hpp"
62 #include "settings.hpp"
63 
64 
67 
68 
69 const long kMaxTestIOSize = 1000000000;
70 
71 
73 {
74 public:
77 
78  virtual void Init(void);
79  void ParseArgs(void);
80  void OpenCache(void);
81  bool OpenCass(void);
82  void CreateMyNCBIFactory(void);
83  bool PopulateCassandraMapping(bool initialization);
84  void CheckCassMapping(void);
85  void CloseCass(void);
86  optional<SSatInfoEntry> SatToKeyspace(int32_t sat)
87  { return m_CassSchemaProvider->GetBlobKeyspace(sat); }
88 
90  if (m_SplitInfoCache)
91  m_SplitInfoCache->Maintain();
92  }
93  void MaintainMyNCBICaches(void) {
94  if (m_MyNCBIOKCache)
95  m_MyNCBIOKCache->Maintain();
97  m_MyNCBINotFoundCache->Maintain();
99  m_MyNCBIErrorCache->Maintain();
100  }
101 
103  { return m_CassSchemaProvider->GetResolverKeyspace(); }
104 
105  optional<SSatInfoEntry> GetIPGKeyspace(void) const
106  { return m_CassSchemaProvider->GetIPGKeyspace(); }
107 
108  vector<SSatInfoEntry> GetBioseqNAKeyspaces(void) const
109  { return m_CassSchemaProvider->GetNAKeyspaces(); }
110 
112  { return m_LookupCache.get(); }
113 
115  { return m_ExcludeBlobCache.get(); }
116 
118  { return m_SplitInfoCache.get(); }
119 
121  { return m_MyNCBIOKCache.get(); }
122 
124  { return m_MyNCBINotFoundCache.get(); }
125 
127  { return m_MyNCBIErrorCache.get(); }
128 
129  shared_ptr<CPSGMessages> GetPublicCommentsMapping(void)
130  { return m_CassSchemaProvider->GetMessages(); }
131 
132  unsigned long GetSendBlobIfSmall(void) const
133  { return m_Settings.m_SendBlobIfSmall; }
134 
135  int OnBadURL(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
136  int OnGet(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
137  int OnGetBlob(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
138  int OnResolve(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
139  int OnGetTSEChunk(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
140  int OnGetNA(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
141  int OnAccessionVersionHistory(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
142  int OnIPGResolve(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
143  int OnHealth(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
144  int OnConfig(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
145  int OnInfo(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
146  int OnStatus(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
147  int OnShutdown(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
148  int OnGetAlerts(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
149  int OnAckAlert(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
150  int OnStatistics(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
151  int OnDispatcherStatus(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
152  int OnTestIO(CHttpRequest & req, shared_ptr<CPSGS_Reply> reply);
153 
154  virtual int Run(void);
155 
156  static CPubseqGatewayApp * GetInstance(void);
157 
158  void NotifyRequestFinished(size_t request_id)
159  { m_RequestDispatcher->NotifyRequestFinished(request_id); }
160 
162  { return *m_Timing.get(); }
163 
165  { return m_StartupDataState; }
166 
167  map<string, tuple<string, string>> GetIdToNameAndDescriptionMap(void) const
169 
170  unsigned int GetCassandraTimeout(void) const
171  { return m_Settings.m_TimeoutMs; }
172 
173  unsigned int GetCassandraMaxRetries(void) const
174  { return m_Settings.m_MaxRetries; }
175 
178 
181 
184 
187 
189  { return m_OSGConnectionPool; }
190 
193 
196  { return m_RequestDispatcher->SignalStartProcessing(processor); }
197 
198  size_t GetProcessorMaxConcurrency(const string & processor_id)
199  { return m_Settings.GetProcessorMaxConcurrency(GetConfig(), processor_id); }
200 
203  { m_RequestDispatcher->SignalFinishProcessing(processor, signal_source); }
204 
205  void SignalConnectionCanceled(size_t request_id)
206  { m_RequestDispatcher->SignalConnectionCanceled(request_id); }
207 
208  bool GetSSLEnable(void) const
209  { return m_Settings.m_SSLEnable; }
210 
211  string GetSSLCertFile(void) const
212  { return m_Settings.m_SSLCertFile; }
213 
214  string GetSSLKeyFile(void) const
215  { return m_Settings.m_SSLKeyFile; }
216 
217  string GetSSLCiphers(void) const
218  { return m_Settings.m_SSLCiphers; }
219 
220  size_t GetShutdownIfTooManyOpenFD(void) const
222 
223  int GetPageSize(void) const
224  { return m_Settings.m_IPGPageSize; }
225 
226  size_t GetHttpMaxBacklog(void) const
227  { return m_Settings.m_HttpMaxBacklog; }
228 
229  size_t GetHttpMaxRunning(void) const
230  { return m_Settings.m_HttpMaxRunning; }
231 
233  { return m_Alerts; }
234 
236  { return * m_Counters.get(); }
237 
238  void RegisterUVLoop(uv_thread_t uv_thread, uv_loop_t * uv_loop)
239  {
240  lock_guard<mutex> guard(m_ThreadToBinderGuard);
241 
242  m_ThreadToUVLoop[uv_thread] = uv_loop;
243  m_ThreadToBinder[uv_thread] =
244  unique_ptr<CPSGS_UvLoopBinder>(new CPSGS_UvLoopBinder(uv_loop));
245  }
246 
247  void UnregisterUVLoop(uv_thread_t uv_thread)
248  {
249  lock_guard<mutex> guard(m_ThreadToBinderGuard);
250  m_ThreadToBinder[uv_thread]->x_Unregister();
251  }
252 
253  void RegisterDaemonUVLoop(uv_thread_t uv_thread, uv_loop_t * uv_loop)
254  {
255  lock_guard<mutex> guard(m_ThreadToBinderGuard);
256 
257  m_ThreadToUVLoop[uv_thread] = uv_loop;
258  }
259 
260  uv_loop_t * GetUVLoop(void)
261  {
262  auto it = m_ThreadToUVLoop.find(uv_thread_self());
263  if (it == m_ThreadToUVLoop.end()) {
264  return nullptr;
265  }
266  return it->second;
267  }
268 
270  { m_RequestDispatcher->CancelAll(); }
271 
273  { return m_RequestDispatcher.get(); }
274 
275  CPSGS_UvLoopBinder & GetUvLoopBinder(uv_thread_t uv_thread_id);
276 
277  shared_ptr<CPSG_MyNCBIFactory> GetMyNCBIFactory(void)
278  { return m_MyNCBIFactory; }
279 
280 private:
282  {
283  bool m_Found;
285 
287  {}
288  };
289 
291  shared_ptr<CPSGS_Reply> reply,
292  const psg_time_point_t & now,
293  const string & message,
294  CRequestStatus::ECode status, int code, EDiagSev severity);
295 
297  CHttpRequest & req,
298  shared_ptr<CPSGS_Reply> reply,
299  const psg_time_point_t & now,
300  CTempString & seq_id, int & seq_id_type,
302  bool seq_id_is_optional=false);
303 
304  // Common URL parameters for all ../ID/.. requests
306  CHttpRequest & req,
307  shared_ptr<CPSGS_Reply> reply,
308  const psg_time_point_t & now,
310  int & hops,
311  vector<string> & enabled_processors,
312  vector<string> & disabled_processors,
313  bool & processor_events);
314 
315 private:
316  string x_GetCmdLineArguments(void) const;
319  CPSGS_Request::EPSGS_Type request_type,
320  CRequestStatus::ECode status,
321  size_t bytes_sent);
322 
323  SRequestParameter x_GetParam(CHttpRequest & req,
324  const string & name) const;
326  shared_ptr<CPSGS_Reply> reply,
327  const psg_time_point_t & now,
328  int & send_blob_if_small);
329  bool x_IsBoolParamValid(const string & param_name,
330  const CTempString & param_value,
331  string & err_msg) const;
332  bool x_ConvertIntParameter(const string & param_name,
333  const CTempString & param_value,
334  int & converted,
335  string & err_msg) const;
336  bool x_ConvertIntParameter(const string & param_name,
337  const CTempString & param_value,
338  int64_t & converted,
339  string & err_msg) const;
340  bool x_ConvertDoubleParameter(const string & param_name,
341  const CTempString & param_value,
342  double & converted,
343  string & err_msg) const;
345  shared_ptr<CPSGS_Reply> reply,
346  const psg_time_point_t & now,
348  bool x_GetOutputFormat(CHttpRequest & req,
349  shared_ptr<CPSGS_Reply> reply,
350  const psg_time_point_t & now,
353  string & fmt,
354  string & err_msg);
355  bool x_GetTSEOption(CHttpRequest & req,
356  shared_ptr<CPSGS_Reply> reply,
357  const psg_time_point_t & now,
359  bool x_GetLastModified(CHttpRequest & req,
360  shared_ptr<CPSGS_Reply> reply,
361  const psg_time_point_t & now,
362  int64_t & last_modified);
363  bool x_GetBlobId(CHttpRequest & req,
364  shared_ptr<CPSGS_Reply> reply,
365  const psg_time_point_t & now,
366  SPSGS_BlobId & blob_id);
367  bool x_GetResolveFlags(CHttpRequest & req,
368  shared_ptr<CPSGS_Reply> reply,
369  const psg_time_point_t & now,
370  SPSGS_ResolveRequest::TPSGS_BioseqIncludeData & include_data_flags);
371  bool x_GetId2Chunk(CHttpRequest & req,
372  shared_ptr<CPSGS_Reply> reply,
373  const psg_time_point_t & now,
374  int64_t & id2_chunk);
375  bool x_GetId2Info(CHttpRequest & req,
376  shared_ptr<CPSGS_Reply> reply,
377  const psg_time_point_t & now,
378  string & id2_info);
379  vector<string> x_GetExcludeBlobs(CHttpRequest & req) const;
381  shared_ptr<CPSGS_Reply> reply,
382  const psg_time_point_t & now,
385  shared_ptr<CPSGS_Reply> reply,
386  const psg_time_point_t & now,
389  shared_ptr<CPSGS_Reply> reply,
390  const psg_time_point_t & now,
391  bool & processor_events);
393  shared_ptr<CPSGS_Reply> reply,
394  const psg_time_point_t & now,
395  optional<bool> & include_hup);
396  bool x_GetHops(CHttpRequest & req,
397  shared_ptr<CPSGS_Reply> reply,
398  const psg_time_point_t & now,
399  int & hops);
400  bool x_GetResendTimeout(CHttpRequest & req,
401  shared_ptr<CPSGS_Reply> reply,
402  const psg_time_point_t & now,
403  double & resend_timeout);
405  shared_ptr<CPSGS_Reply> reply,
406  const psg_time_point_t & now,
407  bool & auto_blob_skipping);
409  shared_ptr<CPSGS_Reply> reply,
410  const psg_time_point_t & now,
411  vector<string> & enabled_processors,
412  vector<string> & disabled_processors);
413  bool x_GetNames(CHttpRequest & req,
414  shared_ptr<CPSGS_Reply> reply,
415  const psg_time_point_t & now,
416  vector<string> & names);
417  bool x_GetProtein(CHttpRequest & req,
418  shared_ptr<CPSGS_Reply> reply,
419  const psg_time_point_t & now,
420  optional<string> & protein);
421  bool x_GetIPG(CHttpRequest & req,
422  shared_ptr<CPSGS_Reply> reply,
423  const psg_time_point_t & now,
424  int64_t & ipg);
425  bool x_GetNucleotide(CHttpRequest & req,
426  shared_ptr<CPSGS_Reply> reply,
427  const psg_time_point_t & now,
428  optional<string> & nucleotide);
429  bool x_GetTimeSeries(CHttpRequest & req,
430  shared_ptr<CPSGS_Reply> reply,
431  const psg_time_point_t & now,
432  vector<pair<int, int>> & time_series);
433  bool x_GetSNPScaleLimit(CHttpRequest & req,
434  shared_ptr<CPSGS_Reply> reply,
435  const psg_time_point_t & now,
436  optional<CSeq_id::ESNPScaleLimit> & snp_scale_limit);
437 
438 private:
439  void x_FixIntrospectionVersion(void);
440  void x_FixIntrospectionBuildDate(void);
441 
442  void x_InsufficientArguments(shared_ptr<CPSGS_Reply> reply,
443  const psg_time_point_t & now,
444  const string & err_msg);
445  void x_MalformedArguments(shared_ptr<CPSGS_Reply> reply,
446  const psg_time_point_t & now,
447  const string & err_msg);
448  void x_Finish500(shared_ptr<CPSGS_Reply> reply,
449  const psg_time_point_t & now,
451  const string & err_msg);
452  bool x_IsShuttingDown(shared_ptr<CPSGS_Reply> reply,
453  const psg_time_point_t & now);
454  void x_RegisterProcessors(void);
456  shared_ptr<CPSGS_Request> request,
457  shared_ptr<CPSGS_Reply> reply);
458  void x_InitSSL(void);
459  bool x_CheckAuthorization(const string & request_name,
461  CHttpRequest & http_req,
462  shared_ptr<CPSGS_Reply> reply,
463  const psg_time_point_t & now);
464 
465 private:
467 
468  shared_ptr<CCassConnection> m_CassConnection;
469  shared_ptr<CCassConnectionFactory> m_CassConnectionFactory;
470  shared_ptr<CSatInfoSchemaProvider> m_CassSchemaProvider;
471  shared_ptr<CPSG_MyNCBIFactory> m_MyNCBIFactory;
472 
474 
475  unique_ptr<char []> m_IOTestBuffer;
476 
477  unique_ptr<CPubseqGatewayCache> m_LookupCache;
478  unique_ptr<CHttpDaemon> m_TcpDaemon;
479 
480  unique_ptr<CExcludeBlobCache> m_ExcludeBlobCache;
481  unique_ptr<CSplitInfoCache> m_SplitInfoCache;
482  unique_ptr<CMyNCBIOKCache> m_MyNCBIOKCache;
483  unique_ptr<CMyNCBINotFoundCache> m_MyNCBINotFoundCache;
484  unique_ptr<CMyNCBIErrorCache> m_MyNCBIErrorCache;
485 
487  unique_ptr<COperationTiming> m_Timing;
488  unique_ptr<CPSGSCounters> m_Counters;
489 
492 
493  // Serialized JSON introspection message
496 
498 
499  // Requests dispatcher
500  unique_ptr<CPSGS_Dispatcher> m_RequestDispatcher;
501 
502  // Mapping between the libuv thread id and the binder associated with the
503  // libuv worker thread loop
504  map<uv_thread_t,
505  unique_ptr<CPSGS_UvLoopBinder>> m_ThreadToBinder;
507  map<uv_thread_t, uv_loop_t *> m_ThreadToUVLoop;
508 
509 private:
511 };
512 
513 
514 #endif
Checksum and hash calculation classes.
HTTP request.
CNcbiLogFields –.
Definition: ncbidiag.hpp:2397
Based on various attributes of the request: {{seq_id}}; NA name; {{blob_id}}; etc (or a combination t...
unique_ptr< CExcludeBlobCache > m_ExcludeBlobCache
void x_Finish500(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, EPSGS_PubseqGatewayErrorCode code, const string &err_msg)
bool x_GetAccessionSubstitutionOption(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_RequestBase::EPSGS_AccSubstitutioOption &acc_subst_option)
CPubseqGatewayCache * GetLookupCache(void)
int OnConfig(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
void x_RegisterProcessors(void)
unique_ptr< CMyNCBIErrorCache > m_MyNCBIErrorCache
int OnGet(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
CMyNCBINotFoundCache * GetMyNCBINotFoundCache(void)
bool x_GetIPG(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int64_t &ipg)
void NotifyRequestFinished(size_t request_id)
vector< SSatInfoEntry > GetBioseqNAKeyspaces(void) const
map< uv_thread_t, unique_ptr< CPSGS_UvLoopBinder > > m_ThreadToBinder
unsigned int GetCassandraMaxRetries(void) const
bool x_GetId2Info(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, string &id2_info)
bool x_IsBoolParamValid(const string &param_name, const CTempString &param_value, string &err_msg) const
IPSGS_Processor::EPSGS_StartProcessing SignalStartProcessing(IPSGS_Processor *processor)
CNcbiLogFields m_LogFields
int OnShutdown(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
void x_MalformedArguments(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, const string &err_msg)
bool x_GetIntrospectionFormat(CHttpRequest &req, string &fmt, string &err_msg)
bool GetCDDProcessorsEnabled() const
int OnGetBlob(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
bool GetCassandraProcessorsEnabled(void) const
bool x_GetLastModified(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int64_t &last_modified)
bool x_GetHops(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int &hops)
bool x_DispatchRequest(CRef< CRequestContext > context, shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply)
bool x_GetIncludeHUPParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, optional< bool > &include_hup)
bool GetOSGProcessorsEnabled() const
int OnGetAlerts(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
bool x_GetNames(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, vector< string > &names)
void UnregisterUVLoop(uv_thread_t uv_thread)
void x_PrintRequestStop(CRef< CRequestContext > context, CPSGS_Request::EPSGS_Type request_type, CRequestStatus::ECode status, size_t bytes_sent)
void x_InsufficientArguments(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, const string &err_msg)
bool x_CheckAuthorization(const string &request_name, CRef< CRequestContext > context, CHttpRequest &http_req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now)
bool x_GetTSEOption(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_BlobRequestBase::EPSGS_TSEOption &tse_option)
virtual void Init(void)
uv_loop_t * GetUVLoop(void)
SPubseqGatewaySettings m_Settings
map< string, tuple< string, string > > GetIdToNameAndDescriptionMap(void) const
optional< SSatInfoEntry > SatToKeyspace(int32_t sat)
void RegisterDaemonUVLoop(uv_thread_t uv_thread, uv_loop_t *uv_loop)
virtual int Run(void)
void CreateMyNCBIFactory(void)
bool x_GetSeqIdResolveParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, bool &auto_blob_skipping)
size_t GetHttpMaxRunning(void) const
void MaintainSplitInfoBlobCache(void)
int OnStatistics(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
int OnTestIO(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
CPSGSCounters & GetCounters(void)
void SignalConnectionCanceled(size_t request_id)
bool x_GetProcessorEventsParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, bool &processor_events)
int OnAckAlert(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
int OnGetNA(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
unique_ptr< CHttpDaemon > m_TcpDaemon
unique_ptr< COperationTiming > m_Timing
bool x_GetNucleotide(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, optional< string > &nucleotide)
CMyNCBIErrorCache * GetMyNCBIErrorCache(void)
bool GetSNPProcessorsEnabled() const
string x_GetCmdLineArguments(void) const
bool x_GetSNPScaleLimit(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, optional< CSeq_id::ESNPScaleLimit > &snp_scale_limit)
unique_ptr< CMyNCBIOKCache > m_MyNCBIOKCache
shared_ptr< CSatInfoSchemaProvider > m_CassSchemaProvider
string GetSSLCertFile(void) const
void x_FixIntrospectionVersion(void)
void CancelAllProcessors(void)
bool x_ProcessCommonGetAndResolveParams(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, CTempString &seq_id, int &seq_id_type, SPSGS_RequestBase::EPSGS_CacheAndDbUse &use_cache, bool seq_id_is_optional=false)
bool x_GetResendTimeout(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, double &resend_timeout)
unique_ptr< CMyNCBINotFoundCache > m_MyNCBINotFoundCache
bool x_GetEnabledAndDisabledProcessors(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, vector< string > &enabled_processors, vector< string > &disabled_processors)
string GetSSLCiphers(void) const
void x_FixIntrospectionBuildDate(void)
int OnGetTSEChunk(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
unique_ptr< CPSGS_Dispatcher > m_RequestDispatcher
static CPubseqGatewayApp * sm_PubseqApp
optional< SSatInfoEntry > GetIPGKeyspace(void) const
int OnHealth(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
int OnStatus(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
void x_SendMessageAndCompletionChunks(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, const string &message, CRequestStatus::ECode status, int code, EDiagSev severity)
void SignalFinishProcessing(IPSGS_Processor *processor, CPSGS_Dispatcher::EPSGS_SignalSource signal_source)
unsigned long GetSendBlobIfSmall(void) const
CMyNCBIOKCache * GetMyNCBIOKCache(void)
bool x_GetResolveFlags(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_ResolveRequest::TPSGS_BioseqIncludeData &include_data_flags)
unique_ptr< CPSGSCounters > m_Counters
EPSGS_StartupDataState GetStartupDataState(void) const
size_t GetHttpMaxBacklog(void) const
unique_ptr< char[]> m_IOTestBuffer
bool x_GetCommonIDRequestParams(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_RequestBase::EPSGS_Trace &trace, int &hops, vector< string > &enabled_processors, vector< string > &disabled_processors, bool &processor_events)
void RegisterUVLoop(uv_thread_t uv_thread, uv_loop_t *uv_loop)
CExcludeBlobCache * GetExcludeBlobCache(void)
bool x_GetOutputFormat(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_ResolveRequest::EPSGS_OutputFormat &output_format)
bool x_ConvertIntParameter(const string &param_name, const CTempString &param_value, int &converted, string &err_msg) const
void CheckCassMapping(void)
COperationTiming & GetTiming(void)
shared_ptr< CPSGMessages > GetPublicCommentsMapping(void)
unsigned int GetCassandraTimeout(void) const
bool x_IsShuttingDown(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now)
int OnInfo(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
static CPubseqGatewayApp * GetInstance(void)
shared_ptr< CPSG_MyNCBIFactory > m_MyNCBIFactory
SRequestParameter x_GetParam(CHttpRequest &req, const string &name) const
shared_ptr< CCassConnectionFactory > m_CassConnectionFactory
size_t GetShutdownIfTooManyOpenFD(void) const
vector< string > x_GetExcludeBlobs(CHttpRequest &req) const
bool x_GetTimeSeries(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, vector< pair< int, int >> &time_series)
map< uv_thread_t, uv_loop_t * > m_ThreadToUVLoop
bool x_GetId2Chunk(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int64_t &id2_chunk)
int OnIPGResolve(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
bool PopulateCassandraMapping(bool initialization)
EPSGS_StartupDataState m_StartupDataState
int GetPageSize(void) const
bool x_GetTraceParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_RequestBase::EPSGS_Trace &trace)
CPSGS_Dispatcher * GetProcessorDispatcher(void)
CPSGAlerts & GetAlerts(void)
bool GetSSLEnable(void) const
shared_ptr< CCassConnection > m_CassConnection
shared_ptr< CPSG_MyNCBIFactory > GetMyNCBIFactory(void)
bool x_GetBlobId(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_BlobId &blob_id)
bool GetWGSProcessorsEnabled() const
int OnAccessionVersionHistory(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
unique_ptr< CPubseqGatewayCache > m_LookupCache
bool x_ConvertDoubleParameter(const string &param_name, const CTempString &param_value, double &converted, string &err_msg) const
int OnResolve(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
bool x_GetUseCacheParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_RequestBase::EPSGS_CacheAndDbUse &use_cache)
size_t GetProcessorMaxConcurrency(const string &processor_id)
CRef< psg::osg::COSGConnectionPool > m_OSGConnectionPool
CSplitInfoCache * GetSplitInfoCache(void)
void MaintainMyNCBICaches(void)
bool x_GetProtein(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, optional< string > &protein)
CPSGS_UvLoopBinder & GetUvLoopBinder(uv_thread_t uv_thread_id)
int OnBadURL(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
bool x_GetSendBlobIfSmallParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int &send_blob_if_small)
string GetSSLKeyFile(void) const
int OnDispatcherStatus(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)
unique_ptr< CSplitInfoCache > m_SplitInfoCache
CRef< CRequestContext > x_CreateRequestContext(CHttpRequest &req)
SSatInfoEntry GetBioseqKeyspace(void) const
const CRef< psg::osg::COSGConnectionPool > & GetOSGConnectionPool() const
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
Definition: tempstr.hpp:65
CTime –.
Definition: ncbitime.hpp:296
Interface class (and self-factory) for request processor objects that can retrieve data from a given ...
EPSGS_StartProcessing
Tells wether to continue or not after a processor called SignalStartProcessing() method.
static const struct name_t names[]
#define false
Definition: bool.h:36
Int4 int32_t
Int8 int64_t
static bool trace
#define CNcbiApplication
EDiagSev
Severity level for the posted diagnostics.
Definition: ncbidiag.hpp:650
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
USING_SCOPE(objects)
const long kMaxTestIOSize
USING_NCBI_SCOPE
EPSGS_StartupDataState
EPSGS_PubseqGatewayErrorCode
psg_clock_t::time_point psg_time_point_t
unsigned int m_TimeoutMs
Definition: settings.hpp:59
map< string, tuple< string, string > > m_IdToNameAndDescription
Definition: settings.hpp:135
size_t GetProcessorMaxConcurrency(const CNcbiRegistry &registry, const string &processor_id)
Definition: settings.cpp:834
unsigned int m_MaxRetries
Definition: settings.hpp:60
size_t m_ShutdownIfTooManyOpenFD
Definition: settings.hpp:68
unsigned long m_SendBlobIfSmall
Definition: settings.hpp:61
Definition: inftrees.h:24
static CS_CONTEXT * context
Definition: will_convert.c:21
Modified on Mon Apr 22 04:02:22 2024 by modify_doxy.py rev. 669887