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/my__ncbi__cache_8cpp_source.html below:

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

119

user_data->

m_DataCB

= waiter.m_DataCB;

122

(

void

*)(user_data));

132  const string

& message)

139

user_data->

m_ErrorCB

= waiter.m_ErrorCB;

146

(

void

*)(user_data));

164

(

void

*)(user_data));

172  if

(it->m_Processor == processor) {

180

optional<CMyNCBIOKCache::SUserInfoItem>

182  const string

& cookie,

186

optional<SUserInfoItem> ret;

189

lock_guard<mutex> guard(

m_Lock

);

191  auto

it =

m_Cache

.find(cookie);

215

it->second.x_AddToWaitList(processor, data_cb, error_cb);

220  auto

lru_it = find(

m_LRU

.begin(),

m_LRU

.end(), cookie);

221  if

(lru_it !=

m_LRU

.begin()) {

222  m_LRU

.erase(lru_it);

223  m_LRU

.push_front(cookie);

226

it->second.m_LastTouch = psg_clock_t::now();

237

lock_guard<mutex> guard(

m_Lock

);

239  auto

find_it =

m_Cache

.find(cookie);

240  if

(find_it ==

m_Cache

.end()) {

248  m_LRU

.emplace_front(cookie);

253  auto

lru_it = find(

m_LRU

.begin(),

m_LRU

.end(), cookie);

254  if

(lru_it !=

m_LRU

.begin()) {

255  m_LRU

.erase(lru_it);

256  m_LRU

.push_front(cookie);

261

find_it->second.x_OnSuccess(cookie, user_info);

269  const string

& message)

271

lock_guard<mutex> guard(

m_Lock

);

273  auto

find_it =

m_Cache

.find(cookie);

274  if

(find_it !=

m_Cache

.end()) {

276

find_it->second.x_OnError(cookie, status,

code

, severity, message);

281  auto

lru_it = find(

m_LRU

.begin(),

m_LRU

.end(), cookie);

282  if

(lru_it !=

m_LRU

.end()) {

283  m_LRU

.erase(lru_it);

290

lock_guard<mutex> guard(

m_Lock

);

292  auto

find_it =

m_Cache

.find(cookie);

293  if

(find_it !=

m_Cache

.end()) {

295

find_it->second.x_OnNotFound(cookie);

300  auto

lru_it = find(

m_LRU

.begin(),

m_LRU

.end(), cookie);

301  if

(lru_it !=

m_LRU

.end()) {

302  m_LRU

.erase(lru_it);

311

lock_guard<mutex> guard(

m_Lock

);

313  auto

find_it =

m_Cache

.find(cookie);

314  if

(find_it !=

m_Cache

.end()) {

318

find_it->second.x_RemoveWaiter(processor);

326

lock_guard<mutex> guard(

m_Lock

);

328  auto

find_it =

m_Cache

.find(cookie);

329  if

(find_it !=

m_Cache

.end()) {

335  "The initiator of the myNCBI request for cookie "

+

337  "So the myNCBI reply will not be delivered. " 338  "Please try again."

);

351

lock_guard<mutex> guard(

m_Lock

);

360

list<string> to_be_deleted;

362  for

(

auto

it =

m_LRU

.rbegin(); it !=

m_LRU

.rend(); ++it) {

363  auto

cache_it =

m_Cache

.find(*it);

364  if

(cache_it->second.m_WaitList.empty() &&

368

to_be_deleted.push_back(*it);

369

--need_to_delete_cnt;

370  if

(need_to_delete_cnt == 0)

376  for

(

const auto

& cookie_to_delete: to_be_deleted) {

388

lock_guard<mutex> guard(

m_Lock

);

390  auto

it =

m_Cache

.find(cookie);

401  auto

lru_it = find(

m_LRU

.begin(),

m_LRU

.end(), cookie);

402  if

(lru_it !=

m_LRU

.begin())

403  m_LRU

.erase(lru_it);

412  auto

lru_it = find(

m_LRU

.begin(),

m_LRU

.end(), cookie);

413  if

(lru_it !=

m_LRU

.begin()) {

414  m_LRU

.erase(lru_it);

415  m_LRU

.push_front(cookie);

426

lock_guard<mutex> guard(

m_Lock

);

428  auto

find_it =

m_Cache

.find(cookie);

429  if

(find_it ==

m_Cache

.end()) {

431  m_Cache

[cookie] = psg_clock_t::now();

432  m_LRU

.push_front(cookie);

437

find_it->second = psg_clock_t::now();

439  auto

lru_it = find(

m_LRU

.begin(),

m_LRU

.end(), cookie);

440  if

(lru_it !=

m_LRU

.begin()) {

441  m_LRU

.erase(lru_it);

442  m_LRU

.push_front(cookie);

451

lock_guard<mutex> guard(

m_Lock

);

464

optional<SMyNCBIErrorCacheItem>

467

optional<SMyNCBIErrorCacheItem> ret;

471

lock_guard<mutex> guard(

m_Lock

);

473  auto

it =

m_Cache

.find(cookie);

484  auto

lru_it = find(

m_LRU

.begin(),

m_LRU

.end(), cookie);

485  if

(lru_it !=

m_LRU

.begin())

486  m_LRU

.erase(lru_it);

495  auto

lru_it = find(

m_LRU

.begin(),

m_LRU

.end(), cookie);

496  if

(lru_it !=

m_LRU

.begin()) {

497  m_LRU

.erase(lru_it);

498  m_LRU

.push_front(cookie);

511  const string

& message)

514

lock_guard<mutex> guard(

m_Lock

);

516  auto

find_it =

m_Cache

.find(cookie);

517  if

(find_it ==

m_Cache

.end()) {

520  m_LRU

.push_front(cookie);

525

find_it->second.m_LastTouch = psg_clock_t::now();

527  auto

lru_it = find(

m_LRU

.begin(),

m_LRU

.end(), cookie);

528  if

(lru_it !=

m_LRU

.begin()) {

529  m_LRU

.erase(lru_it);

530  m_LRU

.push_front(cookie);

539

lock_guard<mutex> guard(

m_Lock

);

optional< SMyNCBIErrorCacheItem > GetError(const string &cookie)

CPubseqGatewayApp * m_App

map< string, SMyNCBIErrorCacheItem > m_Cache

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

bool IsNotFound(const string &cookie)

CPubseqGatewayApp * m_App

map< string, psg_time_point_t > m_Cache

void AddNotFound(const string &cookie)

void OnNotFound(const string &cookie)

void ClearWaitingProcessor(const string &cookie, IPSGS_Processor *processor)

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

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

void ClearInitiatedRequest(const string &cookie)

CPubseqGatewayApp * m_App

optional< SUserInfoItem > GetUserInfo(IPSGS_Processor *processor, const string &cookie, TMyNCBIDataCB data_cb, TMyNCBIErrorCB error_cb)

map< string, SMyNCBIOKCacheItem > m_Cache

@ ePSGS_MyNCBIOKCacheWaitHit

@ ePSGS_MyNCBIOKCacheMiss

@ ePSGS_MyNCBINotFoundCacheHit

@ ePSGS_MyNCBIErrorCacheMiss

@ ePSGS_MyNCBINotFoundCacheMiss

@ ePSGS_MyNCBIErrorCacheHit

CPSGSCounters & GetCounters(void)

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

EDiagSev

Severity level for the posted diagnostics.

@ eDiag_Error

Error message.

@ e503_ServiceUnavailable

void my_ncbi_success_cb(void *user_data)

void my_ncbi_not_found_cb(void *user_data)

void my_ncbi_error_cb(void *user_data)

function< void(const string &cookie, CPSG_MyNCBIRequest_WhoAmI::SUserInfo info)> TMyNCBIDataCB

function< void(const string &cookie, CRequestStatus::ECode status, int code, EDiagSev severity, const string &message)> TMyNCBIErrorCB

@ ePSGS_MyNCBIRequestInitiatorDestroyed

unsigned long GetTimespanToNowMs(const psg_time_point_t &t_point)

string SanitizeInputValue(const string &input_val)

CPSG_MyNCBIRequest_WhoAmI::SUserInfo m_UserInfo

SMyNCBIOKCacheItem::EPSGS_MyNCBIResolutionStatus m_Status

CRequestStatus::ECode m_Status

TMyNCBIErrorCB m_NotFoundCB

EPSGS_MyNCBIResolutionStatus m_Status

CPSG_MyNCBIRequest_WhoAmI::SUserInfo m_UserInfo

void x_OnNotFound(const string &cookie)

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

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

psg_time_point_t m_LastTouch

void x_RemoveWaiter(IPSGS_Processor *processor)

list< SMyNCBIWaitListItem > m_WaitList

CPSG_MyNCBIRequest_WhoAmI::SUserInfo m_UserInfo


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