Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/classCPSGS__IPGResolveProcessor.html below:
NCBI C++ ToolKit: CPSGS_IPGResolveProcessor Class Reference
Search Toolkit Book for CPSGS_IPGResolveProcessor
#include "ipg_resolve.hpp"
(Private to src/app/pubseq_gateway/server
.)
virtual bool CanProcess (shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply) const Tells if processor can process the given request. More...
virtual IPSGS_Processor * CreateProcessor (shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply, TProcessorPriority priority) const Create processor to fulfil PSG request using the data source. More...
virtual void Process (void) Main processing function. More...
virtual EPSGS_Status GetStatus (void) Tells the processor status (if it has finished or in progress) More...
virtual string GetName (void) const Tells the processor name (used in logging and tracing) More...
virtual string GetGroupName (void) const Tells the processor group name. More...
virtual void ProcessEvent (void) Called when an event happened which may require to have some processing. More...
CPSGS_IPGResolveProcessor () CPSGS_IPGResolveProcessor (shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply, TProcessorPriority priority) virtual ~CPSGS_IPGResolveProcessor () CPSGS_ResolveBase () CPSGS_ResolveBase (shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply, TSeqIdResolutionFinishedCB finished_cb, TSeqIdResolutionErrorCB error_cb, TSeqIdResolutionStartProcessingCB resolution_start_processing_cb) virtual ~CPSGS_ResolveBase () SBioseqResolution ResolveTestInputSeqId (void) CPSGS_AsyncResolveBase () CPSGS_AsyncResolveBase (shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply, TContinueResolveCB continue_resolve_cb, TSeqIdResolutionFinishedCB finished_cb, TSeqIdResolutionErrorCB error_cb, TSeqIdResolutionStartProcessingCB start_processing_cb) virtual ~CPSGS_AsyncResolveBase () void Process (int16_t effective_version, int16_t effective_seq_id_type, list< string > &&secondary_id_list, string &&primary_seq_id, bool composed_ok, bool seq_id_resolve, SBioseqResolution &&bioseq_resolution) void x_OnBioseqInfo (vector< CBioseqInfoRecord > &&records) void x_OnBioseqInfoWithoutSeqIdType (vector< CBioseqInfoRecord > &&records) void x_OnBioseqInfoError (CRequestStatus::ECode status, int code, EDiagSev severity, const string &message) void x_OnSi2csiRecord (vector< CSI2CSIRecord > &&records) void x_OnSi2csiError (CRequestStatus::ECode status, int code, EDiagSev severity, const string &message) CPSGS_CassProcessorBase () CPSGS_CassProcessorBase (shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply, TProcessorPriority priority) virtual ~CPSGS_CassProcessorBase () virtual void Cancel (void) override The infrastructure request to cancel processing. More...
void SignalFinishProcessing (void) void UnlockWaitingProcessor (void) void CallOnData (void) string GetVerboseFetches (void) const void EnforceWait (void) const IPSGS_Processor () virtual ~IPSGS_Processor () virtual vector< string > WhatCanProcess (shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply) const Needs to be implemented only for the ID/get_na requests. More...
shared_ptr< CPSGS_Request > GetRequest (void) const Provides the user request. More...
shared_ptr< CPSGS_Reply > GetReply (void) const Provides the reply wrapper. More...
TProcessorPriority GetPriority (void) const Provides the processor priority. More...
void PostponeInvoke (CPSGS_UvLoopBinder::TProcessorCB cb, void *user_data) The provided callback will be called from the libuv loop assigned to the processor. More...
void SetSocketCallback (int fd, CPSGS_SocketIOCallback::EPSGS_Event event, uint64_t timeout_millisec, void *user_data, CPSGS_SocketIOCallback::TEventCB event_cb, CPSGS_SocketIOCallback::TTimeoutCB timeout_cb, CPSGS_SocketIOCallback::TErrorCB error_cb) The provided callbacks will be called from the libuv loop assigned to the processor when the corresponding event appeared on the provided socket. More...
void SetUVThreadId (uv_thread_t uv_thread_id) Saves the libuv worker thread id which runs the processor. More...
uv_thread_t GetUVThreadId (void) const Provides the libuv thread id which runs the processor. More...
bool IsUVThreadAssigned (void) const Tells if a libuv thread id has been assigned to the processor. More...
psg_time_point_t GetProcessInvokeTimestamp (bool &is_valid) const Provides the timestamp of when the Process() method was called. More...
psg_time_point_t GetSignalStartTimestamp (bool &is_valid) const Provides the timestamp of when the processor called SignalStartProcessing() method. More...
psg_time_point_t GetSignalFinishTimestamp (bool &is_valid) const Provides the timestamp of when the processor called SignalFinishProcessing() method. More...
void OnBeforeProcess (void) Called just before the virtual Process() method is called. More...
EPSGS_StartProcessing SignalStartProcessing (void) A processor should call the method when it decides that it successfully started processing the request. More...
void SignalFinishProcessing (void) A processor should call this method when it decides that there is nothing else to be done. More...
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. More...
CPSGS_AsyncBioseqInfoBase () CPSGS_AsyncBioseqInfoBase (shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply, TSeqIdResolutionFinishedCB finished_cb, TSeqIdResolutionErrorCB error_cb) virtual ~CPSGS_AsyncBioseqInfoBase () CPubseqGatewayFetchIpgReportRequest x_PrepareRequestOnOriginalValues (void) CPubseqGatewayFetchIpgReportRequest x_PrepareRequestOnResolvedlValues (void) string x_FormSeqId (SBioseqResolution &bioseq_info) void x_InitiateIPGFetch (const CPubseqGatewayFetchIpgReportRequest &request) void x_ProcessWithResolve (void) void x_DetectSeqIdTypes (void) bool x_AnyGIs (void) bool x_InitiateResolve (void) string x_GetNotFoundMessage (void) bool x_OnIPGResolveData (vector< CIpgStorageReportEntry > &&page, bool is_last, CCassIPGFetch *fetch_details) void x_OnIPGResolveError (CCassIPGFetch *fetch_details, CRequestStatus::ECode status, int code, EDiagSev severity, const string &message) void x_OnSeqIdResolveFinished (SBioseqResolution &&bioseq_resolution) void x_OnSeqIdResolveError (CRequestStatus::ECode status, int code, EDiagSev severity, const string &message) void x_OnResolutionGoodData (void) void x_Peek (bool need_wait) bool x_Peek (unique_ptr< CCassFetch > &fetch_details, bool need_wait) enum EPSGS_Status {
ePSGS_InProgress , ePSGS_Done , ePSGS_NotFound , ePSGS_Canceled ,
ePSGS_Timeout , ePSGS_Error , ePSGS_Unauthorized
} The GetStatus() method returns a processor current status. More...
enum EPSGS_StartProcessing { ePSGS_Proceed , ePSGS_Cancel } Tells wether to continue or not after a processor called SignalStartProcessing() method. More...
static string StatusToString (EPSGS_Status status) Converts the processor status to a string for tracing and logging purposes. More...
static string StatusToProgressMessage (EPSGS_Status status) Converts the processor status to a string for protocol message. More...
enum EPSGS_MyNCBILookupResult {
ePSGS_IncludeHUPSetToNo , ePSGS_FoundInOKCache , ePSGS_FoundInErrorCache , ePSGS_FoundInNotFoundCache ,
ePSGS_CookieNotPresent , ePSGS_RequestInitiated , ePSGS_AddedToWaitlist
} void ResolveInputSeqId (void) void ResolveInputSeqId (const string &seq_id, int16_t seq_id_type) int16_t GetEffectiveVersion (const CTextseq_id *text_seq_id) SPSGS_ResolveRequest::TPSGS_BioseqIncludeData GetBioseqInfoFields (void) bool NonKeyBioseqInfoFieldsRequested (void) bool CanSkipBioseqInfoRetrieval (const CBioseqInfoRecord &bioseq_info_record) SPSGS_RequestBase::EPSGS_AccSubstitutioOption GetAccessionSubstitutionOption (void) EPSGS_AccessionAdjustmentResult AdjustBioseqAccession (SBioseqResolution &bioseq_resolution) void SetupSeqIdToResolve (void) void SetupSeqIdToResolve (const string &seq_id, int16_t seq_id_type) string GetCouldNotResolveMessage (void) const psg_time_point_t GetAsyncResolutionStartTimestamp (void) const void SetAsyncResolutionStartTimestamp (const psg_time_point_t &ts) bool MoveToNextSeqId (void) bool GetSeqIdResolve (void) bool OptimizationPrecondition (const string &primary_id, int16_t effective_seq_id_type) const bool AreAllFinishedRead (void) const bool IsMyNCBIFinished (void) const void UpdateOverallStatus (CRequestStatus::ECode status) bool IsCassandraProcessorEnabled (shared_ptr< CPSGS_Request > request) const void CancelLoaders (void) SCass_BlobId TranslateSatToKeyspace (CBioseqInfoRecord::TSat sat, CBioseqInfoRecord::TSatKey sat_key, const string &seq_id) bool IsTimeoutError (const string &msg) const bool IsTimeoutError (int code) const bool IsError (EDiagSev severity) const CRequestStatus::ECode CountError (CCassFetch *fetch_details, CRequestStatus::ECode status, int code, EDiagSev severity, const string &message, EPSGS_LoggingFlag logging_flag, EPSGS_StatusUpdateFlag status_update_flag) EPSGS_MyNCBILookupResult PopulateMyNCBIUser (TMyNCBIDataCB data_cb, TMyNCBIErrorCB error_cb) void ReportNoWebCubbyUser (void) void ReportExplicitIncludeHUPSetToNo (void) void ReportMyNCBIError (CRequestStatus::ECode status, const string &my_ncbi_message) void ReportMyNCBINotFound (void) void ReportSecureSatUnauthorized (const string &user_name) void ReportFailureToGetCassConnection (const string &message) void ReportFailureToGetCassConnection (void) void CleanupMyNCBICache (void) bool GetEffectiveSeqIdType (const objects::CSeq_id &parsed_seq_id, int request_seq_id_type, int16_t &eff_seq_id_type, bool need_trace) void MakeRequest (SBioseqResolution &&bioseq_resolution) TContinueResolveCB m_ContinueResolveCB TSeqIdResolutionFinishedCB m_FinishedCB TSeqIdResolutionErrorCB m_ErrorCB TSeqIdResolutionStartProcessingCB m_StartProcessingCB EPSGS_ResolveStage m_ResolveStage bool m_ComposedOk bool m_SeqIdResolve string m_PrimarySeqId int16_t m_EffectiveVersion int16_t m_EffectiveSeqIdType size_t m_SecondaryIndex list< string > m_SecondaryIdList SBioseqResolution m_BioseqResolution CCassFetch * m_CurrentFetch CCassFetch * m_NoSeqIdTypeFetch CBioseqInfoRecord::TAccession m_BioseqInfoRequestedAccession CBioseqInfoRecord::TVersion m_BioseqInfoRequestedVersion CBioseqInfoRecord::TSeqIdType m_BioseqInfoRequestedSeqIdType CBioseqInfoRecord::TGI m_BioseqInfoRequestedGI psg_time_point_t m_BioseqInfoStart psg_time_point_t m_Si2csiStart psg_time_point_t m_AsyncCassResolutionStart bool m_StartProcessingCalled list< SPSGSeqId > m_SeqIdsToResolve list< SPSGSeqId >::const_iterator m_CurrentSeqIdToResolve CPSGSResolveErrors m_ResolveErrors list< unique_ptr< CCassFetch > > m_FetchDetails bool m_Canceled bool m_Unlocked CRequestStatus::ECode m_Status optional< string > m_UserName shared_ptr< CPSG_MyNCBIRequest_WhoAmI > m_WhoAmIRequest optional< string > m_MyNCBICookie shared_ptr< CPSGS_Request > m_Request shared_ptr< CPSGS_Reply > m_Reply TProcessorPriority m_Priority bool m_FinishSignalled uv_thread_t m_UVThreadId
Definition at line 47 of file ipg_resolve.hpp.
◆ EPSGS_IPGStage Enumerator ePSGS_NoResolution ePSGS_ResolveGIProtein ePSGS_ResolveGINucleotide ePSGS_ResolveNonGIProtein ePSGS_ResolveNonGINucleotide ePSGS_Finished
Definition at line 62 of file ipg_resolve.hpp.
◆ CPSGS_IPGResolveProcessor() [1/2] CPSGS_IPGResolveProcessor::CPSGS_IPGResolveProcessor ( ) ◆ CPSGS_IPGResolveProcessor() [2/2] ◆ ~CPSGS_IPGResolveProcessor() CPSGS_IPGResolveProcessor::~CPSGS_IPGResolveProcessor ( ) virtual
Definition at line 74 of file ipg_resolve.cpp.
◆ CanProcess() ◆ CreateProcessor()
Create processor to fulfil PSG request using the data source.
-
Parameters
-
request PSG request to retrieve the data for. It is guaranteed to be not null. reply The way to send reply chunks to the client. It is guaranteed to be not null.
-
Returns
-
New processor object if this processor can theoretically fulfill (all or a part of) the request; else NULL.
Implements IPSGS_Processor.
Definition at line 127 of file ipg_resolve.cpp.
References CanProcess(), and CPSGS_IPGResolveProcessor().
◆ GetGroupName() string CPSGS_IPGResolveProcessor::GetGroupName ( void ) const virtual
Tells the processor group name.
For example, all the processors which retrieve data from Cassandra should return the same name in response to this call. This name is used to control the total number of simultaneously working processors retrieving from the same backend.
-
Returns
-
the processor group name
Implements IPSGS_Processor.
Definition at line 685 of file ipg_resolve.cpp.
References kCassandraProcessorGroupName.
◆ GetName() string CPSGS_IPGResolveProcessor::GetName ( void ) const virtual ◆ GetStatus() ◆ Process() void CPSGS_IPGResolveProcessor::Process ( void ) virtual ◆ ProcessEvent() void CPSGS_IPGResolveProcessor::ProcessEvent ( void ) virtual
Called when an event happened which may require to have some processing.
By default nothing should be done. This method can be called as well on a timer event.
Reimplemented from IPSGS_Processor.
Definition at line 691 of file ipg_resolve.cpp.
References x_Peek().
◆ x_AnyGIs() bool CPSGS_IPGResolveProcessor::x_AnyGIs ( void ) private ◆ x_DetectSeqIdTypes() void CPSGS_IPGResolveProcessor::x_DetectSeqIdTypes ( void ) private ◆ x_FormSeqId()
Definition at line 440 of file ipg_resolve.cpp.
References CSeq_id_Base::e_Pdb, CSeq_id_Base::e_Pir, CSeq_id_Base::e_Prf, CBioseqInfoRecord::GetAccession(), SBioseqResolution::GetBioseqInfo(), CBioseqInfoRecord::GetName(), CBioseqInfoRecord::GetSeqIdType(), CBioseqInfoRecord::GetVersion(), IPSGS_Processor::m_Reply, IPSGS_Processor::m_Request, NStr::ReplaceInPlace(), and dtl::version.
Referenced by x_PrepareRequestOnResolvedlValues().
◆ x_GetNotFoundMessage() string CPSGS_IPGResolveProcessor::x_GetNotFoundMessage ( void ) private ◆ x_InitiateIPGFetch()
Definition at line 491 of file ipg_resolve.cpp.
References CPubseqGatewayApp::GetInstance(), CPSGS_CassProcessorBase::m_FetchDetails, m_IPGResolveRequest, IPSGS_Processor::m_Reply, IPSGS_Processor::m_Request, CPubseqGatewayFetchIpgReport::SetConsumeCallback(), CPubseqGatewayFetchIpgReport::SetDataReadyCB(), CCassBlobWaiter::SetErrorCB(), ToJsonString(), CCassBlobWaiter::Wait(), x_OnIPGResolveData(), and x_OnIPGResolveError().
Referenced by Process(), x_OnSeqIdResolveFinished(), and x_ProcessWithResolve().
◆ x_InitiateResolve() bool CPSGS_IPGResolveProcessor::x_InitiateResolve ( void ) private
Definition at line 195 of file ipg_resolve.cpp.
References CSeq_id_Base::e_Gi, ePSGS_Finished, ePSGS_NoResolution, ePSGS_ResolveGINucleotide, ePSGS_ResolveGIProtein, ePSGS_ResolveNonGINucleotide, ePSGS_ResolveNonGIProtein, m_IPGResolveRequest, m_IPGStage, SPSGS_IPGResolveRequest::m_Nucleotide, m_NucleotideType, SPSGS_IPGResolveRequest::m_Protein, m_ProteinType, IPSGS_Processor::m_Reply, IPSGS_Processor::m_Request, and CPSGS_ResolveBase::ResolveInputSeqId().
Referenced by x_OnIPGResolveData(), x_OnSeqIdResolveFinished(), and x_ProcessWithResolve().
◆ x_OnIPGResolveData()
Definition at line 567 of file ipg_resolve.cpp.
References CCassBlobWaiter::Cancel(), CCassBlobWaiter::ClearError(), CRequestStatus::e404_NotFound, CRequestStatus::e500_InternalServerError, eDiag_Error, ePSGS_IPGNotFound, CPSGSCounters::ePSGS_ProcUnknownError, ePSGS_ResolveGINucleotide, ePSGS_ResolveGIProtein, CPSGS_Reply::ePSGS_SendAccumulated, CPubseqGatewayApp::GetCounters(), CPubseqGatewayApp::GetInstance(), CCassIPGFetch::GetLoader(), CPubseqGatewayFetchIpgReport::GetRequest(), CPSGSCounters::Increment(), kIPGResolveProcessorName, CPSGS_CassProcessorBase::m_Canceled, m_IPGStage, m_NotFoundCriterias, m_RecordCount, IPSGS_Processor::m_Reply, IPSGS_Processor::m_Request, PSG_ERROR, CCassFetch::SetReadFinished(), CPSGS_CassProcessorBase::SignalFinishProcessing(), ToJsonString(), CPSGS_CassProcessorBase::UpdateOverallStatus(), x_GetNotFoundMessage(), x_InitiateResolve(), and x_Peek().
Referenced by x_InitiateIPGFetch().
◆ x_OnIPGResolveError()
Definition at line 534 of file ipg_resolve.cpp.
References CCassBlobWaiter::ClearError(), CPSGS_CassProcessorBase::CountError(), ePSGS_NeedLogging, ePSGS_NeedStatusUpdate, CCassIPGFetch::GetLoader(), CPSGS_CassProcessorBase::IsError(), kIPGResolveProcessorName, IPSGS_Processor::m_Reply, IPSGS_Processor::m_Request, CCassFetch::SetReadFinished(), CPSGS_CassProcessorBase::SignalFinishProcessing(), and x_Peek().
Referenced by x_InitiateIPGFetch().
◆ x_OnResolutionGoodData() void CPSGS_IPGResolveProcessor::x_OnResolutionGoodData ( void ) private
Definition at line 794 of file ipg_resolve.cpp.
◆ x_OnSeqIdResolveError() ◆ x_OnSeqIdResolveFinished() void CPSGS_IPGResolveProcessor::x_OnSeqIdResolveFinished ( SBioseqResolution && bioseq_resolution ) private
Definition at line 699 of file ipg_resolve.cpp.
References CRequestStatus::e500_InternalServerError, ePSGS_Finished, ePSGS_NoResolution, CPSGSCounters::ePSGS_ProcUnknownError, ePSGS_ResolveGINucleotide, ePSGS_ResolveGIProtein, ePSGS_ResolveNonGINucleotide, ePSGS_ResolveNonGIProtein, CPubseqGatewayApp::GetCounters(), CPubseqGatewayApp::GetInstance(), CPSGSCounters::Increment(), m_IPGStage, IPSGS_Processor::m_Request, m_ResolvedNucleotide, m_ResolvedProtein, PSG_ERROR, CPSGS_CassProcessorBase::SignalFinishProcessing(), CPSGS_CassProcessorBase::UpdateOverallStatus(), x_InitiateIPGFetch(), x_InitiateResolve(), and x_PrepareRequestOnResolvedlValues().
◆ x_Peek() [1/2] void CPSGS_IPGResolveProcessor::x_Peek ( bool need_wait ) private ◆ x_Peek() [2/2] bool CPSGS_IPGResolveProcessor::x_Peek ( unique_ptr< CCassFetch > & fetch_details, bool need_wait ) private
Definition at line 842 of file ipg_resolve.cpp.
References CRequestStatus::e500_InternalServerError, CRequestStatus::e504_GatewayTimeout, eDiag_Error, CPSGSCounters::ePSGS_CassQueryTimeoutError, CPSGSCounters::ePSGS_ProcUnknownError, ePSGS_UnknownError, CPubseqGatewayApp::GetInstance(), CPSGS_CassProcessorBase::IsTimeoutError(), kIPGResolveProcessorName, IPSGS_Processor::m_Reply, PSG_ERROR, CPSGS_CassProcessorBase::SignalFinishProcessing(), and CPSGS_CassProcessorBase::UpdateOverallStatus().
◆ x_PrepareRequestOnOriginalValues() ◆ x_PrepareRequestOnResolvedlValues()
Definition at line 372 of file ipg_resolve.cpp.
References CSeq_id_Base::e_Pdb, SBioseqResolution::IsValid(), SPSGS_IPGResolveRequest::m_IPG, m_IPGResolveRequest, SPSGS_IPGResolveRequest::m_Nucleotide, m_NucleotideType, SPSGS_IPGResolveRequest::m_Protein, m_ProteinType, IPSGS_Processor::m_Reply, IPSGS_Processor::m_Request, m_ResolvedNucleotide, m_ResolvedProtein, NStr::ReplaceInPlace(), CPubseqGatewayFetchIpgReportRequest::SetIpg(), CPubseqGatewayFetchIpgReportRequest::SetNucleotide(), CPubseqGatewayFetchIpgReportRequest::SetProtein(), and x_FormSeqId().
Referenced by x_OnSeqIdResolveFinished(), and x_ProcessWithResolve().
◆ x_ProcessWithResolve() void CPSGS_IPGResolveProcessor::x_ProcessWithResolve ( void ) private ◆ m_IPGResolveRequest ◆ m_IPGStage ◆ m_NotFoundCriterias vector<string> CPSGS_IPGResolveProcessor::m_NotFoundCriterias private ◆ m_NucleotideType ◆ m_ProteinType ◆ m_RecordCount size_t CPSGS_IPGResolveProcessor::m_RecordCount private ◆ m_ResolvedNucleotide ◆ m_ResolvedProtein
The documentation for this class was generated from the following files:
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