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

NCBI C++ ToolKit: src/objtools/pubseq_gateway/client/psg_client.cpp Source File

34 #ifdef HAVE_PSG_CLIENT 36 #include <condition_variable> 41 #include <type_traits> 42 #include <unordered_map> 43 #include <unordered_set> 46 #include <corelib/ncbi_base64.h> 97  buf

= (

char

*)

buf

+ to_copy;

99

*bytes_read += to_copy;

108  return

src_locked->expected.Cmp<equal_to>(src_locked->received) ?

eRW_Eof

:

eRW_Success

;

121  if

(bytes_read) *bytes_read = read;

157  auto

& src = *src_locked;

158  auto

& chunks = src.chunks;

160  if

(

m_Data

.size() < chunks.size())

m_Data

.resize(chunks.size());

162  for

(

size_t i

= 0;

i

< chunks.size(); ++

i

) {

199  auto

accession =

data

.GetString(

"accession"

);

200  auto

name_node =

data

.GetByKeyOrNull(

"name"

);

201  auto

name = name_node && name_node.IsString() ? name_node.AsString() :

string

();

202  auto version

=

static_cast<int>

(

data

.GetInteger(

"version"

));

203  return

{ objects::CSeq_id(

type

, accession, name,

version

).AsFastaString(),

type

};

208  if

(bio_id.

GetType

()) os <<

"seq_id_type="

<< bio_id.

GetType

() <<

'&'

;

209  return

os <<

"seq_id="

<< bio_id.

GetId

();

224  if

(

data

.HasKey(

"last_modified"

)) {

225

last_modified =

data

.GetInteger(

"last_modified"

);

228  if

(

data

.HasKey(

"blob_id"

)) {

229  return

{

data

.GetString(

"blob_id"

), last_modified };

232  auto

sat =

static_cast<int>

(

data

.GetInteger(

"sat"

));

233  auto

sat_key =

static_cast<int>

(

data

.GetInteger(

"sat_key"

));

234  return

{ sat, sat_key, last_modified };

240  return

os <<

"blob_id="

<< blob_id.

GetId

();

261  template

<ETypePriority = eBlobIdPriority>

264  template

<ETypePriority type_priority = eBlobIdPriority>

265  static

unique_ptr<CPSG_DataId>

Get

(

SDataId

data_id);

267  template

<

class

TRequestedId = CPSG_DataId>

268

unique_ptr<CPSG_DataId>

Get

(shared_ptr<SPSG_Stats>&

stats

);

271  template

<

class

TRequestedId> unique_ptr<TRequestedId>

x_Get

()

const

;

273  template

<

class

TRequestedId,

class

TAllowedId>

274

unique_ptr<TRequestedId>

Get

()

const

;

280 bool

SDataId::HasBlobId<SDataId::eChunkIdPriority>()

const 286

unique_ptr<CPSG_BlobId> SDataId::x_Get<CPSG_BlobId>()

const 290  const auto

& last_modified_str =

m_Args

.

GetValue

(

"last_modified"

);

292  if

(last_modified_str.empty()) {

293  return

make_unique<CPSG_BlobId>(blob_id);

296

last_modified = NStr::StringToNumeric<Int8>(last_modified_str);

297  return

make_unique<CPSG_BlobId>(blob_id, std::move(last_modified));

301

unique_ptr<CPSG_ChunkId> SDataId::x_Get<CPSG_ChunkId>()

const 304  return

make_unique<CPSG_ChunkId>(id2_chunk,

m_Args

.

GetValue

(

"id2_info"

));

307 template

<

class

TRequestedId,

class

TAllowedId>

311  return

x_Get<TAllowedId>();

315  "Both blob_id[+last_modified] and id2_chunk+id2_info pairs are missing/corrupted in server response: "

<<

320 template

<SDataId::ETypePriority type_priority>

326 template

<

class

TRequestedId>

329  auto id

= Get<TRequestedId, TRequestedId>();

335

unique_ptr<CPSG_DataId> SDataId::Get<CPSG_DataId>(shared_ptr<SPSG_Stats>& stats)

340 template

<

class

TReplyItem>

343  if

(chunks.empty())

return

item;

345

unique_ptr<TReplyItem> rv(item);

355

blob_data->m_Stream.reset(

new SPSG_RStream

(item_ts, make_pair(data_id.

HasBlobId

(), reply->stats)));

356  return

blob_data.release();

364  if

(

value

.empty())

return null

;

365  return

NStr::StringToNumeric<double>(

value

);

370  auto id

= SDataId::Get<SDataId::eChunkIdPriority>(args);

371  auto

sent_seconds_ago =

s_GetSeconds

(args,

"sent_seconds_ago"

);

372  auto

time_until_resend =

s_GetSeconds

(args,

"time_until_resend"

);

381  return new CPSG_SkippedBlob

(std::move(

id

), reason, std::move(sent_seconds_ago), std::move(time_until_resend));

386  const auto

& progress = args.

GetValue

(

"progress"

);

403  auto stats

= reply->stats.lock();

407  auto

& args = item.

args

;

408  auto

& chunks = item.

chunks

;

443  using TBase

= pair<CPSG_ReplyItem::EType, CPSG_SkippedBlob::EReason>;

452  const auto

reason = args.

GetValue

(

"reason"

);

454  if

(reason.empty()) {

457

}

else if

(reason ==

"excluded"

) {

460

}

else if

(reason ==

"inprogress"

) {

463

}

else if

(reason ==

"sent"

) {

475  switch

(item_type.first) {

489

args.

SetValue

(

"last_modified"

, to_string(raw_last_modified));

493  if

(TPSG_FailOnUnknownItems::GetDefault()) {

497  static

atomic_bool reported(

false

);

499  if

(!reported.exchange(

true

)) {

500  ERR_POST

(

"Received unknown item type: "

<< item_type.second.get());

508  auto

item_locked = item_ts.

GetLock

();

510  auto

& args = item_locked->args;

513

shared_ptr<CPSG_ReplyItem> rv(CreateImpl(item_ts, *item_locked, itar.first, itar.second));

517

rv->m_Reply = user_reply.lock();

518

rv->m_ProcessorId = args.GetValue(

"processor_id"

);

530  if

(service.empty()) {

534

unique_lock<mutex> lock(sm_Instance.first);

536  auto

found = m_Map->find(service);

538  if

(found != m_Map->end()) {

539  return

*found->second;

543  return

*

created

.first->second;

548

unique_lock<mutex> lock(sm_Instance.first);

550  auto

rv = sm_Instance.second.lock();

553

rv = make_shared<TMap>();

554

sm_Instance.second = rv;

563  for

(

const auto

& p : url_args.

GetArgs

()) {

564

operator[](p.name).emplace(p.value);

578

m_ToValues(m_To[name]),

579

m_FromValues(from_values),

580

m_ToValuesSizeBefore(m_ToValues.

size

())

585  explicit operator bool

() &&;

588  void

AddCorrelated(

const string

& correlated_name);

593  const auto

multivalued =

"enable_processor disable_processor exclude "

+ TPSG_MultivaluedUserArgs::GetDefault();

605

SPSG_UserArgsBuilder::MergeValues::operator

bool

() &&

607  static const

unordered_map<string, string> correlations{

608

{

"enable_processor"

,

"disable_processor"

},

609

{

"disable_processor"

,

"enable_processor"

},

612  auto

found = correlations.find(m_Name);

614  if

(found == correlations.end()) {

617

AddCorrelated(found->second);

620  return

m_ToValues.size() > m_ToValuesSizeBefore;

625  auto

found = m_To.find(correlated_name);

627  if

(found == m_To.end()) {

630  const auto

& correlated = found->second;

631

set_difference(m_FromValues.begin(), m_FromValues.end(), correlated.begin(), correlated.end(), inserter(m_ToValues, m_ToValues.end()));

637  static const auto

multivalued(s_ReadMultivalued());

639  if

(find(multivalued.begin(), multivalued.end(), m_Name) != multivalued.end()) {

640

m_ToValues.insert(m_FromValues.begin(), m_FromValues.end());

642

}

else if

(m_ToValues.empty() && !m_FromValues.empty()) {

643

m_ToValues.emplace(*m_FromValues.begin());

649  bool

added_something =

false

;

651  for

(

const auto

& p : lower_priority) {

652  if

(

MergeValues

(p.first, higher_priority, p.second)) {

653

added_something =

true

;

657  return

added_something;

662  if

(!request_args.empty()) {

663  auto

combined_args = s_GetIniArgs();

666  if

(

Merge

(combined_args, request_args)) {

667

x_MergeOthers(combined_args);

678

ostringstream user_args_os;

679

Build(user_args_os, request_args);

681  if

(

auto

user_args = user_args_os.str(); !user_args.empty()) {

682  auto

abs_path_ref = os.str();

684  if

(

auto

found = abs_path_ref.find(

'?'

); found == string::npos) {

685

os <<

'?'

<< user_args.substr(1);

687

}

else if

(found == abs_path_ref.size() - 1) {

688

os << user_args.substr(1);

700  Merge

(combined_args, m_QueueArgs);

701  Merge

(combined_args, default_args);

706  auto

combined_args = s_GetIniArgs();

707

x_MergeOthers(combined_args);

711

m_CachedArgs = os.str();

718  Merge

(rv, TPSG_RequestUserArgs::GetDefault());

737  switch

(include_data) {

753

user_request->x_GetAbsPathRef(os);

757

m_UserArgsBuilder.GetLock()->Build(os, user_request->m_UserArgs);

759

m_UserArgsBuilder.GetLock()->BuildRaw(os, user_request->m_UserArgs);

767  switch

(acc_substitution) {

781  case eOn

:

return "&auto_blob_skipping=yes"

;

782  case eOff

:

return "&auto_blob_skipping=no"

;

800 template

<

typename

TIterator,

class

TDelimiter,

class

TGet>

804

os << prefix << get(*from++);

812 template

<

class TValues

,

class

... TArgs>

815  return s_DelimitedOutput

(begin(values), end(values), std::forward<TArgs>(args)...);

820

os <<

"/ID/get?"

<< m_BioId;

822  if

(

const auto

tse =

s_GetTSE

(m_IncludeData)) os <<

"&tse="

<< tse;

824  s_DelimitedOutput

(m_ExcludeTSEs, os,

"&exclude_blobs="

,

','

, [](

const auto

& blob_id) {

return

blob_id.GetId(); });

827  if

(m_ResendTimeout.IsInfinite()) {

829

}

else if

(!m_ResendTimeout.IsDefault()) {

830

os <<

"&resend_timeout="

<< m_ResendTimeout.GetAsDouble();

838

os <<

"/ID/resolve?"

<< m_BioId <<

"&fmt=json"

;

841  auto

include_info = m_IncludeInfo;

844  if

(include_info & CPSG_Request_Resolve::TIncludeInfo(max_bit)) {

845

os <<

"&all_info=yes"

;

847

include_info = ~include_info;

869

os <<

"/ID/getblob?"

<< m_BlobId;

871  if

(

const auto

tse =

s_GetTSE

(m_IncludeData)) os <<

"&tse="

<< tse;

876  const auto

&

id

= bio_id.

GetId

();

880  return type

? objects::CSeq_id(objects::CSeq_id::eFasta_AsTypeAndContent,

type

,

id

).AsFastaString() : id;

882  catch

(objects::CSeqIdException&) {

889  auto

bio_id = m_BioIds.begin();

891  _ASSERT

(bio_id != m_BioIds.end());

893

os <<

"/ID/get_na?"

<< *bio_id++;

898  if

(

const auto

tse =

s_GetTSE

(m_IncludeData)) os <<

"&tse="

<< tse;

903  if

(m_SNPScaleLimit != ESNPScaleLimit::eSNPScaleLimit_Default) {

904

os <<

"&snp_scale_limit="

<< objects::CSeq_id::GetSNPScaleLimit_Name(m_SNPScaleLimit);

910

os <<

"/ID/get_tse_chunk?"

<< m_ChunkId;

915

:

CPSG_Request

(std::move(user_context), std::move(request_context)),

916

m_Protein(std::move(protein)),

918

m_Nucleotide(std::move(nucleotide))

938  const auto

has_protein = !

m_Protein

.empty();

940

os <<

"/IPG/resolve"

;

942  if

(has_protein) os <<

"?protein="

<<

m_Protein

;

944  if

(

m_Ipg

) os << (has_protein ?

"&ipg="

:

"?ipg="

) <<

m_Ipg

;

952

os <<

"/ID/get_acc_ver_history?"

<<

m_BioId

;

964  auto

user_request = const_pointer_cast<const CPSG_Request>(

r

);

966  auto

& params = ioc.

params

;

967  auto

&

stats

= ioc.stats;

969  auto

user_context = params.user_request_ids ? user_request->GetUserContext<

string

>() :

nullptr

;

970  const auto

request_id = user_context ? *user_context : ioc.GetNewRequestId();

971  const auto type

= user_request->GetType();

972  const auto

raw = (

type

==

CPSG_Request::eBlob

) && !dynamic_pointer_cast<const CPSG_Request_Blob>(user_request);

973  auto

reply = make_shared<SPSG_Reply>(std::move(request_id), params,

queue

,

stats

, raw);

974  const auto

request_flags =

r

->m_Flags.IsNull() ?

m_RequestFlags

:

r

->m_Flags.GetValue();

975  auto

abs_path_ref =

x_GetAbsPathRef

(user_request, request_flags, raw);

976  const auto

& request_context = user_request->m_RequestContext;

980  auto

request = make_shared<SPSG_Request>(std::move(abs_path_ref), reply, request_context->Clone(), params);

982  if

(ioc.AddRequest(request,

queue

->Stopped(), deadline)) {

984

shared_ptr<CPSG_Reply> user_reply(

new CPSG_Reply

);

985

user_reply->m_Impl->reply = std::move(reply);

986

user_reply->m_Impl->user_reply = user_reply;

987

user_reply->m_Request = std::move(user_request);

999

queue->Push(std::move(user_reply));

1010  if

(queue->WaitUntil(queue->Stopped(), std::move(deadline),

false

,

true

)) {

1020  auto

&

state

= ts->state;

1023  if

(!

state

.InProgress()) {

1024  return state

.GetStatus();

1027  while

(

state

.change.WaitUntil(deadline));

1043  return m_Impl

->item.GetLock()->state.GetMessage(min_severity);

1153  return static_cast<

objects::CBioseq_set::EClass

>

(

m_Data

.

GetInteger

(

"class"

));

1179

m_Id(std::move(id)),

1181

m_SentSecondsAgo(std::move(sent_seconds_ago)),

1182

m_TimeUntilResend(std::move(time_until_resend))

1200

vector<CPSG_BioId> rv;

1201  bool error

= !seq_ids.IsArray();

1204  auto

seq_id = it.GetNode();

1205  error

= !seq_id.IsArray() || (seq_id.GetSize() != 2);

1209  auto

content = seq_id.GetAt(1).AsString();

1210

rv.emplace_back(

string

(objects::CSeq_id::WhichFastaTag(

type

))

1211

+

'|'

+ content,

type

);

1219  auto

request = reply->GetRequest().get();

1223  "' for "

<<

s_GetRequestTypeName

(request->GetType()) <<

" request '"

<< request->GetId() <<

'\''

);

1231  return static_cast<

objects::CSeq_inst::TMol

>

(

m_Data

.

GetInteger

(

"mol"

));

1276

CPSG_Request_Resolve::TIncludeInfo rv = {};

1298

m_Name(std::move(name))

1314  if

(!info_str.empty()) {

1316

istringstream in_stream(in_string);

1318  while

(

in

.HaveMoreData() ) {

1321

ret.push_back(

info

);

1347  auto value

= it.GetNode();

1352

rv.emplace_back(it.GetKey(), status);

1361  auto

request = reply->GetRequest().get();

1365  "' for "

<<

s_GetRequestTypeName

(request->GetType()) <<

" request '"

<< request->GetId() <<

'\''

);

1374

m_Id(std::move(id)),

1375

m_Text(std::move(

text

))

1382

m_ProgressStatus(progress_status)

1466  return m_Impl

->reply->reply_item.GetLock()->state.GetMessage(min_severity);

1474  while

(

auto

new_item =

m_Impl

->reply->GetNextItem(deadline)) {

1476  if

(

auto

item_ts = new_item.value(); !item_ts) {

1480

}

else if

(

auto

rv =

m_Impl

->Create(*item_ts)) {

1499

m_Impl(new

SImpl

(service))

1506  return m_Impl

->SendRequest(std::move(request), std::move(deadline));

1513

shared_ptr<CPSG_Reply> rv;

1514  m_Impl

->queue->Pop(rv, deadline);

1521  return m_Impl

->SendRequestAndGetReply(std::move(request), std::move(deadline));

1534  return m_Impl

->WaitForEvents(std::move(deadline));

1548  return m_Impl

->queue->Empty();

1554  return m_Impl

->RejectsRequests();

1561  m_Impl

->SetRequestFlags(request_flags);

1567  m_Impl

->SetUserArgs(std::move(user_args));

1583

m_ItemComplete(std::move(item_complete)),

1584

m_ReplyComplete(std::move(reply_complete)),

1585

m_NewItem(std::move(new_item))

1603  m_Replies

.emplace_back(std::move(reply), 0);

1607  auto

& reply =

i

->first;

1608  auto

& items =

i

->second;

1609  bool

end_of_reply =

false

;

1616

end_of_reply =

true

;

1624

items.emplace_back(std::move(item));

1627  for

(

auto

j = items.begin(); j != items.end();) {

1640  if

(end_of_reply && items.empty()) {

1660

:

CPSG_Request

(std::move(user_context), std::move(request_context)),

1674  return

make_shared<CPSG_Request_Raw>(std::move(abs_path_ref), std::move(user_context), std::move(request_context));

1679  auto

request = blob_data->GetReply()->GetRequest();

1682  if

(dynamic_pointer_cast<const CPSG_Request_Raw>(request)) {

1683  if

(

auto

blob_id = blob_data->GetId<

CPSG_BlobId

>()) {

1698  auto

&

state

= reply->m_Impl->reply->reply_item->

state

;

1699  return state

.InProgress() ? 0 :

state

.GetStatus().GetHttpCode();

1704

TUvNgHttp2_TestIdentity::SetDefault(identity);

Iterator for JSON arrays and objects.

size_t GetSize() const

For a container node (that is, either an array or an object), return the number of elements in the co...

bool HasKey(const string &key) const

Check if an object node has an element accessible by the specified key.

string Repr(TReprFlags flags=0) const

Return a string representation of this node.

static CJsonNode ParseJSON(const string &json, TParseFlags flags=0)

SJsonIteratorImpl * Iterate(EIterationMode mode=eNatural) const

For a container node (that is, either an array or an object), begin iteration over its elements.

Int8 GetInteger(const string &key) const

For a JSON object node, return the integer referred to by the specified key.

string GetString(const string &key) const

For a JSON object node, return the string referred to by the specified key.

bool IsObject() const

Return true for a JSON object. Return false otherwise.

CJsonNode GetByKey(const string &key) const

For a JSON object node, return the value associated with the specified key.

CJsonNode GetByKeyOrNull(const string &key) const

For a JSON object node, return the value associated with the specified key.

bool IsString() const

Return true for a string node. Return false otherwise.

CObjectIStreamAsnBinary –.

Accession version history - reply to CPSG_Request_AccVerHistory.

TGi GetGi() const

Get GI.

TGi GetChain() const

Get chain.

CPSG_BlobId GetBlobId() const

Get coordinates of the blob.

CPSG_BioId GetCanonicalId() const

Get canonical bio-id for the bioseq (usually "accession.version")

CTime GetDate() const

Get date.

Bio-id (such as accession)

const string & GetId() const

Get ID.

TType GetType() const

Get type.

string Repr() const

Get tilde-separated string representation of this bio ID (e.g. for logging)

Bio-sequence metainfo – result of the bio-id resolution.

CPSG_BioId GetCanonicalId() const

Get canonical bio-id for the bioseq (usually "accession.version")

TState GetState() const

State of this exact bio-sequence's seq-id.

TState GetChainState() const

State of the bio-sequence's seq-id chain, i.e.

objects::CSeq_inst::TMol GetMoleculeType() const

The bioseq's molecule type (DNA, RNA, protein, etc)

TGi GetGi() const

Get GI.

CPSG_BioIds GetOtherIds() const

Get non-canonical bio-ids (aliases) for the bioseq.

TTaxId GetTaxId() const

Get the bioseq's taxonomy ID.

CTime GetDateChanged() const

Date when the bioseq was changed last time.

CPSG_Request_Resolve::TIncludeInfo IncludedInfo() const

What data is immediately available now.

Uint8 GetLength() const

Length of bio-sequence.

CPSG_BlobId GetBlobId() const

Get coordinates of the TSE blob that contains the bioseq itself.

int GetHash() const

Get the bioseq's (pre-calculated) hash.

CPSG_BlobData(unique_ptr< CPSG_DataId > id)

const string & GetId() const

Get ID.

const TLastModified & GetLastModified() const

Get last modified.

TLastModified m_LastModified

string Repr() const override

Get tilde-separated string representation of this blob ID (e.g. for logging)

Blob data meta information.

CTime GetOriginalLoadDate() const

Date when the blob data was first loaded into the database.

objects::CBioseq_set::EClass GetClass() const

Class of this blob data.

string GetFormat() const

Get data serialization format: asn.1, asn1-text, json, xml, ...

CTime GetHupReleaseDate() const

Date when the blob data will be released for public use.

string GetDivision() const

Internal division value (used by various dumpers)

CPSG_BlobInfo(unique_ptr< CPSG_DataId > id)

Uint8 GetStorageSize() const

Get size of the blob data (as it is stored)

string GetCompression() const

Get data compression algorithm: gzip, bzip2, zip, compress, nlmzip, ...

@ eNoIncrementalProcessing

string GetId2Info() const

Get ID2 info.

bool IsState(EState state) const

Uint8 GetSize() const

Get size of the real (before any compression or encryption) blob data.

Uint8 GetNChunks() const

Get number of Cassandra data chunks that constitute this blob data.

Uint8 GetOwner() const

Blob data owner's ID.

string GetUsername() const

Name of the user who loaded this blob data.

const string & GetId2Info() const

Get ID2 info.

string Repr() const override

Get tilde-separated string representation of this chunk ID (e.g. for logging)

int GetId2Chunk() const

Get ID2 chunk number.

A class derived from the queue class that additionally allows to run event loop.

bool RunOnce(CDeadline deadline)

Wait once for events in the queue and process any.

function< void(EPSG_Status, const shared_ptr< CPSG_ReplyItem > &)> TItemComplete

CPSG_EventLoop & operator=(CPSG_EventLoop &&)

CPSG_EventLoop()

Creates an uninitialized instance.

function< void(EPSG_Status, const shared_ptr< CPSG_Reply > &)> TReplyComplete

function< void(const shared_ptr< CPSG_ReplyItem > &)> TNewItem

TReplyComplete m_ReplyComplete

TItemComplete m_ItemComplete

list< pair< shared_ptr< CPSG_Reply >, list< shared_ptr< CPSG_ReplyItem > > > > m_Replies

virtual const char * GetErrCodeString(void) const override

Get error code interpreted as text.

Ipg info – result of the IPG resolution.

string GetNucleotide() const

Get nucleotide.

string GetProtein() const

Get protein.

Int8 GetIpg() const

Get Ipg.

TState GetGbState() const

Get state.

TTaxId GetTaxId() const

Get taxonomy ID.

static void SetTestIdentity(const string &identity)

static shared_ptr< CPSG_Request > CreateRawRequest(string abs_path_ref, shared_ptr< void > user_context, CRef< CRequestContext > request_context)

static const CPSG_BlobId * GetRawResponseBlobId(const shared_ptr< CPSG_BlobData > &blob_data)

static int GetReplyHttpCode(const shared_ptr< CPSG_Reply > &reply)

Named Annotations (NAs) metainfo – reply to CPSG_Request_NamedAnnotInfo.

string GetId2AnnotInfo() const

Base64 encoded asn.1 of ID2-Seq-annot-Info.

CPSG_BlobId GetBlobId() const

Coordinates of the blob that contains the NA data.

objects::CID2S_Seq_annot_Info TId2AnnotInfo

Detailed ID2-Seq-annot-Info structures (from GetId2AnnotInfo, decoded)

list< CRef< TId2AnnotInfo > > TId2AnnotInfoList

CPSG_NamedAnnotInfo(string name)

TId2AnnotInfoList GetId2AnnotInfoList() const

Named Annotations (NAs) status – reply to CPSG_Request_NamedAnnotInfo.

list< TId2AnnotStatus > TId2AnnotStatusList

TId2AnnotStatusList GetId2AnnotStatusList() const

CPSG_Processor(EProgressStatus progress_status)

SPSG_IoCoordinator & GetIoC(const string &service)

static pair< mutex, weak_ptr< TMap > > sm_Instance

static shared_ptr< TMap > GetMap()

A queue to retrieve data (accession resolution info; bio-sequence; annotation blobs) from the storage...

bool SendRequest(shared_ptr< CPSG_Request > request, CDeadline deadline)

Push request into the queue.

shared_ptr< void > TApiLock

Get an API lock.

unique_ptr< SImpl > m_Impl

bool IsEmpty() const

Check whether the queue was stopped/reset and is now empty.

shared_ptr< CPSG_Reply > GetNextReply(CDeadline deadline)

Get the next reply which has started arriving from the server.

bool WaitForEvents(CDeadline deadline)

Wait for events on this queue, on replies returned by this queue and/or on reply items returned by th...

CPSG_Queue()

Creates an uninitialized instance.

CPSG_Queue & operator=(CPSG_Queue &&)

void SetUserArgs(SPSG_UserArgs user_args)

Set arbitrary URL arguments to add to every request.

void Reset()

Stop accepting new requests and cancel all requests whose replies have not been returned yet.

shared_ptr< CPSG_Reply > SendRequestAndGetReply(shared_ptr< CPSG_Request > request, CDeadline deadline)

Push request into the queue and get corresponding reply.

void Stop()

Stop accepting new requests.

void SetRequestFlags(CPSG_Request::TFlags request_flags)

Set request flags.

static TApiLock GetApiLock()

bool RejectsRequests() const

Is the queue in a state (possibly temporary) when requests get immediately rejected.

A self-containing part of the reply, e.g. a meta-data or a data blob.

SPSG_Message GetNextMessage(EDiagSev min_severity=eDiag_Error) const

Unstructured text containing auxiliary info about the result – such as messages and errors that came ...

virtual ~CPSG_ReplyItem()

EPSG_Status GetStatus(CDeadline deadline) const

Get the final result of this blob's retrieval.

shared_ptr< CPSG_Reply > GetReply() const

Get the reply that contains this item.

CPSG_ReplyItem(EType type)

@ eEndOfReply

No more items expected in the (overall!) reply.

PSG reply – corresponds to a PSG request.

shared_ptr< CPSG_ReplyItem > GetNextItem(CDeadline deadline)

Get the next item which has started arriving from the server.

SPSG_Message GetNextMessage(EDiagSev min_severity=eDiag_Error) const

Unstructured text containing auxiliary info about the result – such as messages and errors that came ...

EPSG_Status GetStatus(CDeadline deadline) const

Get the final result of this whole reply's retrieval.

unique_ptr< SImpl > m_Impl

void x_GetAbsPathRef(ostream &) const override

EIncludeData

Specify which info and data is needed.

@ eSmartTSE

If ID2 split is available, return split info blob only.

@ eSlimTSE

If ID2 split is available, return split info blob only.

@ eDefault

Server default.

@ eWholeTSE

If ID2 split is available, return all split blobs.

@ eOrigTSE

Return all Cassandra data chunks of the blob itself.

void x_GetAbsPathRef(ostream &) const override

void x_GetAbsPathRef(ostream &) const override

void x_GetAbsPathRef(ostream &) const override

void x_GetAbsPathRef(ostream &) const override

string x_GetId() const override

CPSG_Request_IpgResolve(string protein, Int8 ipg={}, TNucleotide nucleotide={}, shared_ptr< void > user_context={}, CRef< CRequestContext > request_context={})

void x_GetAbsPathRef(ostream &) const override

EType x_GetType() const override

string x_GetId() const override

void x_GetAbsPathRef(ostream &os) const override

CPSG_Request_Raw(string abs_path_ref, shared_ptr< void > user_context, CRef< CRequestContext > request_context)

@ fName

Requests name to use for canonical bio-id.

void x_GetAbsPathRef(ostream &) const override

Request to the PSG server (see "CPSG_Request_*" below)

CPSG_SkippedBlob(unique_ptr< CPSG_DataId > id, EReason reason, TSeconds sent_seconds_ago, TSeconds time_until_resend)

container_type::size_type size_type

bool IsNull(void) const

Check if the object is unassigned.

SStrictId_Tax::TId TTaxId

Taxon id type.

#define TAX_ID_FROM(T, value)

const TValue & GetValue(void) const

Get a const reference to the current value.

string GetStringUID(TUID uid=0) const

Return string representation of UID.

CDiagContext & GetDiagContext(void)

Get diag context instance.

#define ERR_POST(message)

Error posting with file, line number information but without error codes.

EDiagSev

Severity level for the posted diagnostics.

TErrCode GetErrCode(void) const

Get error code.

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

#define NCBI_THROW_FMT(exception_class, err_code, message)

The same as NCBI_THROW but with message processed as output to ostream.

virtual const char * GetErrCodeString(void) const

Get error code interpreted as text.

int64_t Int8

8-byte (64-bit) signed integer

uint64_t Uint8

8-byte (64-bit) unsigned integer

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

ERW_Result

Result codes for I/O operations.

@ eRW_Eof

End of data, should be considered permanent.

@ eRW_Error

Unrecoverable error, no retry possible.

@ eRW_Success

Everything is okay, I/O completed.

static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)

Split a string using specified delimiters.

static string Base64Decode(const CTempString str)

Base64-decode string.

static string URLEncode(const CTempString str, EUrlEncode flag=eUrlEnc_SkipMarkChars)

URL-encode string.

@ eUrlEnc_URIQueryValue

Encode query part of an URI, arg value.

const long kMilliSecondsPerSecond

Number milliseconds in one second.

@ eNoWait

No-wait, expires immediately.

string GetQueryString(EAmpEncoding amp_enc, NStr::EUrlEncode encode) const

Construct and return complete query string.

const TArgs & GetArgs(void) const

Get the const list of arguments.

void SetValue(const string &name, const string &value)

Set new value for the first argument with the given name or add a new argument.

@ eAmp_Char

Use & to separate arguments.

enum ENcbiSwitch ESwitch

Aux.

E_Choice

Choice variants.

where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is smart and slim</td> n<td> orig</td> n</tr> n<tr> n<td> last_modified</td> n<td> optional</td> n<td> Integer</td> n<td class=\"description\"> The blob last modification If provided then the exact match will be requested with n the Cassandra storage corresponding field value</td> n<td> Positive integer Not provided means that the most recent match will be selected</td> n<td></td> n</tr> n<tr> n<td> use_cache</td> n<td> optional</td> n<td> String</td> n<td class=\"description\"> The option controls if the Cassandra LMDB cache and or database should be used It n affects the seq id resolution step and the blob properties lookup step The following n options are available

static void text(MDB_val *v)

NCBI_PARAM_TYPE(PSG, service) TPSG_Service

vector< CSeq_align const * >::const_iterator TIterator

const TYPE & Get(const CNamedParameterList *param)

constexpr bool empty(list< Ts... >) noexcept

const string version

version string

const struct ncbi::grid::netcache::search::fields::SIZE size

const struct ncbi::grid::netcache::search::fields::CREATED created

const GenericPointer< typename T::ValueType > T2 value

Defines: CTimeFormat - storage class for time format.

map< string, map< string, string > > TValues

std::istream & in(std::istream &in_, double &x_)

double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)

CPSG_BioId s_GetBioId(const CJsonNode &data)

@ fPSGBI_ReservedBlobFlag4

@ fPSGBI_ReservedBlobFlag3

@ fPSGBI_ReservedBlobFlag2

@ fPSGBI_SuppressEditBlocked

@ fPSGBI_WithdrawnPermanently

@ fPSGBI_ReservedBlobFlag1

@ fPSGBI_ReservedBlobFlag0

@ fPSGBI_SuppressTemporarily

@ fPSGBI_NoIncrementalProcessing

const char * s_GetRequestTypeName(CPSG_Request::EType type)

CPSG_BlobId s_GetBlobId(const CJsonNode &data)

const char * s_GetBioIdResolution(EPSG_BioIdResolution value)

const char * s_GetAccSubstitution(EPSG_AccSubstitution acc_substitution)

SPSG_Reply::SState::SStatus s_GetStatus(SPSG_Reply::SItem::TTS &ts, const CDeadline &deadline)

ostream & operator<<(ostream &os, const CPSG_BioId &bio_id)

const char * s_GetAutoBlobSkipping(ESwitch value)

CTime s_GetTime(Int8 milliseconds)

string s_GetFastaString(const CPSG_BioId &bio_id)

const char * s_GetTSE(CPSG_Request_Biodata::EIncludeData include_data)

CPSG_Processor::EProgressStatus s_GetProgressStatus(const SPSG_Args &args)

void s_DelimitedOutput(TIterator from, TIterator to, ostream &os, const char *prefix, TDelimiter delimiter, TGet get)

CPSG_SkippedBlob::TSeconds s_GetSeconds(const SPSG_Args &args, const string &name)

EPSG_AccSubstitution

Whether and how to substitute version-less primary seq-ids with the "more unique" secondary seq-ids.

@ Never

No substitution whatsoever - return exact raw accession info.

@ Default

Substitute always (default)

@ Limited

Substitute only if the resolved record's seq_id_type is GI(12)

EPSG_Status

Retrieval result.

@ eSuccess

Successfully retrieved.

@ eInProgress

Retrieval is not finalized yet, more info may come.

EPSG_BioIdResolution

Whether to try to resolve provided seq-ids before use.

@ Resolve

Try to resolve provided seq-ids.

@ NoResolve

Use provided seq-ids as is.

static const char delimiter[]

shared_ptr< TPSG_Queue > queue

CPSG_Request::TFlags m_RequestFlags

static TApiLock GetApiLock()

string x_GetAbsPathRef(shared_ptr< const CPSG_Request > user_request, const CPSG_Request::TFlags &flags, bool raw)

shared_ptr< CPSG_Reply > SendRequestAndGetReply(shared_ptr< CPSG_Request > request, CDeadline deadline)

bool WaitForEvents(CDeadline deadline)

SImpl(const string &service)

bool SendRequest(shared_ptr< CPSG_Request > request, CDeadline deadline)

CPSG_ReplyItem * CreateImpl(TReplyItem *item, const vector< SPSG_Chunk > &chunks)

shared_ptr< CPSG_ReplyItem > Create(SPSG_Reply::SItem::TTS &item_ts)

unique_ptr< TRequestedId > x_Get() const

SDataId(const SPSG_Args &args)

static unique_ptr< CPSG_DataId > Get(SDataId data_id)

unique_ptr< TRequestedId > Get() const

static SItemTypeAndReason Get(SPSG_Args &args, bool raw)

pair< CPSG_ReplyItem::EType, CPSG_SkippedBlob::EReason > TBase

static constexpr auto raw_last_modified

static SItemTypeAndReason GetIfBlob(const SPSG_Args &args)

SItemTypeAndReason(CPSG_ReplyItem::EType type)

ERW_Result Read(void *buf, size_t count, size_t *bytes_read=0)

Read as many as "count" bytes into a buffer pointed to by the "buf" argument.

SPSG_BlobReader(SPSG_Reply::SItem::TTS &src, TStats stats=TStats())

SPSG_Reply::SItem::TTS & m_Src

ERW_Result PendingCount(size_t *count)

Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that a...

ERW_Result x_Read(void *buf, size_t count, size_t *bytes_read)

vector< SPSG_Chunk > m_Data

pair< bool, weak_ptr< SPSG_Stats > > TStats

bool WaitUntil(TArgs &&... args) volatile

static TValue GetDefault()

vector< SPSG_Chunk > chunks

SStatus GetStatus() const volatile

static auto s_ReadMultivalued()

SPSG_UserArgs::mapped_type TValues

void AddCorrelated(const string &correlated_name)

TValues::size_type m_ToValuesSizeBefore

MergeValues(const string &name, SPSG_UserArgs &to, const TValues &from_values)

const TValues & m_FromValues

static SPSG_UserArgs s_ReadIniArgs()

static bool Merge(SPSG_UserArgs &higher_priority, const SPSG_UserArgs &lower_priority)

static const SPSG_UserArgs & s_GetIniArgs()

void BuildRaw(ostringstream &os, const SPSG_UserArgs &request_args)

void Build(ostream &os, const SPSG_UserArgs &request_args)

void x_MergeOthers(SPSG_UserArgs &combined_args)

Arbitrary request URL arguments.

SPSG_UserArgs(const CUrlArgs &url_args)

Allow construction from a CUrlArgs instance or using CUrlArgs parsing.

void Merge(wxMenu &menu_1, const wxMenu &menu_2)

merges all items form menu_2 into menu_1, preserving the structure if possible


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