A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/tse__chunk__processor_8cpp_source.html below:

NCBI C++ ToolKit: src/app/pubseq_gateway/server/tse_chunk_processor.cpp Source File

43 using namespace

std::placeholders;

54

shared_ptr<CPSGS_Request> request,

55

shared_ptr<CPSGS_Reply> reply,

57

shared_ptr<CPSGS_SatInfoChunksVerFlavorId2Info> sat_info_chunk_ver_id2info,

58

shared_ptr<CPSGS_IdModifiedVerFlavorId2Info> id_mod_ver_id2info) :

64

this, _1, _2, _3, _4, _5),

66

this, _1, _2, _3, _4, _5)),

67

m_SatInfoChunkVerId2Info(sat_info_chunk_ver_id2info),

68

m_IdModVerId2Info(id_mod_ver_id2info)

84

shared_ptr<CPSGS_Reply> reply)

const 97  if

(tse_chunk_request->m_Id2Chunk == 0)

101

shared_ptr<CPSGS_SatInfoChunksVerFlavorId2Info> sat_info_chunk_ver_id2info;

102

shared_ptr<CPSGS_IdModifiedVerFlavorId2Info> id_mod_ver_id2info;

104

sat_info_chunk_ver_id2info,

105

id_mod_ver_id2info) ==

111  auto

startup_data_state = app->GetStartupDataState();

113  if

(request->NeedTrace()) {

115  " request because Cassandra DB is not available.\n"

+

117

request->GetStartTimestamp());

128

shared_ptr<CPSGS_Reply> reply,

135

shared_ptr<CPSGS_SatInfoChunksVerFlavorId2Info> sat_info_chunk_ver_id2info;

136

shared_ptr<CPSGS_IdModifiedVerFlavorId2Info> id_mod_ver_id2info;

141

sat_info_chunk_ver_id2info,

145

sat_info_chunk_ver_id2info,

152  const string

& id2_info,

153

shared_ptr<CPSGS_SatInfoChunksVerFlavorId2Info> & sat_info_chunk_ver_id2info,

154

shared_ptr<CPSGS_IdModifiedVerFlavorId2Info> & id_mod_ver_id2info)

const 158

sat_info_chunk_ver_id2info.reset(

166

id_mod_ver_id2info.reset(

177  const string

&

info

,

178

unique_ptr<CPSGS_SatInfoChunksVerFlavorId2Info> & id2_info,

186

}

catch

(

const

exception & exc) {

187

err_msg =

"Error extracting id2 info for blob "

+

188

blob_id.

ToString

() +

": "

+ exc.what();

190

err_msg =

"Unknown error while extracting id2 info for blob "

+

195

app->GetCounters().Increment(

this

,

217

app->GetCounters().Increment(

this

,

219  string msg

=

"Unknown TSE chunk satellite number "

+

220

to_string(blob_id.

m_Sat

) +

221  " for the blob "

+ blob_id.

ToString

();

254  "Logic error: none of the id2_info options were initialized"

);

270

app->GetCounters().Increment(

this

,

275  " to a Cassandra keyspace"

;

302

shared_ptr<CCassConnection> cass_connection;

305

cass_connection =

m_IdModVerId2Info

->GetTSEId().m_Keyspace->GetSecureConnection(

307  if

(!cass_connection) {

318

}

catch

(

const

exception & exc) {

336

unique_ptr<CBlobRecord> blob_record(

new CBlobRecord

);

342  auto

blob_prop_cache_lookup_result =

345

last_modified, *blob_record.get());

349  if

(blob_record->GetId2Info().empty()) {

350

app->GetCounters().Increment(

this

,

353  " properties id2info is empty in cache"

);

358

unique_ptr<CPSGS_SatInfoChunksVerFlavorId2Info> cache_id2_info;

364

app->GetCounters().Increment(

this

,

370  if

(cache_id2_info->GetSplitVersion() !=

m_IdModVerId2Info

->GetSplitVersion()) {

371

app->GetCounters().Increment(

this

,

374  " split version in cache does not match the requested one"

);

378

app->GetCounters().Increment(

this

,

383

cache_id2_info->GetChunks(),

false

)) {

392

sat_key = cache_id2_info->GetInfo();

395

sat_key = cache_id2_info->GetInfo() -

396

cache_id2_info->GetChunks() - 1 +

399  SCass_BlobId

chunk_blob_id(cache_id2_info->GetSat(), sat_key);

406  auto

tse_blob_prop_cache_lookup_result = psg_cache.

LookupBlobProp

(

409

last_modified, *blob_record.get());

411

err_msg =

"TSE chunk blob "

+ chunk_blob_id.

ToString

() +

412  " properties are not found in cache"

;

414

err_msg +=

" due to LMDB error"

;

431

vector<string>(), vector<string>(),

434

unique_ptr<CCassBlobFetch> fetch_details;

435

fetch_details.reset(

new CCassBlobFetch

(chunk_request, chunk_blob_id));

439

std::move(blob_record),

441

fetch_details->SetLoader(load_task);

446  this

, _1, _2, _3, _4, _5),

455

fetch_details.get(),

false

));

459  this

, _1, _2, _3, _4, _5),

465  "Cassandra request: "

+

477  " properties are not found in cache"

;

479

err_msg +=

" due to LMDB error"

;

502

unique_ptr<CCassSplitHistoryFetch> fetch_details;

512

fetch_details->SetLoader(load_task);

518  this

, _1, _2, _3, _4, _5),

519

fetch_details.get()));

525

fetch_details.get()));

