41 using namespace std::placeholders;
51 shared_ptr<CPSGS_Request> request,
52 shared_ptr<CPSGS_Reply> reply,
59 this, _1, _2, _3, _4),
74 shared_ptr<CPSGS_Reply> reply)
const
83 auto startup_data_state = app->GetStartupDataState();
85 if (request->NeedTrace()) {
87 "request because Cassandra DB is not available.\n" +
89 request->GetStartTimestamp());
99 shared_ptr<CPSGS_Reply> reply,
127 const string & message)
145 message, status,
code,
196 effective_output_format);
245 bool overall_final_state =
false;
252 if (details->InPeek()) {
255 details->SetInPeek(
true);
256 overall_final_state |=
x_Peek(details, need_wait);
257 details->SetInPeek(
false);
266 if (overall_final_state) {
278 if (!fetch_details->GetLoader())
281 bool final_state =
false;
283 if (!fetch_details->ReadFinished()) {
284 final_state = fetch_details->GetLoader()->Wait();
286 fetch_details->SetReadFinished();
290 if (fetch_details->GetLoader()->HasError() &&
294 string error = fetch_details->GetLoader()->LastError();
297 app->GetCounters().Increment(
this,
309 fetch_details->GetLoader()->ClearError();
310 fetch_details->SetReadFinished();
const string kCassandraProcessorGroupName
const string kCassandraProcessorEvent
EPSGS_AccessionAdjustmentResult AdjustBioseqAccession(SBioseqResolution &bioseq_resolution)
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)
void UpdateOverallStatus(CRequestStatus::ECode status)
bool IsCassandraProcessorEnabled(shared_ptr< CPSGS_Request > request) const
list< unique_ptr< CCassFetch > > m_FetchDetails
bool AreAllFinishedRead(void) const
void UnlockWaitingProcessor(void)
IPSGS_Processor::EPSGS_Status GetStatus(void) override
Tells the processor status (if it has finished or in progress)
void SignalFinishProcessing(void)
void ResolveInputSeqId(void)
virtual string GetGroupName(void) const
Tells the processor group name.
virtual ~CPSGS_ResolveProcessor()
void x_OnSeqIdResolveFinished(SBioseqResolution &&bioseq_resolution)
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.
SPSGS_ResolveRequest * m_ResolveRequest
virtual void Process(void)
Main processing function.
virtual EPSGS_Status GetStatus(void)
Tells the processor status (if it has finished or in progress)
virtual string GetName(void) const
Tells the processor name (used in logging and tracing)
void x_SendBioseqInfo(SBioseqResolution &bioseq_resolution)
void x_OnSeqIdResolveError(CRequestStatus::ECode status, int code, EDiagSev severity, const string &message)
void x_Peek(bool need_wait)
void x_OnResolutionGoodData(void)
virtual bool CanProcess(shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply) const
Tells if processor can process the given request.
virtual void ProcessEvent(void)
Called when an event happened which may require to have some processing.
static CPubseqGatewayApp * GetInstance(void)
Interface class (and self-factory) for request processor objects that can retrieve data from a given ...
shared_ptr< CPSGS_Reply > m_Reply
EPSGS_Status
The GetStatus() method returns a processor current status.
EPSGS_StartProcessing SignalStartProcessing(void)
A processor should call the method when it decides that it successfully started processing the reques...
shared_ptr< CPSGS_Request > m_Request
EDiagSev
Severity level for the posted diagnostics.
@ eDiag_Error
Error message.
@ e500_InternalServerError
string ToJsonString(const CBioseqInfoRecord &bioseq_info, SPSGS_ResolveRequest::TPSGS_BioseqIncludeData include_data_flags, const string &custom_blob_id)
string ToBioseqProtobuf(const CBioseqInfoRecord &bioseq_info)
#define PSG_ERROR(message)
string GetCassStartupDataStateMessage(EPSGS_StartupDataState state)
static const string kResolveProcessorName
EPSGS_ResolutionResult m_ResolutionResult
CBioseqInfoRecord & GetBioseqInfo(void)
TPSGS_BioseqIncludeData m_IncludeDataFlags
EPSGS_OutputFormat m_OutputFormat