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

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

49

shared_ptr<CPSGS_Reply> reply)

57  "data are not ready for adjustments."

;

64  if

(request->NeedTrace())

65

reply->SendTrace(

"No need to adjust accession"

,

66

request->GetStartTimestamp());

73  for

(

const auto

& seq_id : seq_ids) {

81

seq_ids.erase(seq_id);

83

seq_ids.insert(make_tuple(orig_seq_id_type, orig_accession));

85  if

(request->NeedTrace())

86

reply->SendTrace(

"Accession adjusted with Gi"

,

87

request->GetStartTimestamp());

94  if

(seq_ids.empty()) {

97  "adjusted but the seq_ids list is empty."

;

106  auto

first_seq_id = seq_ids.begin();

110

seq_ids.erase(*first_seq_id);

112

seq_ids.insert(make_tuple(orig_seq_id_type, orig_accession));

114  if

(request->NeedTrace())

115

reply->SendTrace(

"Accession adjusted with type "

+

117  " (first from the seq_ids list)"

,

118

request->GetStartTimestamp());

127

shared_ptr<CPSGS_Reply> reply)

136  if

(request->NeedTrace()) {

137

reply->SendTrace(

"No need to adjust BIOSEQ_INFO 'name' field (not PIR and not PRF)"

,

138

request->GetStartTimestamp());

148  if

(orig_accession.empty()) {

149  PSG_ERROR

(

"BIOSEQ_INFO info record 'accession' field is empty. " 150  "The 'name' field adjustment is impossible."

);

155  if

(!orig_name.empty()) {

156  string

type_as_str =

"PIR"

;

158

type_as_str =

"PRF"

;

160  PSG_WARNING

(

"Non-empty 'name' field (value: "

+ orig_name +

161  ") in BIOSEQ_INFO "

+ type_as_str +

162  " record ('accession' field value: "

+ orig_accession +

")"

);

288  return

severity_as_string;

294  switch

(skip_reason) {

302  return "UnknownSkipReason"

;

310  const string

& processor_id,

311  size_t

bioseq_info_size,

326

reply.append(

buf

,

len

);

331

reply.append(1,

'\n'

);

337  const string

& processor_id,

373  const string

& processor_id,

397  const string

& processor_id,

398  const string

& blob_id,

399  size_t

blob_prop_size,

406  string

last_modified_part;

407  if

(last_modified != -1) {

425

.append(last_modified_part)

431  const string

& processor_id,

433  const string

& id2_info,

434  size_t

blob_prop_size)

463  const string

& processor_id,

499  const string

& processor_id,

501  const string

& id2_info,

542  const string

& processor_id,

565  const string

& processor_id,

588  const string

& processor_id,

589  const string

& blob_id,

599  string

last_modified_part;

600  if

(last_modified != -1) {

618

.append(last_modified_part)

629  const string

& processor_id,

633  const string

& id2_info)

667  const string

& processor_id,

668  const string

& blob_id,

677  string

last_modified_part;

678  if

(last_modified != -1) {

692

.append(last_modified_part)

703  const string

& processor_id,

704  const string

& blob_id,

705  unsigned long

sent_mks_ago,

706  unsigned long

until_resend_mks,

713  string

last_modified_part;

714  if

(last_modified != -1) {

720  unsigned long

ago_sec = sent_mks_ago / 1000000;

722  string

ago_mks(

buf

,

len

);

723  while

(ago_mks.size() < 6)

724

ago_mks =

"0"

+ ago_mks;

726  unsigned long

until_sec = until_resend_mks / 1000000;

728  string

until_mks(

buf

,

len

);

729  while

(until_mks.size() < 6)

730

until_mks =

"0"

+ until_mks;

740

.append(last_modified_part)

763  const string

& processor_id,

764  const string

& blob_id,

767  const string

& id2_info)

802  const string

& processor_id,

803  const string

& blob_id,

805  const string

& id2_info,

806  unsigned long

sent_mks_ago,

807  unsigned long

until_resend_mks)

813  unsigned long

ago_sec = sent_mks_ago / 1000000;

815  string

ago_mks(

buf

,

len

);

816  while

(ago_mks.size() < 6)

817

ago_mks =

"0"

+ ago_mks;

819  unsigned long

until_sec = until_resend_mks / 1000000;

821  string

until_mks(

buf

,

len

);

822  while

(until_mks.size() < 6)

823

until_mks =

"0"

+ until_mks;

862  const string

& processor_id,

886  const string

& processor_id,

911  const string

& processor_id,

912  const string

& blob_id,

924  string

last_modified_part;

925  if

(last_modified != -1) {

943

.append(last_modified_part)

960  const string

& processor_id,

962  const string

& id2_info,

1011  auto

now = psg_clock_t::now();

1012  uint64_t

mks = chrono::duration_cast<chrono::microseconds>

1013

(now - create_timestamp).count();

1016

reply.append(

buf

,

len

);

1024

reply.append(

buf

,

len

)

1040

reply.append(1,

'0'

)

1046

reply.append(

buf

,

len

)

1050

reply.append(

buf

,

len

)

1054

reply.append(

buf

,

len

)

1063  const string

& processor_id,

1064  const string

& progress_status)

1072

reply.append(

buf

,

len

)

1080

.append(progress_status)

1087  const string

& processor_id,

1088  const string

& annot_name,

1089  size_t

annotation_size)

1097

reply.append(

buf

,

len

)

1105

reply.append(

buf

,

len

)

1114  const string

& processor_id,

1127

reply.append(

buf

,

len

)

1135

reply.append(

buf

,

len

)

1139

reply.append(

buf

,

len

)

1143

reply.append(

buf

,

len

)

1152  const string

& processor_id,

1160

reply.append(

buf

,

len

)

1168

reply.append(

buf

,

len

)

1175  const string

& processor_id,

1183

reply.append(

buf

,

len

)

1191

reply.append(

buf

,

len

)

1198  size_t

per_annot_result_size)

1205

reply.append(

buf

,

len

);

1225

reply.append(

buf

,

len

)

1231

reply.append(

buf

,

len

)

1238  const string

& processor_id,

1247

reply.append(

buf

,

len

)

1255

reply.append(

buf

,

len

)

1262  const string

& processor_id,

1270

reply.append(

buf

,

len

)

1278

reply.append(

buf

,

len

)

1286  const string

& processor_id,

1297

reply.append(

buf

,

len

)

1305

reply.append(

buf

,

len

)

1309

reply.append(

buf

,

len

)

1313

reply.append(

buf

,

len

)

1324  const string

& processor_id,

1332

reply.append(

buf

,

len

)

1340

reply.append(

buf

,

len

)

1347  const string

& processor_id,

1363

reply.append(

buf

,

len

)

1371

reply.append(

buf

,

len

)

1375

reply.append(

buf

,

len

)

1379

reply.append(

buf

,

len

)

1390  const string

& processor_id,

1400

reply.append(

buf

,

len

)

1408

reply.append(

buf

,

len

)

1416  const string

& processor_id,

1417  const string

& blob_id,

1426

reply.append(

buf

,

len

)

1436

reply.append(

buf

,

len

)

1440

reply.append(

buf

,

len

)

1447  const string

& processor_id,

1449  const string

& id2_info,

1457

reply.append(

buf

,

len

)

1465

reply.append(

buf

,

len

)

1471

reply.append(

buf

,

len

)

1478  const string

& processor_id,

1486

reply.append(

buf

,

len

)

1494

reply.append(

buf

,

len

)

1507

m_NeedReset(!

CDiagContext

::GetRequestContext().IsSetClientIP())

1520

std::time_t

t

= chrono::system_clock::to_time_t(t_point);

1521

chrono::milliseconds t_ms = chrono::duration_cast<chrono::milliseconds>

1522

(t_point.time_since_epoch());

1524  struct

tm local_time;

1525

localtime_r(&

t

, &local_time);

1528  size_t

char_count = strftime(

buffer

, 64,

1529  "%Y-%m-%d %H:%M:%S"

,

1531

sprintf(&

buffer

[char_count],

".%03ld"

, t_ms.count() % 1000);

1538  return

chrono::duration_cast<chrono::microseconds>(psg_clock_t::now() - t_point).count();

1544  return

chrono::duration_cast<chrono::milliseconds>(psg_clock_t::now() - t_point).count();

1554  unsigned long value

;

1559  if

(signed_value < 0) {

1561  value

=

static_cast<unsigned long>

(-signed_value);

1563  value

=

static_cast<unsigned long>

(signed_value);

1570

*pos++ =

'0'

+

value

% 10;

1574

value_length = pos -

buf

;

1580

*pos-- = *first_digit;

1581

*first_digit++ = temp;

1582

}

while

(first_digit < pos);

1584  return

value_length;

1599  auto const

pos = ip_address.find_last_of(

'.'

);

1601  if

(pos == string::npos) {

1604  return

ip_address.substr(0, pos);

1620

in_port_t client_port,

1630  if

(!client_ip.empty())

1631  context

->SetClientIP(client_ip);

1634  if

(client_port > 0)

1635

extra.

Print

(

"peer_socket_port"

, client_port);

1636

extra.

Print

(

"connection_id"

, connection_id);

1642  int

status,

size_t

bytes_sent)

1645  context

->SetReadOnly(

false

);

1646  context

->SetRequestStatus(status);

1647  context

->SetBytesWr(bytes_sent);

TSeqIdType GetSeqIdType() const

TVersion GetVersion() const

CBioseqInfoRecord & SetName(TName value)

CBioseqInfoRecord & SetSeqIdType(TSeqIdType value)

TAccession const & GetAccession() const

CBioseqInfoRecord & SetAccession(const TAccession &value)

~CRequestContextResetter()

CRequestContextResetter()

static const int chunk_size

The NCBI C++ standard methods for dealing with std::string.

void PrintRequestStop(void)

Print request stop message (for request-driven applications)

CDiagContext_Extra & Print(const string &name, const string &value)

The method does not print the argument, but adds it to the string.

CDiagContext & GetDiagContext(void)

Get diag context instance.

static void SetRequestContext(CRequestContext *ctx)

Shortcut to CDiagContextThreadData::GetThreadData().SetRequestContext()

void PrintRequestStart(const string &message)

Print request start message (for request-driven applications)

static const char * SeverityName(EDiagSev sev)

Get a common symbolic name for the severity levels.

EDiagSev

Severity level for the posted diagnostics.

static string HtmlEncode(const CTempString str, THtmlEncode flags=fHtmlEnc_EncodeAll)

Encode a string for HTML.

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

URL-encode string.

static string & ToLower(string &str)

Convert string to lower case – string& version.

@ e_Gi

GenInfo Integrated Database.

chrono::system_clock::time_point time_point

const GenericPointer< typename T::ValueType > T2 value

#define PSG_ERROR(message)

#define PSG_WARNING(message)

@ ePSGS_NoValidCassMapping

psg_clock_t::time_point psg_time_point_t

EPSGS_AccessionAdjustmentResult

string GetSiteFromIP(const string &ip_address)

static string s_Processor

static string s_MetaChunk

static string s_AndId2Info

static string s_InProgress

string GetPublicCommentCompletionHeader(size_t item_id, const string &processor_id, size_t chunk_count)

string GetReplyMessageHeader(size_t msg_size, CRequestStatus::ECode status, int code, EDiagSev severity)

static string s_AndDataAndMetaChunk

static string s_AccVerHistory

static string s_AndProcessorId

static string s_AndIPGInfoItem

string GetIPGMessageHeader(size_t item_id, const string &processor_id, CRequestStatus::ECode status, int code, EDiagSev severity, size_t msg_size)

static string s_AndBlobPropItem

static string s_AndFmtJson

static string s_MessageChunk

unsigned long GetTimespanToNowMs(const psg_time_point_t &t_point)

string GetPerNamedAnnotationResultsHeader(size_t item_id, size_t per_annot_result_size)

static map< EPSGS_StartupDataState, string > s_CassStartupDataStateMsg

string SanitizeInputValue(const string &input_val)

static string s_AndMessageChunk

string GetTSEBlobChunkHeader(size_t item_id, const string &processor_id, size_t chunk_size, size_t chunk_number, int64_t id2_chunk, const string &id2_info)

string GetAccVerHistoryHeader(size_t item_id, const string &processor_id, size_t msg_size)

string GetBlobMessageHeader(size_t item_id, const string &processor_id, const string &blob_id, size_t msg_size, CRequestStatus::ECode status, int code, EDiagSev severity, CBlobRecord::TTimestamp last_modified)

static string s_DataAndMetaChunk

static string s_AndSentSecondsAgo

static string s_AndReason

static string s_FmtProtobuf

string GetBioseqMessageHeader(size_t item_id, const string &processor_id, size_t msg_size, CRequestStatus::ECode status, int code, EDiagSev severity)

long PSGToString(long signed_value, char *buf)

static string s_AndReplyItem

static string s_ReplyCompletionFixedPart

string GetBlobPropHeader(size_t item_id, const string &processor_id, const string &blob_id, size_t blob_prop_size, CBlobRecord::TTimestamp last_modified)

static string s_AndProcessorItem

static string s_AndMetaChunk

static string s_ReplyBegin

static string s_AndNAStatusItem

static string s_AndDataChunk

static string s_BlobChunk

static string s_BlobPropItem

static string s_NAStatusItem

static string s_AndLastModified

string GetNamedAnnotationMessageHeader(size_t item_id, const string &processor_id, size_t msg_size, CRequestStatus::ECode status, int code, EDiagSev severity)

string GetReplyCompletionHeader(size_t chunk_count, CRequestStatus::ECode status, const psg_time_point_t &create_timestamp)

string GetBlobPropMessageHeader(size_t item_id, const string &processor_id, size_t msg_size, CRequestStatus::ECode status, int code, EDiagSev severity)

static string s_DataChunk

static string SkipReasonToString(EPSGS_BlobSkipReason skip_reason)

string GetBioseqInfoHeader(size_t item_id, const string &processor_id, size_t bioseq_info_size, SPSGS_ResolveRequest::EPSGS_OutputFormat output_format)

static string s_IPGInfoItem

static string s_MessageAndMetaChunk

static string s_AndBlobId

static string s_BioseqInfo

static string s_ProcessorItem

string FormatPreciseTime(const chrono::system_clock::time_point &t_point)

string GetPerNAResultsCompletionHeader(size_t item_id, size_t chunk_count)

string GetTSEBlobPropMessageHeader(size_t item_id, const string &processor_id, int64_t id2_chunk, const string &id2_info, size_t msg_size, CRequestStatus::ECode status, int code, EDiagSev severity)

string GetNamedAnnotationCompletionHeader(size_t item_id, const string &processor_id, size_t chunk_count)

static string s_ReplyItem

string GetTSEBlobPropCompletionHeader(size_t item_id, const string &processor_id, size_t chunk_count)

string GetBlobCompletionHeader(size_t item_id, const string &processor_id, size_t chunk_count)

static string s_AndBioseqNAItem

static string s_LastModified

unsigned long GetTimespanToNowMks(const psg_time_point_t &t_point)

static string s_AndFmtProtobuf

static string s_AndMessageAndMetaChunk

string GetNamedAnnotationHeader(size_t item_id, const string &processor_id, const string &annot_name, size_t annotation_size)

static string s_AndBioseqInfoItemAndDataChunkAndSize

string GetPublicCommentHeader(size_t item_id, const string &processor_id, const string &blob_id, CBlobRecord::TTimestamp last_modified, size_t msg_size)

static string s_AccVerHistoryItem

static string s_AndNChunksOne

static string s_BioseqInfoItem

static string s_ProcessorId

static string s_AndBlobChunk

void DismissErrorRequestContext(CRef< CRequestContext > &context, int status, size_t bytes_sent)

static string SeverityToLowerString(EDiagSev severity)

string GetProcessorMessageCompletionHeader(size_t item_id, const string &processor_id, size_t chunk_count)

string GetBlobChunkHeader(size_t item_id, const string &processor_id, const string &blob_id, size_t chunk_size, size_t chunk_number, CBlobRecord::TTimestamp last_modified)

static string s_AndProgress

static string s_AndBlobItem

static string s_ProtocolPrefix

static string s_DataAndMeta

string GetIPGResolveHeader(size_t item_id, const string &processor_id, size_t msg_size)

static string s_SentSecondsAgo

string GetTSEBlobExcludeHeader(size_t item_id, const string &processor_id, const string &blob_id, EPSGS_BlobSkipReason skip_reason, int64_t id2_chunk, const string &id2_info)

string GetBioseqCompletionHeader(size_t item_id, const string &processor_id, size_t chunk_count)

string GetAccVerHistCompletionHeader(size_t item_id, const string &processor_id, size_t chunk_count)

static string s_AndTimeUntilResend

static string s_AndPublicCommentItem

string GetCassStartupDataStateMessage(EPSGS_StartupDataState state)

static string s_BioseqNAItem

string GetNamedAnnotationMessageCompletionHeader(size_t item_id, const string &processor_id, size_t chunk_count)

static string s_TimeUntilResend

CRef< CRequestContext > CreateErrorRequestContext(const string &client_ip, in_port_t client_port, int64_t connection_id)

static string s_MessageAndMeta

string GetProcessorMessageHeader(size_t item_id, const string &processor_id, size_t msg_size, CRequestStatus::ECode status, int code, EDiagSev severity)

string GetTSEBlobCompletionHeader(size_t item_id, const string &processor_id, size_t chunk_count)

string GetBlobPropCompletionHeader(size_t item_id, const string &processor_id, size_t chunk_count)

static string s_AndId2Chunk

static string s_ChunkType

static string s_AndNChunks

static string s_AndExecTime

static string s_AndBioseqInfoItem

string GetBlobExcludeHeader(size_t item_id, const string &processor_id, const string &blob_id, EPSGS_BlobSkipReason skip_reason, CBlobRecord::TTimestamp last_modified)

static string s_AndStatus

string GetTSEBlobMessageHeader(size_t item_id, const string &processor_id, int64_t id2_chunk, const string &id2_info, size_t msg_size, CRequestStatus::ECode status, int code, EDiagSev severity)

static string s_AndSeverity

static string s_PublicComment

static string s_PublicCommentItem

static string s_AndAccVerHistoryItem

static string s_NChunksOne

string GetTSEBlobPropHeader(size_t item_id, const string &processor_id, int64_t id2_chunk, const string &id2_info, size_t blob_prop_size)

string GetProcessorProgressMessageHeader(size_t item_id, const string &processor_id, const string &progress_status)

EPSGS_AccessionAdjustmentResult AdjustAccession(shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply)

EPSGS_ResolutionResult m_ResolutionResult

EPSGS_AccessionAdjustmentResult m_AccessionAdjustmentResult

CBioseqInfoRecord m_BioseqInfo

bool AdjustName(shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply)

static CS_CONTEXT * context


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