529  "Cassandra request: "

+

545  this

, _1, _2, _3, _4, _5));

622

shared_ptr<CCassConnection> cass_connection;

627  if

(!cass_connection) {

638

}

catch

(

const

exception & exc) {

658

unique_ptr<CBlobRecord> blob_record(

new CBlobRecord

);

659  auto

tse_blob_prop_cache_lookup_result =

661

last_modified, *blob_record.get());

676

vector<string>(), vector<string>(),

679

unique_ptr<CCassBlobFetch> fetch_details;

693

std::move(blob_record),

697

fetch_details->SetLoader(load_task);

702  this

, _1, _2, _3, _4, _5),

711

fetch_details.get(),

false

));

715  this

, _1, _2, _3, _4, _5),

721  "Cassandra request: "

+

756  "Blob prop callback; found: "

+ to_string(is_found),

771

app->GetCounters().Increment(

this

,

774  auto

blob_id = fetch_details->

GetBlobId

();

775  string

message =

"Blob "

+ blob_id.

ToString

() +

" properties are not found"

;

798  const string

& message)

814  bool

is_error =

IsError

(severity);

820

message, status,

code

, severity);

827

message, status,

code

, severity);

848  const unsigned char

* chunk_data,

849  unsigned int

data_size,

872  "while the output has finished, ignoring"

);

881  "Blob chunk "

+ to_string(chunk_no) +

" callback"

,

888

chunk_data, data_size, chunk_no,

894  "Blob chunk no-more-data callback"

,

919  const string

& message)

932  bool

is_error =

IsError

(severity);

954

vector<SSplitHistoryRecord> &&

result

)

979  "Split history callback; number of records: "

+ to_string(

result

.size()),

986

app->GetCounters().Increment(

this

,

989  string

message =

"Split history version "

+

991  " is not found for the TSE id "

+

1019

unique_ptr<CPSGS_SatInfoChunksVerFlavorId2Info> id2_info;

1021

id2_info, fetch_details->

GetTSEId

(),

true

))

1027

id2_info->GetChunks(),

true

))

1034

sat_key = id2_info->GetInfo();

1036

sat_key = id2_info->GetInfo() - id2_info->GetChunks() - 1 +

1039  SCass_BlobId

chunk_blob_id(id2_info->GetSat(), sat_key);

1043

shared_ptr<CCassConnection> cass_connection;

1046

cass_connection = chunk_blob_id.

m_Keyspace

->GetSecureConnection(

1048  if

(!cass_connection) {

1057

cass_connection = chunk_blob_id.

m_Keyspace

->GetConnection();

1059

}

catch

(

const

exception & exc) {

1077

unique_ptr<CBlobRecord> blob_record(

new CBlobRecord

);

1083  auto

blob_prop_cache_lookup_result =

1086

last_modified, *blob_record.get());

1090  string

err_msg =

"TSE chunk blob "

+ chunk_blob_id.

ToString

() +

1091  " properties are not found in cache"

;

1093

err_msg +=

" due to LMDB error"

;

1111

vector<string>(), vector<string>(),

1112

psg_clock_t::now());

1113

unique_ptr<CCassBlobFetch> cass_blob_fetch;

1114

cass_blob_fetch.reset(

new CCassBlobFetch

(chunk_request, chunk_blob_id));

1122

std::move(blob_record),

