std::placeholders;
60shared_ptr<CPSGS_Reply> reply,
70this, _1, _2, _3, _4, _5),
77this, _1, _2, _3, _4, _5)),
78m_FinalFinishedCB(finished_cb),
79m_FinalErrorCB(error_cb),
80m_FinalStartProcessingCB(resolution_start_processing_cb),
81m_AsyncStarted(
false)
107 "Not handled request type "+
108to_string(
static_cast<int>(
m_Request->GetRequestType())));
114 int16_t& effective_seq_id_type,
115list<string> & secondary_id_list,
118 boolneed_trace =
m_Request->NeedTrace();
122effective_seq_id_type, 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",
133primary_id = parsed_seq_id.
ComposeOSLT(&secondary_id_list,
137 m_Reply->SendTrace(
"OSLT call failure (exception)",
144 stringtrace_msg(
"OSLT succeeded");
145trace_msg +=
"\nOSLT primary id: "+ primary_id;
147 if(secondary_id_list.empty()) {
148trace_msg +=
"\nOSLT secondary id list is empty";
150 for(
const auto& item : secondary_id_list) {
151trace_msg +=
"\nOSLT secondary id: "+ item;
163 const string& primary_id,
170 if(!primary_id.empty()) {
181 this, bioseq_resolution);
187bioseq_resolution.
Reset();
189 returnbioseq_cache_lookup_result;
195 const string& secondary_id,
206 autosi2csi_cache_lookup_result =
213bioseq_resolution.
Reset();
230upper_seq_id, seq_id_type,
234bioseq_resolution.
Reset();
239 returncache_lookup_result;
248 constlist<string> & secondary_id_list,
249 const string& primary_id,
254 boolcache_failure =
false;
256 if(!primary_id.empty()) {
257 autocache_lookup_result =
259effective_seq_id_type,
264cache_failure =
true;
267 for(
const auto& secondary_id : secondary_id_list) {
268 autocache_lookup_result =
270effective_seq_id_type,
275cache_failure =
true;
289 if(primary_id != upper_seq_id)
295cache_failure =
true;
297bioseq_resolution.
Reset();
330 stringparse_err_msg;
340 if(seq_id_resolve ==
false) {
346 "seq_id_resolve flag is set " 347 "to 'no' and there is a seq id parsing failure: "+
355list<string> secondary_id_list;
357 boolcomposed_ok =
false;
359composed_ok =
x_ComposeOSLT(oslt_seq_id, effective_seq_id_type,
360secondary_id_list, primary_id);
364 if(seq_id_resolve ==
false) {
370 "seq_id_resolve flag is set to 'no' and " 371 "there is a failure to compose OSLT.");
378 "seq_id_resolve flag is set " 379 "to 'no' and the seq id type ("+
380to_string(effective_seq_id_type) +
381 ") does not satisfy a condition for " 390 if(seq_id_resolve) {
394secondary_id_list, primary_id,
402effective_seq_id_type,
406 if(bioseq_resolution.
IsValid()) {
408 boolcontinue_with_cassandra =
false;
415 autobioseq_cache_lookup_result =
420continue_with_cassandra =
true;
421bioseq_resolution.
Reset();
429continue_with_cassandra =
true;
430bioseq_resolution.
Reset();
440continue_with_cassandra =
true;
441bioseq_resolution.
Reset();
445 if(!continue_with_cassandra) {
456 if(! parse_err_msg.empty() &&
466effective_seq_id_type,
467std::move(secondary_id_list),
468std::move(primary_id),
471std::move(bioseq_resolution));
481app->GetCounters().Increment(
this,
487}
else if(!parse_err_msg.empty()) {
508 const string& primary_id,
520effective_seq_id_type, bioseq_resolution);
534app->GetCounters().Increment(
this,
564 stringparse_err_msg;
572list<string> secondary_id_list;
574 boolcomposed_ok =
false;
576composed_ok =
x_ComposeOSLT(oslt_seq_id, effective_seq_id_type,
577secondary_id_list, primary_id);
583secondary_id_list, primary_id,
589 if(!bioseq_resolution.
IsValid()) {
591 if(!parse_err_msg.empty()) {
597 returnbioseq_resolution;
606 const string& message,
634 const string& message,
637 if(!message.empty()) {
669 autocache_lookup_result =
680 if(bioseq_resolution.m_CassQueryCount == 0) {
687std::move(bioseq_resolution));
692 "Data inconsistency: the bioseq key info was " 694 " but the bioseq info is not found",
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)
CBioseqInfoRecord & SetVersion(TVersion value)
CBioseqInfoRecord & SetAccession(const TAccession &value)
EPSGS_CacheLookupResult LookupBioseqInfo(IPSGS_Processor *processor, SBioseqResolution &bioseq_resolution)
EPSGS_CacheLookupResult LookupSi2csi(IPSGS_Processor *processor, SBioseqResolution &bioseq_resolution)
@ ePSGS_InputSeqIdNotResolved
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
bool MoveToNextSeqId(void)
list< SPSGSeqId > m_SeqIdsToResolve
psg_time_point_t GetAsyncResolutionStartTimestamp(void) const
void SetAsyncResolutionStartTimestamp(const psg_time_point_t &ts)
bool GetSeqIdResolve(void)
void SetupSeqIdToResolve(void)
bool CanSkipBioseqInfoRetrieval(const CBioseqInfoRecord &bioseq_info_record)
CPSGSResolveErrors m_ResolveErrors
bool OptimizationPrecondition(const string &primary_id, int16_t effective_seq_id_type) const
list< SPSGSeqId >::const_iterator m_CurrentSeqIdToResolve
EPSGS_AccessionAdjustmentResult AdjustBioseqAccession(SBioseqResolution &bioseq_resolution)
int16_t GetEffectiveVersion(const CTextseq_id *text_seq_id)
@ ePSGS_AnnotationRequest
@ ePSGS_IPGResolveRequest
@ ePSGS_AccessionVersionHistoryRequest
@ ePSGS_BlobBySeqIdRequest
void x_OptimizedResolutionInCache(CSeq_id &parsed_seq_id, const string &primary_id, int16_t effective_seq_id_type, SBioseqResolution &bioseq_resolution)
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)
void x_OptimizedNotFound(const string &err_msg)
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.
EDiagSev
Severity level for the posted diagnostics.
@ eDiag_Error
Error message.
@ e500_InternalServerError
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
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,...
const CTextseq_id * GetTextseq_Id(void) const
Return embedded CTextseq_id, if any.
@ fGpipeAddSecondary
Add "ACC.VER(=1)" for a 2ndary id.
static string & ToUpper(string &str)
Convert string to upper case â string& version.
Defines NCBI C++ diagnostic APIs, classes, and macros.
Defines CRequestStatus class for NCBI C++ diagnostic API.
EPSGS_ResolutionResult m_ResolutionResult
CBioseqInfoRecord & GetBioseqInfo(void)
void SetBioseqInfo(const CBioseqInfoRecord &record)
SResolveInputSeqIdError m_Error
CRequestStatus::ECode m_ErrorCode
bool HasError(void) const
@ eResolutionFoundInCassandra
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4