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

Go to the SVN repository for this file.

1 /* $Id: resolve_base.cpp 103123 2024-09-11 18:57:02Z 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: base class for processors which need to resolve seq_id
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
34 
36 #include <corelib/ncbidiag.hpp>
37 
38 #include "pubseq_gateway.hpp"
39 #include "pubseq_gateway_utils.hpp"
41 #include "cass_fetch.hpp"
42 #include "psgs_request.hpp"
43 #include "psgs_reply.hpp"
44 #include "resolve_base.hpp"
45 
51 
52 using namespace std::placeholders;
53 
54 
56 {}
57 
58 
59 CPSGS_ResolveBase::CPSGS_ResolveBase(shared_ptr<CPSGS_Request> request,
60  shared_ptr<CPSGS_Reply> reply,
61  TSeqIdResolutionFinishedCB finished_cb,
62  TSeqIdResolutionErrorCB error_cb,
63  TSeqIdResolutionStartProcessingCB resolution_start_processing_cb) :
64  CPSGS_AsyncResolveBase(request, reply,
65  bind(&CPSGS_ResolveBase::x_ResolveSeqId,
66  this),
67  bind(&CPSGS_ResolveBase::x_OnSeqIdResolveFinished,
68  this, _1),
69  bind(&CPSGS_ResolveBase::x_OnSeqIdResolveError,
70  this, _1, _2, _3, _4, _5),
71  bind(&CPSGS_ResolveBase::x_OnResolutionGoodData,
72  this)),
73  CPSGS_AsyncBioseqInfoBase(request, reply,
74  bind(&CPSGS_ResolveBase::x_OnSeqIdResolveFinished,
75  this, _1),
76  bind(&CPSGS_ResolveBase::x_OnAsyncBioseqInfoResolveError,
77  this, _1, _2, _3, _4, _5)),
78  m_FinalFinishedCB(finished_cb),
79  m_FinalErrorCB(error_cb),
80  m_FinalStartProcessingCB(resolution_start_processing_cb),
81  m_AsyncStarted(false)
82 {}
83 
84 
86 {}
87 
88 
91 {
92  switch (m_Request->GetRequestType()) {
94  return m_Request->GetRequest<SPSGS_ResolveRequest>().m_UseCache;
96  return m_Request->GetRequest<SPSGS_BlobBySeqIdRequest>().m_UseCache;
98  return m_Request->GetRequest<SPSGS_AnnotRequest>().m_UseCache;
100  return m_Request->GetRequest<SPSGS_AccessionVersionHistoryRequest>().m_UseCache;
102  return m_Request->GetRequest<SPSGS_IPGResolveRequest>().m_UseCache;
103  default:
104  break;
105  }
107  "Not handled request type " +
108  to_string(static_cast<int>(m_Request->GetRequestType())));
109 }
110 
111 
112 bool
114  int16_t & effective_seq_id_type,
115  list<string> & secondary_id_list,
116  string & primary_id)
117 {
118  bool need_trace = m_Request->NeedTrace();
119 
120  if (!GetEffectiveSeqIdType(parsed_seq_id,
121  m_CurrentSeqIdToResolve->seq_id_type,
122  effective_seq_id_type, need_trace)) {
123  if (need_trace) {
124  m_Reply->SendTrace("OSLT has not been tried due to mismatch "
125  "between the parsed CSeq_id seq_id_type and "
126  "the URL provided one",
127  m_Request->GetStartTimestamp());
128  }
129  return false;
130  }
131 
132  try {
133  primary_id = parsed_seq_id.ComposeOSLT(&secondary_id_list,
135  } catch (...) {
136  if (need_trace) {
137  m_Reply->SendTrace("OSLT call failure (exception)",
138  m_Request->GetStartTimestamp());
139  }
140  return false;
141  }
142 
143  if (need_trace) {
144  string trace_msg("OSLT succeeded");
145  trace_msg += "\nOSLT primary id: " + primary_id;
146 
147  if (secondary_id_list.empty()) {
148  trace_msg += "\nOSLT secondary id list is empty";
149  } else {
150  for (const auto & item : secondary_id_list) {
151  trace_msg += "\nOSLT secondary id: " + item;
152  }
153  }
154  m_Reply->SendTrace(trace_msg, m_Request->GetStartTimestamp());
155  }
156 
157  return true;
158 }
159 
160 
163  const string & primary_id,
164  int16_t effective_version,
165  int16_t effective_seq_id_type,
166  SBioseqResolution & bioseq_resolution)
167 {
168  EPSGS_CacheLookupResult bioseq_cache_lookup_result = ePSGS_CacheNotHit;
169 
170  if (!primary_id.empty()) {
171  CPSGCache psg_cache(true, m_Request, m_Reply);
172 
173  // Try BIOSEQ_INFO
174  CBioseqInfoRecord bioseq_info;
175  bioseq_info.SetAccession(primary_id);
176  bioseq_info.SetVersion(effective_version);
177  bioseq_info.SetSeqIdType(effective_seq_id_type);
178  bioseq_resolution.SetBioseqInfo(bioseq_info);
179 
180  bioseq_cache_lookup_result = psg_cache.LookupBioseqInfo(
181  this, bioseq_resolution);
182  if (bioseq_cache_lookup_result == ePSGS_CacheHit) {
183  bioseq_resolution.m_ResolutionResult = ePSGS_BioseqCache;
184  return ePSGS_CacheHit;
185  }
186 
187  bioseq_resolution.Reset();
188  }
189  return bioseq_cache_lookup_result;
190 }
191 
192 
195  const string & secondary_id,
196  int16_t effective_seq_id_type,
197  SBioseqResolution & bioseq_resolution)
198 {
199  CBioseqInfoRecord bioseq_info;
200 
201  bioseq_info.SetAccession(secondary_id);
202  bioseq_info.SetSeqIdType(effective_seq_id_type);
203  bioseq_resolution.SetBioseqInfo(bioseq_info);
204 
205  CPSGCache psg_cache(true, m_Request, m_Reply);
206  auto si2csi_cache_lookup_result =
207  psg_cache.LookupSi2csi(this, bioseq_resolution);
208  if (si2csi_cache_lookup_result == ePSGS_CacheHit) {
209  bioseq_resolution.m_ResolutionResult = ePSGS_Si2csiCache;
210  return ePSGS_CacheHit;
211  }
212 
213  bioseq_resolution.Reset();
214 
215  if (si2csi_cache_lookup_result == ePSGS_CacheFailure)
216  return ePSGS_CacheFailure;
217  return ePSGS_CacheNotHit;
218 }
219 
220 
223 {
224  // Capitalize seq_id
225  string upper_seq_id = m_CurrentSeqIdToResolve->seq_id;
226  NStr::ToUpper(upper_seq_id);
227 
228  auto seq_id_type = m_CurrentSeqIdToResolve->seq_id_type;
229  auto cache_lookup_result = x_ResolveSecondaryOSLTInCache(
230  upper_seq_id, seq_id_type,
231  bioseq_resolution);
232 
233  if (cache_lookup_result == ePSGS_CacheFailure) {
234  bioseq_resolution.Reset();
235  bioseq_resolution.m_Error.m_ErrorMessage = "Cache lookup failure";
237  }
238 
239  return cache_lookup_result;
240 }
241 
242 
243 void
245  CSeq_id & parsed_seq_id,
246  int16_t effective_seq_id_type,
247  const list<string> & secondary_id_list,
248  const string & primary_id,
249  SBioseqResolution & bioseq_resolution)
250 {
251  const CTextseq_id * text_seq_id = parsed_seq_id.GetTextseq_Id();
252  int16_t effective_version = GetEffectiveVersion(text_seq_id);
253  bool cache_failure = false;
254 
255  if (!primary_id.empty()) {
256  auto cache_lookup_result =
257  x_ResolvePrimaryOSLTInCache(primary_id, effective_version,
258  effective_seq_id_type,
259  bioseq_resolution);
260  if (cache_lookup_result == ePSGS_CacheHit)
261  return;
262  if (cache_lookup_result == ePSGS_CacheFailure)
263  cache_failure = true;
264  }
265 
266  for (const auto & secondary_id : secondary_id_list) {
267  auto cache_lookup_result =
268  x_ResolveSecondaryOSLTInCache(secondary_id,
269  effective_seq_id_type,
270  bioseq_resolution);
271  if (cache_lookup_result == ePSGS_CacheHit)
272  return;
273  if (cache_lookup_result == ePSGS_CacheFailure) {
274  cache_failure = true;
275  break;
276  }
277  }
278 
279  // Try cache as it came from URL
280  // The primary id may match the URL given seq_id so it makes sense to
281  // exclude trying the very same string in x_ResolveAsIsInCache(). The
282  // x_ResolveAsIsInCache() capitalizes the url seq id so the capitalized
283  // versions need to be compared
284  string upper_seq_id = m_CurrentSeqIdToResolve->seq_id;
285  NStr::ToUpper(upper_seq_id);
286  auto cache_lookup_result = ePSGS_CacheNotHit;
287 
288  if (primary_id != upper_seq_id)
289  cache_lookup_result = x_ResolveAsIsInCache(bioseq_resolution);
290 
291  if (cache_lookup_result == ePSGS_CacheHit)
292  return;
293  if (cache_lookup_result == ePSGS_CacheFailure)
294  cache_failure = true;
295 
296  bioseq_resolution.Reset();
297 
298  if (cache_failure) {
299  bioseq_resolution.m_Error.m_ErrorMessage = "Cache lookup failure";
301  }
302 }
303 
304 
305 void
307 {
308  // The ID/get_na request is special. It may select a seq_id to resolve not
309  // from the input seq_id but from the other_seq_ids list. The setup method
310  // below handles that logic and saves the choice in the member variables
311  // regardless of the request type uniformely.
313 
314  x_ResolveSeqId();
315 }
316 
317 void CPSGS_ResolveBase::ResolveInputSeqId(const string & seq_id,
318  int16_t seq_id_type)
319 {
320  SetupSeqIdToResolve(seq_id, seq_id_type);
321  x_ResolveSeqId();
322 }
323 
324 
326 {
327  SBioseqResolution bioseq_resolution;
328  auto app = CPubseqGatewayApp::GetInstance();
329  string parse_err_msg;
330  CSeq_id oslt_seq_id;
331  auto parsing_result = ParseInputSeqId(oslt_seq_id,
332  m_CurrentSeqIdToResolve->seq_id,
333  m_CurrentSeqIdToResolve->seq_id_type, &parse_err_msg);
334 
335  // The results of the ComposeOSLT are used in both cache and DB
336  int16_t effective_seq_id_type;
337  list<string> secondary_id_list;
338  string primary_id;
339  bool composed_ok = false;
340  if (parsing_result == ePSGS_ParsedOK) {
341  composed_ok = x_ComposeOSLT(oslt_seq_id, effective_seq_id_type,
342  secondary_id_list, primary_id);
343  }
344 
345  auto request_use_cache = x_GetRequestUseCache();
346  if (request_use_cache != SPSGS_RequestBase::ePSGS_DbOnly) {
347  // Try cache
348  if (composed_ok)
349  x_ResolveViaComposeOSLTInCache(oslt_seq_id, effective_seq_id_type,
350  secondary_id_list, primary_id,
351  bioseq_resolution);
352  else
353  x_ResolveAsIsInCache(bioseq_resolution);
354 
355  if (bioseq_resolution.IsValid()) {
356  // Special case for the seq_id like gi|156232
357  bool continue_with_cassandra = false;
358  if (bioseq_resolution.m_ResolutionResult == ePSGS_Si2csiCache) {
360  bioseq_resolution.GetBioseqInfo())) {
361  // This is an optimization. Try to find the record in the
362  // BIOSEQ_INFO only if needed.
363  CPSGCache psg_cache(true, m_Request, m_Reply);
364  auto bioseq_cache_lookup_result =
365  psg_cache.LookupBioseqInfo(this, bioseq_resolution);
366 
367  if (bioseq_cache_lookup_result != ePSGS_CacheHit) {
368  // Not found or error
369  continue_with_cassandra = true;
370  bioseq_resolution.Reset();
371  } else {
372  bioseq_resolution.m_ResolutionResult = ePSGS_BioseqCache;
373 
374  auto adj_result = AdjustBioseqAccession(
375  bioseq_resolution);
376  if (adj_result == ePSGS_LogicError ||
377  adj_result == ePSGS_SeqIdsEmpty) {
378  continue_with_cassandra = true;
379  bioseq_resolution.Reset();
380  }
381  }
382  }
383  } else {
384  // The result is coming from the BIOSEQ_INFO cache. Need to try
385  // the adjustment
386  auto adj_result = AdjustBioseqAccession(bioseq_resolution);
387  if (adj_result == ePSGS_LogicError ||
388  adj_result == ePSGS_SeqIdsEmpty) {
389  continue_with_cassandra = true;
390  bioseq_resolution.Reset();
391  }
392  }
393 
394  if (!continue_with_cassandra) {
395  x_OnSeqIdResolveFinished(std::move(bioseq_resolution));
396  return;
397  }
398  }
399  }
400 
401  if (request_use_cache != SPSGS_RequestBase::ePSGS_CacheOnly) {
402  // Need to initiate async DB resolution
403 
404  // Memorize an error if there was one
405  if (! parse_err_msg.empty() &&
406  ! bioseq_resolution.m_Error.HasError()) {
407  bioseq_resolution.m_Error.m_ErrorMessage = parse_err_msg;
409  }
410 
411  // Async request
412  m_AsyncStarted = true;
414  GetEffectiveVersion(oslt_seq_id.GetTextseq_Id()),
415  effective_seq_id_type,
416  std::move(secondary_id_list),
417  std::move(primary_id),
418  composed_ok,
419  std::move(bioseq_resolution));
420 
421  // Async resolver will call a callback
422  return;
423  }
424 
425  // Finished with resolution:
426  // - not found
427  // - parsing error
428  // - LMDB error
429  app->GetCounters().Increment(this,
431 
432  if (bioseq_resolution.m_Error.HasError()) {
434  bioseq_resolution.m_Error.m_ErrorCode);
435  } else if (!parse_err_msg.empty()) {
437  }
438 
439  if (MoveToNextSeqId()) {
440  x_ResolveSeqId();
441  return;
442  }
443 
450 }
451 
452 
455 {
457 
458  // The method is to support the 'health' and 'deep-health' URLs.
459  // The only cache needs to be tried and no writing to the reply is allowed
460  SBioseqResolution bioseq_resolution;
461  string parse_err_msg;
462  CSeq_id oslt_seq_id;
463  auto parsing_result = ParseInputSeqId(oslt_seq_id,
464  m_CurrentSeqIdToResolve->seq_id,
465  m_CurrentSeqIdToResolve->seq_id_type, &parse_err_msg);
466 
467  // The results of the ComposeOSLT are used in both cache and DB
468  int16_t effective_seq_id_type;
469  list<string> secondary_id_list;
470  string primary_id;
471  bool composed_ok = false;
472  if (parsing_result == ePSGS_ParsedOK) {
473  composed_ok = x_ComposeOSLT(oslt_seq_id, effective_seq_id_type,
474  secondary_id_list, primary_id);
475  }
476 
477  // Try cache unconditionally
478  if (composed_ok)
479  x_ResolveViaComposeOSLTInCache(oslt_seq_id, effective_seq_id_type,
480  secondary_id_list, primary_id,
481  bioseq_resolution);
482  else
483  x_ResolveAsIsInCache(bioseq_resolution);
484 
485 
486  if (!bioseq_resolution.IsValid()) {
487  if (!bioseq_resolution.m_Error.HasError()) {
488  if (!parse_err_msg.empty()) {
489  bioseq_resolution.m_Error.m_ErrorMessage = parse_err_msg;
490  }
491  }
492  }
493 
494  return bioseq_resolution;
495 }
496 
497 
498 void
500  CRequestStatus::ECode status,
501  int code,
502  EDiagSev severity,
503  const string & message,
504  EPSGS_LoggingFlag loging_flag)
505 {
506  auto app = CPubseqGatewayApp::GetInstance();
507  if (status == CRequestStatus::e404_NotFound) {
508  app->GetTiming().Register(this, eResolutionNotFound, eOpStatusNotFound,
509  m_Request->GetStartTimestamp());
510  if (m_AsyncStarted)
511  app->GetTiming().Register(this, eResolutionCass, eOpStatusNotFound,
513  else
514  app->GetTiming().Register(this, eResolutionLmdb, eOpStatusNotFound,
515  m_Request->GetStartTimestamp());
516  }
517  else {
518  app->GetTiming().Register(this, eResolutionError, eOpStatusNotFound,
519  m_Request->GetStartTimestamp());
520  }
521 
522  m_FinalErrorCB(status, code, severity, message, loging_flag);
523 }
524 
525 
526 void
528  CRequestStatus::ECode status,
529  int code,
530  EDiagSev severity,
531  const string & message,
532  EPSGS_LoggingFlag loging_flag)
533 {
534  if (!message.empty()) {
535  m_ResolveErrors.AppendError(message, status);
536  }
537 
538  if (MoveToNextSeqId()) {
539  x_ResolveSeqId();
540  return;
541  }
542 
545  code, severity,
548  loging_flag);
549 }
550 
551 
552 // Called only in case of a success
554  SBioseqResolution && bioseq_resolution)
555 {
556  // A few cases here: comes from cache or DB
557  // ePSGS_Si2csiCache, ePSGS_Si2csiDB, ePSGS_BioseqCache, ePSGS_BioseqDB
558  if (bioseq_resolution.m_ResolutionResult == ePSGS_Si2csiDB ||
559  bioseq_resolution.m_ResolutionResult == ePSGS_Si2csiCache) {
560  // We have the following fields at hand:
561  // - accession, version, seq_id_type, gi
562  // May be it is what the user asked for
563  if (!CanSkipBioseqInfoRetrieval(bioseq_resolution.GetBioseqInfo())) {
564  // Need to pull the full bioseq info
565  CPSGCache psg_cache(m_Request, m_Reply);
566  auto cache_lookup_result =
567  psg_cache.LookupBioseqInfo(this, bioseq_resolution);
568  if (cache_lookup_result != ePSGS_CacheHit) {
569  // No cache hit (or not allowed); need to get to DB if allowed
571  // Async DB query
572 
573  // To have the proper timing registered in the errors
574  // handler
575  m_AsyncStarted = true;
576 
577  if (bioseq_resolution.m_CassQueryCount == 0) {
578  // It now became cassandra based so need to memorize
579  // the start timestamp
580  SetAsyncResolutionStartTimestamp(psg_clock_t::now());
581  }
582 
584  std::move(bioseq_resolution));
585  return;
586  }
587 
589  "Data inconsistency: the bioseq key info was "
590  "resolved for seq_id " + m_CurrentSeqIdToResolve->seq_id +
591  " but the bioseq info is not found",
593 
594  if (MoveToNextSeqId()) {
595  x_ResolveSeqId();
596  return;
597  }
598 
599  // It is a bioseq inconsistency case
605  return;
606  } else {
607  bioseq_resolution.m_ResolutionResult = ePSGS_BioseqCache;
608  }
609  }
610  }
611 
612  // All good
614  x_RegisterSuccessTiming(bioseq_resolution);
615  m_FinalFinishedCB(std::move(bioseq_resolution));
616 }
617 
618 
619 void
621  const SBioseqResolution & bioseq_resolution)
622 {
623  auto app = CPubseqGatewayApp::GetInstance();
624 
625  // Overall timing, regardless how it was done
626  app->GetTiming().Register(this, eResolutionFound, eOpStatusFound,
627  m_Request->GetStartTimestamp());
628 
629  if (bioseq_resolution.m_CassQueryCount > 0) {
630  // Regardless how many requests
631  app->GetTiming().Register(this, eResolutionCass, eOpStatusFound,
633 
634  // Separated by the number of requests
635  app->GetTiming().Register(this, eResolutionFoundInCassandra,
638  bioseq_resolution.m_CassQueryCount);
639  } else {
640  app->GetTiming().Register(this, eResolutionLmdb, eOpStatusFound,
641  m_Request->GetStartTimestamp());
642  }
643 }
644 
645 
647 {
649 }
650 
function< void(SBioseqResolution &&async_bioseq_resolution)> TSeqIdResolutionFinishedCB
function< void(void)> TSeqIdResolutionStartProcessingCB
function< void(CRequestStatus::ECode status, int code, EDiagSev severity, const string &message, EPSGS_LoggingFlag logging_flag)> TSeqIdResolutionErrorCB
CBioseqInfoRecord & SetSeqIdType(TSeqIdType value)
Definition: record.hpp:106
CBioseqInfoRecord & SetVersion(TVersion value)
Definition: record.hpp:100
CBioseqInfoRecord & SetAccession(const TAccession &value)
Definition: record.hpp:94
EPSGS_CacheLookupResult LookupBioseqInfo(IPSGS_Processor *processor, SBioseqResolution &bioseq_resolution)
EPSGS_CacheLookupResult LookupSi2csi(IPSGS_Processor *processor, SBioseqResolution &bioseq_resolution)
CRequestStatus::ECode GetCombinedErrorCode(void) const
void AppendError(const string &msg, CRequestStatus::ECode code)
string GetCombinedErrorMessage(const list< SPSGSeqId > &seq_id_to_resolve) const
void MakeRequest(SBioseqResolution &&bioseq_resolution)
string GetCouldNotResolveMessage(void) const
list< SPSGSeqId > m_SeqIdsToResolve
psg_time_point_t GetAsyncResolutionStartTimestamp(void) const
void SetAsyncResolutionStartTimestamp(const psg_time_point_t &ts)
bool CanSkipBioseqInfoRetrieval(const CBioseqInfoRecord &bioseq_info_record)
CPSGSResolveErrors m_ResolveErrors
list< SPSGSeqId >::const_iterator m_CurrentSeqIdToResolve
EPSGS_AccessionAdjustmentResult AdjustBioseqAccession(SBioseqResolution &bioseq_resolution)
int16_t GetEffectiveVersion(const CTextseq_id *text_seq_id)
@ ePSGS_AccessionVersionHistoryRequest
void x_ResolveViaComposeOSLTInCache(CSeq_id &parsed_seq_id, int16_t effective_seq_id_type, const list< string > &secondary_id_list, const string &primary_id, SBioseqResolution &bioseq_resolution)
void x_ResolveSeqId(void)
void x_OnAsyncBioseqInfoResolveError(CRequestStatus::ECode status, int code, EDiagSev severity, const string &message, EPSGS_LoggingFlag loging_flag=ePSGS_NeedLogging)
void x_OnResolutionGoodData(void)
virtual ~CPSGS_ResolveBase()
EPSGS_CacheLookupResult x_ResolveSecondaryOSLTInCache(const string &secondary_id, int16_t effective_seq_id_type, SBioseqResolution &bioseq_resolution)
void x_OnSeqIdResolveError(CRequestStatus::ECode status, int code, EDiagSev severity, const string &message, EPSGS_LoggingFlag loging_flag=ePSGS_NeedLogging)
SBioseqResolution ResolveTestInputSeqId(void)
void ResolveInputSeqId(void)
TSeqIdResolutionErrorCB m_FinalErrorCB
EPSGS_CacheLookupResult x_ResolvePrimaryOSLTInCache(const string &primary_id, int16_t effective_version, int16_t effective_seq_id_type, SBioseqResolution &bioseq_resolution)
EPSGS_CacheLookupResult x_ResolveAsIsInCache(SBioseqResolution &bioseq_resolution)
TSeqIdResolutionFinishedCB m_FinalFinishedCB
bool x_ComposeOSLT(CSeq_id &parsed_seq_id, int16_t &effective_seq_id_type, list< string > &secondary_id_list, string &primary_id)
void x_OnSeqIdResolveFinished(SBioseqResolution &&bioseq_resolution)
TSeqIdResolutionStartProcessingCB m_FinalStartProcessingCB
void x_RegisterSuccessTiming(const SBioseqResolution &bioseq_resolution)
SPSGS_RequestBase::EPSGS_CacheAndDbUse x_GetRequestUseCache(void)
static CPubseqGatewayApp * GetInstance(void)
virtual void Process(void)=0
Main processing function.
shared_ptr< CPSGS_Reply > m_Reply
bool GetEffectiveSeqIdType(const objects::CSeq_id &parsed_seq_id, int request_seq_id_type, int16_t &eff_seq_id_type, bool need_trace)
shared_ptr< CPSGS_Request > m_Request
EPSGS_SeqIdParsingResult ParseInputSeqId(objects::CSeq_id &seq_id, const string &request_seq_id, int request_seq_id_type, string *err_msg=nullptr)
Parse seq-id from a string and type representation.
#define false
Definition: bool.h:36
Int2 int16_t
EDiagSev
Severity level for the posted diagnostics.
Definition: ncbidiag.hpp:650
@ eDiag_Error
Error message.
Definition: ncbidiag.hpp:653
#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
string ComposeOSLT(list< string > *secondary_ids=nullptr, TComposeOSLTFlags parse_flags=0) const
JIRA ID-5188 : Compose OSLT string for the primary id, as well as OSLT strings for the secondary ids,...
Definition: Seq_id.cpp:3416
const CTextseq_id * GetTextseq_Id(void) const
Return embedded CTextseq_id, if any.
Definition: Seq_id.cpp:169
@ fGpipeAddSecondary
Add "ACC.VER(=1)" for a 2ndary id.
Definition: Seq_id.hpp:821
static string & ToUpper(string &str)
Convert string to upper case – string& version.
Definition: ncbistr.cpp:424
Defines NCBI C++ diagnostic APIs, classes, and macros.
EPSGS_CacheLookupResult
@ ePSGS_CacheHit
@ ePSGS_CacheFailure
@ ePSGS_CacheNotHit
@ ePSGS_ParsedOK
@ ePSGS_UnresolvedSeqId
@ ePSGS_NoBioseqInfo
@ ePSGS_Si2csiCache
@ ePSGS_BioseqCache
@ ePSGS_Si2csiDB
@ ePSGS_SkipLogging
@ ePSGS_LogicError
@ ePSGS_SeqIdsEmpty
Defines CRequestStatus class for NCBI C++ diagnostic API.
USING_SCOPE(objects)
USING_IDBLOB_SCOPE
EPSGS_ResolutionResult m_ResolutionResult
bool IsValid(void) const
CBioseqInfoRecord & GetBioseqInfo(void)
void SetBioseqInfo(const CBioseqInfoRecord &record)
SResolveInputSeqIdError m_Error
CRequestStatus::ECode m_ErrorCode
Definition: inftrees.h:24
@ eOpStatusFound
Definition: timing.hpp:61
@ eOpStatusNotFound
Definition: timing.hpp:62
@ eResolutionError
Definition: timing.hpp:94
@ eResolutionNotFound
Definition: timing.hpp:95
@ eResolutionCass
Definition: timing.hpp:78
@ eResolutionFound
Definition: timing.hpp:96
@ eResolutionFoundInCassandra
Definition: timing.hpp:80
@ eResolutionLmdb
Definition: timing.hpp:77
Modified on Fri Sep 20 14:58:21 2024 by modify_doxy.py rev. 669887