1131

cass_blob_fetch->SetLoader(load_task);

1138  this

, _1, _2, _3, _4, _5),

1139

cass_blob_fetch.get(),

1148

cass_blob_fetch.get(),

1154  this

, _1, _2, _3, _4, _5),

1155

cass_blob_fetch.get(),

1160  "Cassandra request: "

+

1166

load_task->

Wait

();

1208  if

(requested_chunk > total_chunks) {

1209  string msg

=

"Invalid chunk requested. " 1210  "The number of available chunks: "

+

1211

to_string(total_chunks) +

", requested number: "

+

1212

to_string(requested_chunk);

1215

app->GetCounters().Increment(

this

,

1237

app->GetCounters().Increment(

this

,

1240  string msg

=

"Unknown TSE chunk satellite number "

+

1241

to_string(blob_id.

m_Sat

) +

1242  " for the blob "

+ blob_id.

ToString

();

1303  if

(details->InPeek()) {

1306

details->SetInPeek(

true

);

1307  x_Peek

(details, need_wait);

1308

details->SetInPeek(

false

);

1328  if

(!fetch_details->GetLoader())

1331  bool

final_state =

false

;

1333  if

(!fetch_details->ReadFinished()) {

1334

final_state = fetch_details->GetLoader()->Wait();

1338  if

(fetch_details->GetLoader()->HasError() &&

1342  string error

= fetch_details->GetLoader()->LastError();

1369

fetch_details->GetLoader()->ClearError();

1370

fetch_details->SetReadFinished();

1382  const string

& message)

const string kCassandraProcessorGroupName

const string kCassandraProcessorEvent

CCassBlobTaskLoadBlob * GetLoader(void)

bool IsBlobPropStage(void) const

void SetDataReadyCB(shared_ptr< CCassDataCallbackReceiver > callback)

void SetConsumeCallback(TConsumeCallback callback)

void SetDataReadyCB(shared_ptr< CCassDataCallbackReceiver > callback)

void SetPropsCallback(TBlobPropsCallback callback)

void SetChunkCallback(TBlobChunkCallbackEx callback)

void SetErrorCB(TDataErrorCallback error_cb)

void SetReadFinished(void)

SCass_BlobId GetBlobId(void) const

CCassBlobTaskFetchSplitHistory * GetLoader(void)

SCass_BlobId GetTSEId(void) const

int64_t GetChunk(void) const

SPSGS_RequestBase::EPSGS_CacheAndDbUse GetUseCache(void) const

int64_t GetSplitVersion(void) const

EPSGS_CacheLookupResult LookupBlobProp(IPSGS_Processor *processor, int sat, int sat_key, int64_t &last_modified, CBlobRecord &blob_record)

bool IsAllowed(void) const

@ ePSGS_SplitHistoryNotFound

@ ePSGS_InvalidId2InfoError

@ ePSGS_ServerSatToSatNameError

@ ePSGS_TSEChunkSplitVersionCacheNotMatched

@ ePSGS_TSEChunkSplitVersionCacheMatched

@ ePSGS_BlobPropsNotFound

@ ePSGS_ClientSatToSatNameError

void Increment(IPSGS_Processor *processor, EPSGS_CounterType counter)

void ReportFailureToGetCassConnection(void)

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

bool IsError(EDiagSev severity) const

EPSGS_MyNCBILookupResult PopulateMyNCBIUser(TMyNCBIDataCB data_cb, TMyNCBIErrorCB error_cb)

void ReportSecureSatUnauthorized(const string &user_name)

list< unique_ptr< CCassFetch > > m_FetchDetails

@ ePSGS_FoundInNotFoundCache

@ ePSGS_IncludeHUPSetToNo

@ ePSGS_FoundInErrorCache

bool AreAllFinishedRead(void) const

bool IsMyNCBIFinished(void) const

void UnlockWaitingProcessor(void)

void CleanupMyNCBICache(void)

IPSGS_Processor::EPSGS_Status GetStatus(void) override

Tells the processor status (if it has finished or in progress)

void ReportMyNCBINotFound(void)

void ReportMyNCBIError(CRequestStatus::ECode status, const string &my_ncbi_message)

void SignalFinishProcessing(void)

optional< string > m_UserName

void x_SendProcessorError(const string &msg, CRequestStatus::ECode status, int code)

void OnGetBlobError(CCassBlobFetch *fetch_details, CRequestStatus::ECode status, int code, EDiagSev severity, const string &message)

CPSGS_TSEChunkProcessor()

void x_ProcessIdModVerId2InfoFinalStage(void)

virtual void ProcessEvent(void)

Called when an event happened which may require to have some processing.

void x_ProcessIdModVerId2Info(void)

shared_ptr< CPSGS_IdModifiedVerFlavorId2Info > m_IdModVerId2Info

bool x_GetMyNCBIUser(void)

EPSGSId2InfoFlavor x_DetectId2InfoFlavor(const string &id2_info, shared_ptr< CPSGS_SatInfoChunksVerFlavorId2Info > &sat_info_chunk_ver_id2info, shared_ptr< CPSGS_IdModifiedVerFlavorId2Info > &id_mod_ver_id2info) const

shared_ptr< CPSGS_SatInfoChunksVerFlavorId2Info > m_SatInfoChunkVerId2Info

void OnGetSplitHistoryError(CCassSplitHistoryFetch *fetch_details, CRequestStatus::ECode status, int code, EDiagSev severity, const string &message)

void OnGetSplitHistory(CCassSplitHistoryFetch *fetch_details, vector< SSplitHistoryRecord > &&result)

void OnGetBlobChunk(CCassBlobFetch *fetch_details, CBlobRecord const &blob, const unsigned char *chunk_data, unsigned int data_size, int chunk_no)

void x_OnMyNCBIError(const string &cookie, CRequestStatus::ECode status, int code, EDiagSev severity, const string &message)

bool x_ValidateTSEChunkNumber(int64_t requested_chunk, CPSGS_SatInfoChunksVerFlavorId2Info::TChunks total_chunks, bool need_finish)

virtual ~CPSGS_TSEChunkProcessor()

SCass_BlobId m_SatInfoChunkVerBlobId

void x_ProcessSatInfoChunkVerId2InfoFinalStage(void)

virtual EPSGS_Status GetStatus(void)

Tells the processor status (if it has finished or in progress)

virtual bool CanProcess(shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply) const

Tells if processor can process the given request.

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.

void x_ProcessSatInfoChunkVerId2Info(void)

bool x_TSEChunkSatToKeyspace(SCass_BlobId &blob_id)

void x_Peek(bool need_wait)

virtual string GetName(void) const

Tells the processor name (used in logging and tracing)

void x_OnMyNCBIData(const string &cookie, CPSG_MyNCBIRequest_WhoAmI::SUserInfo user_info)

virtual string GetGroupName(void) const

Tells the processor group name.

virtual void Process(void)

Main processing function.

void x_RequestTSEChunk(const SSplitHistoryRecord &split_record, CCassSplitHistoryFetch *fetch_details)

bool x_ParseTSEChunkId2Info(const string &info, unique_ptr< CPSGS_SatInfoChunksVerFlavorId2Info > &id2_info, const SCass_BlobId &blob_id, bool need_finish)

void OnGetBlobProp(CCassBlobFetch *fetch_details, CBlobRecord const &blob, bool is_found)

SPSGS_TSEChunkRequest * m_TSEChunkRequest

CPSGSCounters & GetCounters(void)

static CPubseqGatewayApp * GetInstance(void)

Interface class (and self-factory) for request processor objects that can retrieve data from a given ...

shared_ptr< CPSGS_Request > GetRequest(void) const

Provides the user request.

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.

@ e422_UnprocessableEntity

@ 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.

const int64_t kSplitInfoChunk

@ ePSGS_UnknownId2InfoFlavor

@ ePSGS_IdModifiedVerId2InfoFlavor

@ ePSGS_SatInfoChunksVerId2InfoFlavor

string ToJsonString(const CBioseqInfoRecord &bioseq_info, SPSGS_ResolveRequest::TPSGS_BioseqIncludeData include_data_flags, const string &custom_blob_id)

#define PSG_ERROR(message)

#define PSG_WARNING(message)

@ ePSGS_MalformedParameter

@ ePSGS_UnknownResolvedSatellite

@ ePSGS_NoSplitHistoryError

string GetCassStartupDataStateMessage(EPSGS_StartupDataState state)

static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

string ToString(void) const

CBioseqInfoRecord::TSat m_Sat

optional< SSatInfoEntry > m_Keyspace

optional< bool > m_IsSecureKeyspace

bool MapSatToKeyspace(void)

CBioseqInfoRecord::TSatKey m_SatKey

static const string kTSEChunkProcessorName


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