NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
CPSGS_OSGGetBlobBase Class Reference

Search Toolkit Book for CPSGS_OSGGetBlobBase

#include "osg_getblob_base.hpp"
(Private to src/app/pubseq_gateway/server.)

+ Inheritance diagram for CPSGS_OSGGetBlobBase:
+ Collaboration diagram for CPSGS_OSGGetBlobBase:

Classes

struct  SParsedId2Info
 

Public Types

typedef int TID2BlobState
 
typedef int TID2BlobVersion
 
typedef int TID2SplitVersion
 
typedef int TID2ChunkId
 
- Public Types inherited from CPSGS_OSGProcessorBase
enum  EEnabledFlags {
  fEnabledWGS = 1<<0 , fEnabledSNP = 1<<1 , fEnabledCDD = 1<<2 , fEnabledAllAnnot = fEnabledSNP | fEnabledCDD ,
  fEnabledAll = fEnabledWGS | fEnabledSNP | fEnabledCDD
}
 
typedef int TEnabledFlags
 
typedef vector< CRef< COSGFetch > > TFetches
 
- Public Types inherited from IPSGS_Processor
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...
 

Public Member Functions

 CPSGS_OSGGetBlobBase ()
 
virtual ~CPSGS_OSGGetBlobBase ()
 
bool IsEnabledOSGBlob (const CID2_Blob_Id &blob_id) const
 
- Public Member Functions inherited from CPSGS_OSGProcessorBase
 CPSGS_OSGProcessorBase (TEnabledFlags enabled_flags, const CRef< COSGConnectionPool > &pool, const shared_ptr< CPSGS_Request > &request, const shared_ptr< CPSGS_Reply > &reply, TProcessorPriority priority)
 
virtual ~CPSGS_OSGProcessorBase ()
 
virtual IPSGS_ProcessorCreateProcessor (shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply, TProcessorPriority priority) const override
 Create processor to fulfil PSG request using the data source. More...
 
virtual void Process (void) override
 Main processing function. More...
 
virtual void Cancel (void) override
 The infrastructure request to cancel processing. More...
 
virtual EPSGS_Status GetStatus (void) override
 Tells the processor status (if it has finished or in progress) More...
 
virtual void WaitForOtherProcessors ()
 
void WaitForCassandra ()
 
bool NeedTrace () const
 
void SendTrace (const string &str)
 
virtual void SendError (const string &msg)
 
bool IsCanceled () const
 
TEnabledFlags GetEnabledFlags () const
 
virtual void NotifyOSGCallStart ()
 
virtual void NotifyOSGCallReply (const CID2_Reply &reply)
 
virtual void NotifyOSGCallEnd ()
 
const TFetchesGetFetches () const
 
- Public Member Functions inherited from IPSGS_Processor
 IPSGS_Processor ()
 
virtual ~IPSGS_Processor ()
 
virtual bool CanProcess (shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply) const
 Tells if processor can process the given request. More...
 
virtual vector< stringWhatCanProcess (shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply) const
 Needs to be implemented only for the ID/get_na requests. More...
 
virtual string GetName (void) const =0
 Tells the processor name (used in logging and tracing) More...
 
virtual string GetGroupName (void) const =0
 Tells the processor group name. More...
 
virtual void ProcessEvent (void)
 Called when an event happened which may require to have some processing. More...
 
shared_ptr< CPSGS_RequestGetRequest (void) const
 Provides the user request. More...
 
shared_ptr< CPSGS_ReplyGetReply (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...
 

Static Public Member Functions

static CRef< CID2_Blob_IdParsePSGBlobId (const SPSGS_BlobId &blob_id)
 
static string GetPSGBlobId (const CID2_Blob_Id &blob_id)
 
static bool IsOSGBlob (const CID2_Blob_Id &blob_id)
 
static bool IsCDDBlob (const CID2_Blob_Id &blob_id)
 
static bool IsEnabledOSGBlob (TEnabledFlags enabled_flags, const CID2_Blob_Id &blob_id)
 
static bool IsEnabledOSGBlob (TEnabledFlags enabled_flags, const CRef< CID2_Blob_Id > &blob_id)
 
static bool IsEnabledAnnotBlob (TEnabledFlags enabled_flags, const CID2_Blob_Id &blob_id)
 
static bool IsEnabledCDDBlob (TEnabledFlags enabled_flags, const CID2_Blob_Id &blob_id)
 
static SParsedId2Info ParsePSGId2Info (const string &idsss2_info)
 
static string GetPSGId2Info (const CID2_Blob_Id &tse_id, TID2SplitVersion split_version)
 
- Static Public Member Functions inherited from IPSGS_Processor
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...
 

Protected Member Functions

void ProcessBlobReply (const CID2_Reply &reply)
 
bool HasBlob () const
 
bool Forbidden () const
 
void SendExcludedBlob (const string &psg_blob_id)
 
void SendForbiddenBlob ()
 
void SendBlob ()
 
void x_RegisterTimingFound (EPSGOperation operation, const objects::CID2_Reply_Data &data)
 
string x_GetPSGDataBlobId (const CID2_Blob_Id &blob_id, const CID2_Reply_Data &data)
 
void x_SetBlobState (CBlobRecord &blob_props, TID2BlobState blob_state)
 
void x_SetBlobVersion (CBlobRecord &blob_props, const CID2_Blob_Id &blob_id)
 
void x_SetBlobDataProps (CBlobRecord &blob_props, const CID2_Reply_Data &data)
 
void x_SendBlobProps (const string &psg_blob_id, CBlobRecord &blob_props)
 
void x_SendBlobData (const string &psg_blob_id, const CID2_Reply_Data &data)
 
void x_SendChunkBlobProps (const string &id2_info, TID2ChunkId chunk_id, CBlobRecord &blob_props)
 
void x_SendChunkBlobData (const string &id2_info, TID2ChunkId chunk_id, const CID2_Reply_Data &data)
 
void x_SendMainEntry (const CID2_Blob_Id &osg_blob_id, TID2BlobState blob_state, const CID2_Reply_Data &data)
 
void x_SendSplitInfo (const CID2_Blob_Id &osg_blob_id, TID2BlobState blob_state, TID2SplitVersion split_version, const CID2_Reply_Data &data)
 
void x_SendChunk (const CID2_Blob_Id &osg_blob_id, TID2ChunkId chunk_id, const CID2_Reply_Data &data)
 
void x_SendForbiddenBlob (const CID2_Blob_Id &osg_blob_id, TID2BlobState blob_state)
 
void x_SetSplitVersion (const CID2_Blob_Id &osg_blob_id, TID2SplitVersion split_version)
 
TID2SplitVersion x_GetSplitVersion (const CID2_Blob_Id &osg_blob_id)
 
- Protected Member Functions inherited from CPSGS_OSGProcessorBase
COSGConnectionPoolGetConnectionPool () const
 
void StopAsyncThread ()
 
void SetFinalStatus (EPSGS_Status status)
 
void FinalizeResult (EPSGS_Status status)
 
void FinalizeResult ()
 
bool SignalStartOfBackgroundProcessing ()
 
void SignalEndOfBackgroundProcessing ()
 
void SignalStartOfUVLoop ()
 
void SignalEndOfUVLoop ()
 
TBGProcToken x_CreateBGProcToken ()
 
void x_SignalFinishProcessing (const char *from)
 
void CallDoProcess ()
 
void CallDoProcessSync ()
 
void CallDoProcessAsync ()
 
void CallDoProcessCallback (TBGProcToken token)
 
void DoProcess (TBGProcToken token)
 
void CallDoProcessReplies (TBGProcToken token)
 
void CallDoProcessRepliesSync ()
 
void CallDoProcessRepliesAsync (TBGProcToken token)
 
void CallDoProcessRepliesCallback (TBGProcToken token)
 
void DoProcessReplies ()
 
COSGStateReporter State () const
 
void AddRequest (const CRef< CID2_Request > &req)
 
virtual void CreateRequests ()=0
 
virtual void ProcessReplies ()=0
 
virtual void ResetReplies ()
 
void x_RegisterTiming (EPSGOperation operation, EPSGOperationStatus status, size_t blob_size)
 
void x_RegisterTimingNotFound (EPSGOperation operation)
 
- Protected Member Functions inherited from IPSGS_Processor
bool GetEffectiveSeqIdType (const objects::CSeq_id &parsed_seq_id, int request_seq_id_type, int16_t &eff_seq_id_type, bool need_trace)
 

Static Protected Member Functions

static string x_GetSplitInfoPSGBlobId (const string &main_blob_id)
 
static string x_GetChunkPSGBlobId (const string &main_blob_id, TID2ChunkId chunk_id)
 
template<class C >
static TID2BlobState x_GetBlobState (const C &obj)
 
- Static Protected Member Functions inherited from CPSGS_OSGProcessorBase
static bool x_Valid (const TBGProcToken &token)
 
static CPSGS_OSGProcessorBasex_GetProcessor (const TBGProcToken &token)
 
static void * x_BGProcTokenToVoidP (TBGProcToken &token)
 
static TBGProcToken x_BGProcTokenFromVoidP (void *ptr)
 
static void s_CallDoProcessRepliesUvCallback (void *proc)
 
static void s_CallFinalizeUvCallback (void *data)
 
static bool s_SimulateError ()
 

Protected Attributes

map< string, TID2SplitVersionm_PSGBlobId2SplitVersion
 
CConstRef< CID2_Reply_Get_Blobm_Blob
 
CConstRef< CID2S_Reply_Get_Split_Infom_SplitInfo
 
CConstRef< CID2S_Reply_Get_Chunkm_Chunk
 
- Protected Attributes inherited from IPSGS_Processor
shared_ptr< CPSGS_Requestm_Request
 
shared_ptr< CPSGS_Replym_Reply
 
TProcessorPriority m_Priority
 
bool m_FinishSignalled
 
uv_thread_t m_UVThreadId
 

Additional Inherited Members

- Protected Types inherited from CPSGS_OSGProcessorBase
typedef AutoPtr< CBackgroundProcessingGuardTBGProcToken
 

Detailed Description

Definition at line 54 of file osg_getblob_base.hpp.

Member Typedef Documentation

◆ TID2BlobState

Definition at line 57 of file osg_getblob_base.hpp.

◆ TID2BlobVersion

Definition at line 58 of file osg_getblob_base.hpp.

◆ TID2ChunkId

Definition at line 60 of file osg_getblob_base.hpp.

◆ TID2SplitVersion

Definition at line 59 of file osg_getblob_base.hpp.

Constructor & Destructor Documentation

◆ CPSGS_OSGGetBlobBase()

CPSGS_OSGGetBlobBase::CPSGS_OSGGetBlobBase ( )

Definition at line 49 of file osg_getblob_base.cpp.

◆ ~CPSGS_OSGGetBlobBase()

CPSGS_OSGGetBlobBase::~CPSGS_OSGGetBlobBase ( )
virtual

Definition at line 54 of file osg_getblob_base.cpp.

Member Function Documentation

◆ Forbidden()

bool CPSGS_OSGGetBlobBase::Forbidden ( ) const
protected

◆ GetPSGBlobId()

string CPSGS_OSGGetBlobBase::GetPSGBlobId ( const CID2_Blob_Id blob_id)
static

◆ GetPSGId2Info()

string CPSGS_OSGGetBlobBase::GetPSGId2Info ( const CID2_Blob_Id tse_id,
TID2SplitVersion  split_version 
)
static

◆ HasBlob()

bool CPSGS_OSGGetBlobBase::HasBlob ( ) const
protected

◆ IsCDDBlob()

bool CPSGS_OSGGetBlobBase::IsCDDBlob ( const CID2_Blob_Id blob_id)
static

◆ IsEnabledAnnotBlob()

static bool CPSGS_OSGGetBlobBase::IsEnabledAnnotBlob ( TEnabledFlags  enabled_flags,
const CID2_Blob_Id blob_id 
)
inlinestatic

◆ IsEnabledCDDBlob()

static bool CPSGS_OSGGetBlobBase::IsEnabledCDDBlob ( TEnabledFlags  enabled_flags,
const CID2_Blob_Id blob_id 
)
inlinestatic

◆ IsEnabledOSGBlob() [1/3]

bool CPSGS_OSGGetBlobBase::IsEnabledOSGBlob ( const CID2_Blob_Id blob_id) const
inline

◆ IsEnabledOSGBlob() [2/3]

bool CPSGS_OSGGetBlobBase::IsEnabledOSGBlob ( TEnabledFlags  enabled_flags,
const CID2_Blob_Id blob_id 
)
static

◆ IsEnabledOSGBlob() [3/3]

static bool CPSGS_OSGGetBlobBase::IsEnabledOSGBlob ( TEnabledFlags  enabled_flags,
const CRef< CID2_Blob_Id > &  blob_id 
)
inlinestatic

Definition at line 80 of file osg_getblob_base.hpp.

References IsEnabledOSGBlob().

◆ IsOSGBlob()

bool CPSGS_OSGGetBlobBase::IsOSGBlob ( const CID2_Blob_Id blob_id)
static

◆ ParsePSGBlobId()

CRef< CID2_Blob_Id > CPSGS_OSGGetBlobBase::ParsePSGBlobId ( const SPSGS_BlobId blob_id)
static

◆ ParsePSGId2Info()

CPSGS_OSGGetBlobBase::SParsedId2Info CPSGS_OSGGetBlobBase::ParsePSGId2Info ( const string idsss2_info)
static

◆ ProcessBlobReply()

void CPSGS_OSGGetBlobBase::ProcessBlobReply ( const CID2_Reply reply)
protected

◆ SendBlob()

void CPSGS_OSGGetBlobBase::SendBlob ( )
protected

◆ SendExcludedBlob()

void CPSGS_OSGGetBlobBase::SendExcludedBlob ( const string psg_blob_id)
protected

◆ SendForbiddenBlob()

void CPSGS_OSGGetBlobBase::SendForbiddenBlob ( )
protected

◆ x_GetBlobState()

template<class C >
static TID2BlobState CPSGS_OSGGetBlobBase::x_GetBlobState ( const C obj)
inlinestaticprotected

Definition at line 118 of file osg_getblob_base.hpp.

Referenced by Forbidden(), SendBlob(), and SendForbiddenBlob().

◆ x_GetChunkPSGBlobId()

string CPSGS_OSGGetBlobBase::x_GetChunkPSGBlobId ( const string main_blob_id,
TID2ChunkId  chunk_id 
)
staticprotected

Definition at line 277 of file osg_getblob_base.cpp.

◆ x_GetPSGDataBlobId()

string CPSGS_OSGGetBlobBase::x_GetPSGDataBlobId ( const CID2_Blob_Id blob_id,
const CID2_Reply_Data data 
)
protected

◆ x_GetSplitInfoPSGBlobId()

string CPSGS_OSGGetBlobBase::x_GetSplitInfoPSGBlobId ( const string main_blob_id)
staticprotected

Definition at line 271 of file osg_getblob_base.cpp.

◆ x_GetSplitVersion()

CPSGS_OSGGetBlobBase::TID2SplitVersion CPSGS_OSGGetBlobBase::x_GetSplitVersion ( const CID2_Blob_Id osg_blob_id)
protected

Definition at line 67 of file osg_getblob_base.cpp.

References GetPSGBlobId(), and m_PSGBlobId2SplitVersion.

Referenced by x_SendChunk().

◆ x_RegisterTimingFound()

void CPSGS_OSGGetBlobBase::x_RegisterTimingFound ( EPSGOperation  operation,
const objects::CID2_Reply_Data &  data 
)
protected

◆ x_SendBlobData()

void CPSGS_OSGGetBlobBase::x_SendBlobData ( const string psg_blob_id,
const CID2_Reply_Data data 
)
protected

◆ x_SendBlobProps()

void CPSGS_OSGGetBlobBase::x_SendBlobProps ( const string psg_blob_id,
CBlobRecord blob_props 
)
protected

◆ x_SendChunk()

void CPSGS_OSGGetBlobBase::x_SendChunk ( const CID2_Blob_Id osg_blob_id,
TID2ChunkId  chunk_id,
const CID2_Reply_Data data 
)
protected

◆ x_SendChunkBlobData()

void CPSGS_OSGGetBlobBase::x_SendChunkBlobData ( const string id2_info,
TID2ChunkId  chunk_id,
const CID2_Reply_Data data 
)
protected

◆ x_SendChunkBlobProps()

void CPSGS_OSGGetBlobBase::x_SendChunkBlobProps ( const string id2_info,
TID2ChunkId  chunk_id,
CBlobRecord blob_props 
)
protected

◆ x_SendForbiddenBlob()

void CPSGS_OSGGetBlobBase::x_SendForbiddenBlob ( const CID2_Blob_Id osg_blob_id,
TID2BlobState  blob_state 
)
protected

◆ x_SendMainEntry()

void CPSGS_OSGGetBlobBase::x_SendMainEntry ( const CID2_Blob_Id osg_blob_id,
TID2BlobState  blob_state,
const CID2_Reply_Data data 
)
protected

◆ x_SendSplitInfo()

void CPSGS_OSGGetBlobBase::x_SendSplitInfo ( const CID2_Blob_Id osg_blob_id,
TID2BlobState  blob_state,
TID2SplitVersion  split_version,
const CID2_Reply_Data data 
)
protected

◆ x_SetBlobDataProps()

void CPSGS_OSGGetBlobBase::x_SetBlobDataProps ( CBlobRecord blob_props,
const CID2_Reply_Data data 
)
protected

◆ x_SetBlobState()

void CPSGS_OSGGetBlobBase::x_SetBlobState ( CBlobRecord blob_props,
TID2BlobState  blob_state 
)
protected

◆ x_SetBlobVersion()

void CPSGS_OSGGetBlobBase::x_SetBlobVersion ( CBlobRecord blob_props,
const CID2_Blob_Id blob_id 
)
protected

◆ x_SetSplitVersion()

void CPSGS_OSGGetBlobBase::x_SetSplitVersion ( const CID2_Blob_Id osg_blob_id,
TID2SplitVersion  split_version 
)
protected

Definition at line 59 of file osg_getblob_base.cpp.

References GetPSGBlobId(), and m_PSGBlobId2SplitVersion.

Referenced by CPSGS_OSGGetChunks::CreateRequests(), and SendBlob().

Member Data Documentation

◆ m_Blob

CConstRef<CID2_Reply_Get_Blob> CPSGS_OSGGetBlobBase::m_Blob
protected

◆ m_Chunk

CConstRef<CID2S_Reply_Get_Chunk> CPSGS_OSGGetBlobBase::m_Chunk
protected

◆ m_PSGBlobId2SplitVersion

map<string, TID2SplitVersion> CPSGS_OSGGetBlobBase::m_PSGBlobId2SplitVersion
protected

Definition at line 161 of file osg_getblob_base.hpp.

Referenced by x_GetSplitVersion(), and x_SetSplitVersion().

◆ m_SplitInfo

CConstRef<CID2S_Reply_Get_Split_Info> CPSGS_OSGGetBlobBase::m_SplitInfo
protected

The documentation for this class was generated from the following files:
Modified on Wed Apr 17 13:08:11 2024 by modify_doxy.py rev. 669887