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

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

66 static string kNA

=

"n/a"

;

69  "is not recognized: "

;

73

shared_ptr<CPSGS_Reply> reply)

75  auto

now = psg_clock_t::now();

88

reply->GetBytesSent());

96

reply->GetBytesSent());

100  if

(http_req.

GetPath

() ==

"/"

) {

107

reply->Send400(err_msg.c_str());

112

reply->GetBytesSent());

116  if

(fmt ==

"json"

) {

126

reply->GetBytesSent());

138

reply->GetBytesSent());

141

}

catch

(

const

exception & exc) {

143  "Exception when handling no path URL event: "

+

144  string

(exc.what()));

147

reply->GetBytesSent());

150  "Unknown exception when handling no path URL event"

);

153

reply->GetBytesSent());

157  string

bad_url = http_req.

GetPath

();

164  auto

bad_url_size = bad_url.size();

165  if

(bad_url_size > 128) {

167

bad_url +=

"... (truncated; original length: "

+

168

to_string(bad_url_size) +

")"

;

174

reply->GetBytesSent());

177

}

catch

(

const

exception & exc) {

179  "Exception when handling a bad URL event: "

+

180  string

(exc.what()));

183

reply->GetBytesSent());

187  "Unknown exception when handling a bad URL event"

);

190

reply->GetBytesSent());

199

shared_ptr<CPSGS_Reply> reply)

201  auto

now = psg_clock_t::now();

213

reply->GetBytesSent());

220

reply->GetBytesSent());

227

vector<string> enabled_processors;

228

vector<string> disabled_processors;

229  bool

processor_events =

false

;

232

enabled_processors, disabled_processors,

236

reply->GetBytesSent());

245

seq_id_type, use_cache)) {

248

reply->GetBytesSent());

256

reply->GetBytesSent());

267

reply->GetBytesSent());

273  double

resend_timeout;

277

reply->GetBytesSent());

281  int

send_blob_if_small = 0;

285

reply->GetBytesSent());

289  bool

seq_id_resolve =

true

;

293

reply->GetBytesSent());

297

optional<bool> include_hup;

301

reply->GetBytesSent());

305

unique_ptr<SPSGS_RequestBase>

307  string

(seq_id.

data

(), seq_id.

size

()),

308

seq_id_type, exclude_blobs,

309

tse_option, use_cache, subst_option,

313

send_blob_if_small, seq_id_resolve,

314

hops, include_hup,

trace

,

316

enabled_processors, disabled_processors,

318

shared_ptr<CPSGS_Request>

325

reply->GetBytesSent());

328

}

catch

(

const

exception & exc) {

330  "Exception when handling a get request: "

+

331  string

(exc.what()));

334

reply->GetBytesSent());

337  "Unknown exception when handling a get request"

);

340

reply->GetBytesSent());

347

shared_ptr<CPSGS_Reply> reply)

349  auto

now = psg_clock_t::now();

361

reply->GetBytesSent());

369

reply->GetBytesSent());

376

vector<string> enabled_processors;

377

vector<string> disabled_processors;

378  bool

processor_events =

false

;

381

enabled_processors, disabled_processors,

385

reply->GetBytesSent());

394

reply->GetBytesSent());

402

reply->GetBytesSent());

410

reply->GetBytesSent());

414  int

send_blob_if_small = 0;

418

reply->GetBytesSent());

425  if

(!

x_GetBlobId

(http_req, reply, now, blob_id)) {

428

reply->GetBytesSent());

432

optional<bool> include_hup;

436

reply->GetBytesSent());

440

unique_ptr<SPSGS_RequestBase>

442

blob_id, last_modified,

443

tse_option, use_cache,

446

send_blob_if_small, hops, include_hup,

trace

,

448

enabled_processors, disabled_processors, now));

449

shared_ptr<CPSGS_Request>

456

reply->GetBytesSent());

459

}

catch

(

const

exception & exc) {

461  "Exception when handling a getblob request: "

+

462  string

(exc.what()));

465

reply->GetBytesSent());

468  "Unknown exception when handling a getblob request"

);

471

reply->GetBytesSent());

478

shared_ptr<CPSGS_Reply> reply)

480  auto

now = psg_clock_t::now();

492

reply->GetBytesSent());

500

reply->GetBytesSent());

507

vector<string> enabled_processors;

508

vector<string> disabled_processors;

509  bool

processor_events =

false

;

512

enabled_processors, disabled_processors,

516

reply->GetBytesSent());

525

seq_id_type, use_cache)) {

528

reply->GetBytesSent());

537

reply->GetBytesSent());

545

reply->GetBytesSent());

554

reply->GetBytesSent());

558  bool

seq_id_resolve =

true

;

562

reply->GetBytesSent());

567

unique_ptr<SPSGS_RequestBase>

569  string

(seq_id.

data

(), seq_id.

size

()),

570

seq_id_type, include_data_flags, output_format,

571

use_cache, subst_option, seq_id_resolve, hops,

trace

,

573

enabled_processors, disabled_processors, now));

574

shared_ptr<CPSGS_Request>

581

reply->GetBytesSent());

584

}

catch

(

const

exception & exc) {

586  "Exception when handling a resolve request: "

+

587  string

(exc.what()));

590

reply->GetBytesSent());

593  "Unknown exception when handling a resolve request"

);

596

reply->GetBytesSent());

603

shared_ptr<CPSGS_Reply> reply)

605  auto

now = psg_clock_t::now();

617

reply->GetBytesSent());

625

reply->GetBytesSent());

632

vector<string> enabled_processors;

633

vector<string> disabled_processors;

634  bool

processor_events =

false

;

637

enabled_processors, disabled_processors,

641

reply->GetBytesSent());

647  if

(!

x_GetId2Chunk

(http_req, reply, now, id2_chunk_value)) {

650

reply->GetBytesSent());

658

reply->GetBytesSent());

666

reply->GetBytesSent());

670

optional<bool> include_hup;

674

reply->GetBytesSent());

679

unique_ptr<SPSGS_RequestBase>

681

id2_chunk_value, id2_info,

682

use_cache, hops, include_hup,

trace

, processor_events,

683

enabled_processors, disabled_processors, now));

684

shared_ptr<CPSGS_Request>

691

reply->GetBytesSent());

694

}

catch

(

const

exception & exc) {

696  "Exception when handling a get_tse_chunk request: "

+

697  string

(exc.what()));

700

reply->GetBytesSent());

703  "Unknown exception when handling a get_tse_chunk request"

);

706

reply->GetBytesSent());

713

shared_ptr<CPSGS_Reply> reply)

715  auto

now = psg_clock_t::now();

727

reply->GetBytesSent());

735

reply->GetBytesSent());

742

vector<string> enabled_processors;

743

vector<string> disabled_processors;

744  bool

processor_events =

false

;

747

enabled_processors, disabled_processors,

751

reply->GetBytesSent());

761

seq_id_type, use_cache,

true

)) {

764

reply->GetBytesSent());

773

reply->GetBytesSent());

783  "Invalid 'fmt' parameter value. The 'get_na' " 784  "request supports 'json' and 'native' values"

);

787

reply->GetBytesSent());

793

vector<string>

names

;

797

reply->GetBytesSent());

803

vector<string> seq_ids;

810  if

(seq_id.

empty

() && seq_ids.empty()) {

813  "' are found in the request"

);

816

reply->GetBytesSent());

823  if

(!seq_ids.empty()) {

824  sort

(seq_ids.begin(), seq_ids.end());

825  auto last

= unique(seq_ids.begin(), seq_ids.end());

826

seq_ids.erase(

last

, seq_ids.end());

829  if

(!seq_id.

empty

()) {

830  auto

it = find(seq_ids.begin(), seq_ids.end(), seq_id);

831  if

(it != seq_ids.end()) {

841

reply->GetBytesSent());

847  int

send_blob_if_small = 0;

851

reply->GetBytesSent());

855  double

resend_timeout;

859

reply->GetBytesSent());

863  bool

seq_id_resolve =

true

;

867

reply->GetBytesSent());

871

optional<CSeq_id::ESNPScaleLimit> snp_scale_limit;

875

reply->GetBytesSent());

879

optional<bool> include_hup;

883

reply->GetBytesSent());

888

unique_ptr<SPSGS_RequestBase>

890  string

(seq_id.

data

(), seq_id.

size

()),

891

seq_id_type,

names

, use_cache,

896

tse_option, send_blob_if_small, seq_id_resolve,

898

hops, include_hup,

trace

, processor_events,

899

enabled_processors, disabled_processors,

901

shared_ptr<CPSGS_Request>

908

reply->GetBytesSent());

911

}

catch

(

const

exception & exc) {

913  "Exception when handling a get_na request: "

+

914  string

(exc.what()));

917

reply->GetBytesSent());

920  "Unknown exception when handling a get_na request"

);

923

reply->GetBytesSent());

930

shared_ptr<CPSGS_Reply> reply)

932  auto

now = psg_clock_t::now();

945

reply->GetBytesSent());

953

reply->GetBytesSent());

960

vector<string> enabled_processors;

961

vector<string> disabled_processors;

962  bool

processor_events =

false

;

965

enabled_processors, disabled_processors,

970

reply->GetBytesSent());

979

seq_id_type, use_cache)) {

983

reply->GetBytesSent());

988

unique_ptr<SPSGS_RequestBase>

990  string

(seq_id.

data

(), seq_id.

size

()),

991

seq_id_type, use_cache, hops,

trace

, processor_events,

992

enabled_processors, disabled_processors,

994

shared_ptr<CPSGS_Request>

1002

reply->GetBytesSent());

1005

}

catch

(

const

exception & exc) {

1007  "Exception when handling an accession_version_history request: "

+

1008  string

(exc.what()));

1012

reply->GetBytesSent());

1015  "Unknown exception when handling an accession_version_history request"

);

1019

reply->GetBytesSent());

1027

shared_ptr<CPSGS_Reply> reply)

1029  auto

now = psg_clock_t::now();

1041

reply->GetBytesSent());

1049

reply->GetBytesSent());

1054

vector<string> enabled_processors;

1055

vector<string> disabled_processors;

1056  bool

processor_events =

false

;

1059

disabled_processors)) {

1062

reply->GetBytesSent());

1066

processor_events =

false

;

1070

reply->GetBytesSent());

1074

optional<string> protein;

1078

reply->GetBytesSent());

1082

optional<string> nucleotide;

1086

reply->GetBytesSent());

1091  if

(!

x_GetIPG

(http_req, reply, now, ipg)) {

1094

reply->GetBytesSent());

1099  if

(nucleotide.has_value()) {

1100  if

(!protein.has_value()) {

1102  "If a 'nucleotide' parameter is provided " 1103  "then a 'protein' parameter" 1104  " must be provided as well"

);

1107

reply->GetBytesSent());

1113  if

(ipg == -1 && !protein.has_value()) {

1115  "At least one of the 'protein' and 'ipg' " 1116  "parameters must be provided"

);

1119

reply->GetBytesSent());

1127

reply->GetBytesSent());

1131  bool

seq_id_resolve =

true

;

1135

reply->GetBytesSent());

1143

reply->GetBytesSent());

1148

unique_ptr<SPSGS_RequestBase>

1155  trace

, processor_events,

1156

enabled_processors, disabled_processors,

1158

shared_ptr<CPSGS_Request>

1165

reply->GetBytesSent());

1168

}

catch

(

const

exception & exc) {

1170  "Exception when handling an IPG resolve request: "

+

1171  string

(exc.what()));

1174

reply->GetBytesSent());

1177  "Unknown exception when handling an IPG resolve request"

);

1180

reply->GetBytesSent());

1195

GetConfig().Write(conf);

1201  string

conf_file_content =

string

(converter);

1202

vector<string> lines;

1204  if

(!lines.empty()) {

1205  for

(

size_t

k = 0; k < lines.size(); ++k) {

1206  auto

pos = lines[k].find_first_not_of(

" \n\r\t"

);

1208  if

(pos == string::npos) {

1209

l_stripped = lines[k];

1211

l_stripped = lines[k].substr(pos);

1214  if

(

strncasecmp

(l_stripped.c_str(),

"auth_token"

, 10) == 0) {

1215

lines[k] =

"auth_token=*****"

;

1218

conf_file_content = lines[k];

1220

conf_file_content += lines[k];

1222  if

(k != lines.size() - 1) {

1223

conf_file_content +=

"\n"

;

1234

shared_ptr<CPSGS_Reply> reply)

1238  auto

now = psg_clock_t::now();

1260

}

catch

(

const

exception & exc) {

1262  "Exception when handling a config request: "

+

1263  string

(exc.what()));

1266

reply->GetBytesSent());

1269  "Unknown exception when handling a config request"

);

1272

reply->GetBytesSent());

1308

shared_ptr<CPSGS_Reply> reply)

1312  auto

now = psg_clock_t::now();

1343  if

(process_time_result) {

1354  if

(physical_memory > 0)

1361  if

(mem_used_result) {

1362  if

(mem_usage.

total

> 0)

1382  if

(mem_usage.

shared

> 0)

1387  if

(mem_usage.

data

> 0)

1392  if

(mem_usage.

stack

> 0)

1397  if

(mem_usage.

text

> 0)

1402  if

(mem_usage.

lib

> 0)

1407  if

(mem_usage.

swap

> 0)

1424  int

proc_fd_soft_limit;

1425  int

proc_fd_hard_limit;

1428

&proc_fd_hard_limit);

1430  if

(proc_fd_soft_limit >= 0)

1435  if

(proc_fd_hard_limit >= 0)

1440  if

(proc_fd_used >= 0)

1448  if

(proc_thread_count >= 1)

1459

app->GetExcludeBlobCache()->Size());

1463  for

(

auto

item: concurrent_procs) {

1472

reply->SetContentLength(content.size());

1473

reply->SendOk(content.data(), content.size(),

false

);

1477

reply->GetBytesSent());

1479

}

catch

(

const

exception & exc) {

1481  "Exception when handling an info request: "

+

1482  string

(exc.what()));

1485

reply->GetBytesSent());

1488  "Unknown exception when handling an info request"

);

1491

reply->GetBytesSent());

1498

shared_ptr<CPSGS_Reply> reply)

1502  auto

now = psg_clock_t::now();

1552  auto

now = psg_clock_t::now();

1553  uint64_t

sec = chrono::duration_cast<chrono::seconds>

1567

reply->SetContentLength(content.size());

1568

reply->SendOk(content.data(), content.size(),

false

);

1573

}

catch

(

const

exception & exc) {

1575  "Exception when handling a status request: "

+

1576  string

(exc.what()));

1579

reply->GetBytesSent());

1582  "Unknown exception when handling a status request"

);

1585

reply->GetBytesSent());

1595

shared_ptr<CPSGS_Reply> reply)

1599  auto

now = psg_clock_t::now();

1617  if

(username_param.

m_Found

) {

1624  if

(timeout_param.

m_Found

) {

1626

timeout = stoi(

string

(timeout_param.

m_Value

.

data

(),

1629  msg

=

"Invalid shutdown request: cannot convert timeout to an integer. "

;

1630  if

(username.empty())

1631  msg

+=

"Unknown user"

;

1633  msg

+=

"User: "

+ username;

1639

reply, now,

"Invalid timeout (must be a positive integer)"

,

1644

reply->GetBytesSent());

1649  msg

=

"Invalid shutdown request: timeout must be >= 0. "

;

1650  if

(username.empty())

1651  msg

+=

"Unknown user"

;

1653  msg

+=

"User: "

+ username;

1657

reply, now,

"Invalid timeout (must be a positive integer)"

,

1662

reply->GetBytesSent());

1671  msg

=

"Shutdown request received from "

;

1672  if

(username.empty())

1673  msg

+=

"an unknown user"

;

1677  auto

now = psg_clock_t::now();

1678  auto

expiration = now;

1680

expiration += chrono::seconds(timeout);

1685  msg

+=

". The previous shutdown expiration is shorter " 1686  "than this one. Ignored."

;

1688

reply->Send409(

msg

.c_str());

1691

reply->GetBytesSent());

1702

reply->GetBytesSent());

1707

}

catch

(

const

exception & exc) {

1709  "Exception when handling a shutdown request: "

+

1710  string

(exc.what()));

1713

reply->GetBytesSent());

1716  "Unknown exception when handling a shutdown request"

);

1719

reply->GetBytesSent());

1726

shared_ptr<CPSGS_Reply> reply)

1730  auto

now = psg_clock_t::now();

1748

reply->SetContentLength(content.size());

1749

reply->SendOk(content.data(), content.size(),

false

);

1754

}

catch

(

const

exception & exc) {

1756  "Exception when handling a get alerts request: "

+

1757  string

(exc.what()));

1760

reply->GetBytesSent());

1763  "Unknown exception when handling a get alerts request"

);

1766

reply->GetBytesSent());

1773

shared_ptr<CPSGS_Reply> reply)

1775  auto

now = psg_clock_t::now();

1787

reply->GetBytesSent());

1795

reply->GetBytesSent());

1813

reply->GetBytesSent());

1818  if

(!username_param.

m_Found

) {

1823

reply->GetBytesSent());

1840

reply->GetBytesSent());

1845  msg

=

"Alert "

+ alert +

" has already been acknowledged"

;

1846

reply->SendOk(

msg

.data(),

msg

.size(),

false

);

1849

reply->GetBytesSent());

1854

reply->SendOk(

nullptr

, 0,

true

);

1857

reply->GetBytesSent());

1861

}

catch

(

const

exception & exc) {

1863  "Exception when handling an acknowledge alert request: "

+

1864  string

(exc.what()));

1867

reply->GetBytesSent());

1870  "Unknown exception when handling an acknowledge alert request"

);

1873

reply->GetBytesSent());

1880

shared_ptr<CPSGS_Reply> reply)

1882  auto

now = psg_clock_t::now();

1894

reply->GetBytesSent());

1902

reply->GetBytesSent());

1916  bool

reset =

false

;

1924

reply->GetBytesSent());

1927

reset = reset_param.

m_Value

==

"yes"

;

1935

reply->SendOk(

nullptr

, 0,

true

);

1938

reply->GetBytesSent());

1943  int

most_recent_time = INT_MIN;

1945  if

(most_recent_time_param.

m_Found

) {

1949  if

(most_recent_time < 0)

1952  "). It must be >= 0."

;

1956  "). It must be an integer >= 0."

;

1959  if

(!err_msg.empty()) {

1963

reply->GetBytesSent());

1968  int

most_ancient_time = INT_MIN;

1970  if

(most_ancient_time_param.

m_Found

) {

1974  if

(most_ancient_time < 0)

1977  "). It must be >= 0."

;

1981  "). It must be an integer >= 0."

;

1984  if

(!err_msg.empty()) {

1988

reply->GetBytesSent());

1993  if

(most_ancient_time >= 0 && most_recent_time >= 0) {

1995  if

(most_recent_time > most_ancient_time) {

1996  swap

(most_recent_time, most_ancient_time);

2000

vector<CTempString> histogram_names;

2002  if

(histogram_names_param.

m_Found

) {

2006

vector<pair<int, int>> time_series;

2010

reply->GetBytesSent());

2022

reply->SetContentLength(content.size());

2023

reply->SendOk(content.data(), content.size(),

false

);

2028

}

catch

(

const

exception & exc) {

2030  "Exception when handling a statistics request: "

+

2031  string

(exc.what()));

2034

reply->GetBytesSent());

2037  "Unknown exception when handling a statistics request"

);

2040

reply->GetBytesSent());

2047

shared_ptr<CPSGS_Reply> reply)

2051  auto

now = psg_clock_t::now();

2067

reply->SetContentLength(content.size());

2068

reply->SendOk(content.data(), content.size(),

false

);

2072

reply->GetBytesSent());

2074

}

catch

(

const

exception & exc) {

2076  "Exception when handling a dispatcher_status request: "

+

2077  string

(exc.what()));

2080

reply->GetBytesSent());

2083  "Unknown exception when handling a dispatcher_status request"

);

2086

reply->GetBytesSent());

2093

shared_ptr<CPSGS_Reply> reply)

2097  auto

now = psg_clock_t::now();

2112

content.append(1,

'{'

)

2113

.append(

"\"hard_limit_conn_refused_cnt\": "

)

2117

content.append(

", "

)

2118

.append(

"\"soft_limit_req_rejected_cnt\": "

)

2122

content.append(

", "

)

2123

.append(

"\"incoming_connections_cnt\": "

)

2127

content.append(

", "

)

2128

.append(

"\"finished_requests_cnt\": "

)

2132

content.append(

", "

)

2133

.append(

"\"conn_alert_limit\": "

)

2137

content.append(

", "

)

2138

.append(

"\"conn_soft_limit\": "

)

2142

content.append(

", "

)

2143

.append(

"\"conn_hard_limit\": "

)

2147

content.append(

", "

)

2148

.append(

"\"conn_throttle_threshold\": "

)

2152

content.append(

", "

)

2153

.append(

"\"conn_throttle_by_host\": "

)

2157

content.append(

", "

)

2158

.append(

"\"conn_throttle_by_site\": "

)

2162

content.append(

", "

)

2163

.append(

"\"conn_throttle_by_process\": "

)

2167

content.append(

", "

)

2168

.append(

"\"conn_throttle_by_user_agent\": "

)

2172

content.append(

", "

)

2173

.append(

"\"new_throttled_cnt\": "

)

2177

content.append(

", "

)

2178

.append(

"\"old_throttled_cnt\": "

)

2182

content.append(

", "

)

2183

.append(

"\"conn_throttle_close_idle_ms\": "

)

2186

content.append(

", "

)

2187

.append(

"\"conn_info\": "

)

2188

.append(

m_HttpDaemon

->GetConnectionsStatus(reply->GetConnectionId()))

2192

reply->SetContentLength(content.size());

2193

reply->SendOk(content.data(), content.size(),

false

);

2197

reply->GetBytesSent());

2199

}

catch

(

const

exception & exc) {

2201  "Exception when handling a connections_status request: "

+

2202  string

(exc.what()));

2205

reply->GetBytesSent());

2208  "Unknown exception when handling a connections_status request"

);

2211

reply->GetBytesSent());

2218

shared_ptr<CPSGS_Reply> reply)

2222  auto

now = psg_clock_t::now();

2236

reply->GetBytesSent());

2240  string

peer_user_agent;

2244

reply->GetBytesSent());

2249

reply->UpdatePeerIdAndUserAgent(peer_id, peer_user_agent);

2251

reply->SetContentLength(0);

2252

reply->SendOk(

""

, 0,

true

);

2256

reply->GetBytesSent());

2258

}

catch

(

const

exception & exc) {

2259  string

err_msg =

"Exception when handling a hello request: "

+

string

(exc.what());

2261

reply->SetContentLength(err_msg.size());

2262

reply->Send500(err_msg.c_str());

2267

reply->GetBytesSent());

2269  string

err_msg =

"Unknown exception when handling a hello request"

;

2271

reply->SetContentLength(err_msg.size());

2272

reply->Send500(err_msg.c_str());

2277

reply->GetBytesSent());

2284

shared_ptr<CPSGS_Reply> reply)

2286  auto

now = psg_clock_t::now();

2287  bool

need_log =

false

;

2294

reply->GetBytesSent());

2302

reply->GetBytesSent());

2315

need_log = log_param.

m_Value

==

"yes"

;

2329  if

(data_size_param.

m_Found

) {

2333  "' parameter. Accepted values are 0..."

+

2343

reply->GetBytesSent());

2358

reply->GetBytesSent());

2366

reply->SetContentLength(data_size);

2374

reply->GetBytesSent());

2377

}

catch

(

const

exception & exc) {

2379  "Exception when handling a test io request: "

+

2380  string

(exc.what()));

2384

reply->GetBytesSent());

2387  "Unknown exception when handling a test io request"

);

2391

reply->GetBytesSent());

2398

shared_ptr<CPSGS_Reply> reply)

2400  auto

now = psg_clock_t::now();

2412

reply->GetBytesSent());

2420

reply->GetBytesSent());

2431  int32_t

max_sat = current_schema->GetMaxBlobKeyspaceSat();

2433

json.append(1,

'{'

);

2434  for

(

int32_t

sat_n = 0; sat_n <= max_sat; ++sat_n) {

2435

optional<SSatInfoEntry> entry = current_schema->GetBlobKeyspace(sat_n);

2436  if

(entry.has_value()) {

2437  if

(some) json.append(1,

','

);

2442

json.append(1,

'"'

)

2447

.append(entry->keyspace)

2451

json.append(1,

'}'

);

2454

reply->SetContentLength(json.size());

2455

reply->SendOk(json.data(), json.size(),

false

);

2460

}

catch

(

const

exception & exc) {

2462  "Exception when handling a get sat mapping request: "

+

2463  string

(exc.what()));

2466

reply->GetBytesSent());

2469  "Unknown exception when handling a get sat mapping request"

);

2472

reply->GetBytesSent());

2508

reply->SetContentLength(content.size());

2513

reply->SetContentLength(0);

2528  if

(reply->GetExceedSoftLimitFlag()) {

2537

reply->ResetExceedSoftLimitFlag();

2538  m_HttpDaemon

->MigrateConnectionFromAboveLimitToBelowLimit();

2544  string msg

=

"Too many client connections (currently: "

+

2545

to_string(current_conn_num) +

2546  "; at the time of establishing: "

+

2547

to_string(reply->GetConnCntAtOpen()) +

2548  "), it is over the limit ("

+

2557

reply->IncrementRejectedDueToSoftLimit();

2569  if

(reply->GetExceedSoftLimitFlag()) {

2578

reply->ResetExceedSoftLimitFlag();

2579  m_HttpDaemon

->MigrateConnectionFromAboveLimitToBelowLimit();

2585  string msg

=

"Too many client connections (currently: "

+

2586

to_string(current_conn_num) +

2587  "; at the time of establishing: "

+

2588

to_string(reply->GetConnCntAtOpen()) +

2589  "), it is over the limit ("

+

2600

reply->SetContentLength(content.size());

2605

reply->SetContentLength(0);

2612

reply->IncrementRejectedDueToSoftLimit();

2623

shared_ptr<CPSGS_Request> request,

2624

shared_ptr<CPSGS_Reply> reply)

2626

list<string> processor_names =

2628  if

(processor_names.empty())

2634

reply->SetRequestId(request->GetRequestId());

2636  auto

http_conn = reply->GetHttpReply()->GetHttpConnection();

2637

http_conn->Postpone(request, reply, std::move(processor_names));

2646

shared_ptr<CPSGS_Reply> reply,

2661  bool

auth_good =

false

;

2662  if

(auth_token.has_value()) {

2674  if

(username_param.

m_Found

) {

2679  string msg

=

"Unauthorized "

+ request_name +

" request: "

;

2680  if

(auth_token.has_value()) {

2681  msg

+=

"invalid authorization token. "

;

2683  msg

+=

"authorization token not found. "

;

2686  if

(username.empty()) {

2687  msg

+=

"Unknown user"

;

2689  msg

+=

"User: "

+ username;

2697

reply, now,

"Request is not authorized"

,

2702

reply->GetBytesSent());

void PopulatePerRequestMomentousDictionary(CJsonNode &dict)

size_t GetActiveProcGroupCounter(void)

@ ePSGS_AlertAcknowledged

@ ePSGS_AlertAlreadyAcknowledged

@ ePSGS_TcpConnSoftLimitExceeded

optional< string > GetAdminAuthToken(void)

static CJsonNode NewArrayNode()

Create a new JSON array node.

string Repr(TReprFlags flags=0) const

Return a string representation of this node.

void SetString(const string &key, const string &value)

Set a JSON object element to the specified string value.

void SetByKey(const string &key, CJsonNode::TInstance value)

For a JSON object node, insert a new element or update an existing element.

static CJsonNode NewObjectNode()

Create a new JSON object node.

CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:

void Register(EPSGS_AlertType alert_type, const string &message)

CJsonNode Serialize(void) const

EPSGS_AlertAckResult Acknowledge(const string &alert_id, const string &user)

@ ePSGS_MyNCBIErrorCacheSize

@ ePSGS_GracefulShutdownExpiredInSec

@ ePSGS_NumConnHardLimitExceeded

@ ePSGS_CassandraActiveStatements

@ ePSGS_SplitInfoCacheSize

@ ePSGS_ActiveProcessorGroups

@ ePSGS_ShutdownRequested

@ ePSGS_NonProtocolRequests

@ ePSGS_NumConnBadToGoodMigration

@ ePSGS_NumReqRefusedDueToSoftLimit

@ ePSGS_NumberOfConnections

@ ePSGS_MyNCBIOKCacheSize

@ ePSGS_IncomingConnectionsCounter

@ ePSGS_NoProcessorInstantiated

@ ePSGS_SatMappingRequest

@ ePSGS_MyNCBINotFoundCacheSize

@ ePSGS_AnnotationRequest

@ ePSGS_BlobBySatSatKeyRequest

@ ePSGS_IPGResolveRequest

@ ePSGS_AccessionVersionHistoryRequest

@ ePSGS_BlobBySeqIdRequest

void x_Finish500(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, EPSGS_PubseqGatewayErrorCode code, const string &err_msg)

bool x_GetAccessionSubstitutionOption(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_RequestBase::EPSGS_AccSubstitutioOption &acc_subst_option)

int OnConfig(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

unique_ptr< CHttpDaemon > m_HttpDaemon

unique_ptr< CMyNCBIErrorCache > m_MyNCBIErrorCache

int OnGet(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

void x_SendZEndPointReply(CRequestStatus::ECode http_status, shared_ptr< CPSGS_Reply > reply, const string *payload)

bool x_GetIPG(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int64_t &ipg)

bool x_GetPeerUserAgentParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, string &peer_user_agent)

bool x_GetId2Info(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, string &id2_info)

bool x_IsBoolParamValid(const string &param_name, const CTempString &param_value, string &err_msg) const

int OnShutdown(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

void x_MalformedArguments(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, const string &err_msg)

bool x_GetIntrospectionFormat(CHttpRequest &req, string &fmt, string &err_msg)

int OnConnectionsStatus(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

int OnGetBlob(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

bool x_GetLastModified(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int64_t &last_modified)

bool x_GetIncludeHUPParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, optional< bool > &include_hup)

bool x_DispatchRequest(CRef< CRequestContext > &context, shared_ptr< CPSGS_Request > request, shared_ptr< CPSGS_Reply > reply)

int OnGetAlerts(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

bool x_GetNames(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, vector< string > &names)

void x_PrintRequestStop(CRef< CRequestContext > &context, CPSGS_Request::EPSGS_Type request_type, CRequestStatus::ECode status, size_t bytes_sent)

void x_InsufficientArguments(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, const string &err_msg)

bool x_CheckAuthorization(const string &request_name, CRef< CRequestContext > context, CHttpRequest &http_req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now)

bool x_GetTSEOption(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_BlobRequestBase::EPSGS_TSEOption &tse_option)

SPubseqGatewaySettings m_Settings

bool x_GetSeqIdResolveParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, bool &auto_blob_skipping)

int OnStatistics(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

int OnTestIO(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

bool x_GetProcessorEventsParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, bool &processor_events)

int OnAckAlert(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

int OnGetNA(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

unique_ptr< COperationTiming > m_Timing

int OnGetSatMapping(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

bool x_GetNucleotide(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, optional< string > &nucleotide)

string x_GetCmdLineArguments(void) const

bool x_GetSNPScaleLimit(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, optional< CSeq_id::ESNPScaleLimit > &snp_scale_limit)

unique_ptr< CMyNCBIOKCache > m_MyNCBIOKCache

shared_ptr< CSatInfoSchemaProvider > m_CassSchemaProvider

bool x_ProcessCommonGetAndResolveParams(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, CTempString &seq_id, int &seq_id_type, SPSGS_RequestBase::EPSGS_CacheAndDbUse &use_cache, bool seq_id_is_optional=false)

bool x_GetResendTimeout(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, double &resend_timeout)

unique_ptr< CMyNCBINotFoundCache > m_MyNCBINotFoundCache

bool x_GetEnabledAndDisabledProcessors(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, vector< string > &enabled_processors, vector< string > &disabled_processors)

int OnGetTSEChunk(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

unique_ptr< CPSGS_Dispatcher > m_RequestDispatcher

int OnStatus(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

void x_SendMessageAndCompletionChunks(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, const string &message, CRequestStatus::ECode status, int code, EDiagSev severity)

CRef< CRequestContext > x_CreateRequestContext(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

bool x_GetResolveFlags(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_ResolveRequest::TPSGS_BioseqIncludeData &include_data_flags)

unique_ptr< CPSGSCounters > m_Counters

bool x_GetPeerIdParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, string &peer_id)

unique_ptr< char[]> m_IOTestBuffer

bool x_GetCommonIDRequestParams(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_RequestBase::EPSGS_Trace &trace, int &hops, vector< string > &enabled_processors, vector< string > &disabled_processors, bool &processor_events)

bool x_GetOutputFormat(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_ResolveRequest::EPSGS_OutputFormat &output_format)

bool x_IsShuttingDown(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now)

int OnInfo(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

bool x_IsConnectionAboveSoftLimitForZEndPoints(shared_ptr< CPSGS_Reply > reply, bool verbose)

static CPubseqGatewayApp * GetInstance(void)

bool x_IsConnectionAboveSoftLimit(shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &create_timestamp)

SRequestParameter x_GetParam(CHttpRequest &req, const string &name) const

vector< string > x_GetExcludeBlobs(CHttpRequest &req) const

bool x_IsShuttingDownForZEndPoints(shared_ptr< CPSGS_Reply > reply, bool verbose)

bool x_GetTimeSeries(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, vector< pair< int, int >> &time_series)

bool x_GetId2Chunk(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int64_t &id2_chunk)

int OnIPGResolve(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

int OnHello(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

bool x_GetTraceParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_RequestBase::EPSGS_Trace &trace)

shared_ptr< CCassConnection > m_CassConnection

bool x_GetBlobId(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_BlobId &blob_id)

int OnAccessionVersionHistory(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

int OnResolve(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

bool x_GetUseCacheParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, SPSGS_RequestBase::EPSGS_CacheAndDbUse &use_cache)

bool x_GetProtein(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, optional< string > &protein)

int OnBadURL(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

bool x_GetSendBlobIfSmallParameter(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply, const psg_time_point_t &now, int &send_blob_if_small)

string x_PrepareConfigJson(void)

int OnDispatcherStatus(CHttpRequest &req, shared_ptr< CPSGS_Reply > reply)

unique_ptr< CSplitInfoCache > m_SplitInfoCache

static unsigned int GetCpuCount(void)

Return number of active CPUs/cores (never less than 1).

static Uint8 GetTotalPhysicalMemorySize(void)

Return the amount of actual/total physical memory, in bytes.

CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...

static const struct name_t names[]

static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)

void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)

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()

CDiagContext_Extra Extra(void) const

Create a temporary CDiagContext_Extra object.

static TPID GetPID(void)

Get cached PID (read real PID if not cached yet).

@ eDiag_Error

Error message.

@ e503_ServiceUnavailable

@ e500_InternalServerError

uint64_t Uint8

8-byte (64-bit) unsigned integer

size_t resident_peak

Peak resident set size ("high water mark")

static int GetThreadCount(void)

Get the number of threads in the current process.

size_t total_peak

Peak total memory usage.

size_t resident

Resident/working set size (RSS).

static int GetFileDescriptorsCount(int *soft_limit=NULL, int *hard_limit=NULL)

Get the number of file descriptors consumed by the current process, and optional system wide file des...

size_t total

Total memory usage.

size_t shared

Shared memory usage.

size_t text

Text (code) segment size.

static bool GetMemoryUsage(SMemoryUsage &usage)

Get current process memory usage.

size_t swap

Swap space usage.

size_t lib

Shared library code size.

size_t data

Data segment size.

static bool GetTimes(double *real, double *user, double *sys, EWhat what=eProcess)

Get current process execution times.

size_t stack

Stack size of the initial thread in the process.

static string PrintableString(const CTempString str, TPrintableMode mode=fNewLine_Quote|fNonAscii_Passthru)

Get a printable version of the specified string.

static Int8 StringToInt8(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to Int8.

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.

const char * data(void) const

Return a pointer to the array represented.

bool empty(void) const

Return true if the represented string is empty (i.e., the length is zero)

static long StringToLong(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to long.

size_type size(void) const

Return the length of the represented array.

string AsString(const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const

Transform time to string.

constexpr auto sort(_Init &&init)

Defines NCBI C++ diagnostic APIs, classes, and macros.

Multi-threading – classes, functions, and features.

const long kMaxTestIOSize

static string kBadUrlMessage

static string kHistogramNamesParam

static string kProcFDUsed

static string kConcurrentPrefix

static string kMemoryUsedSwap

static string kProcThreadCount

SShutdownData g_ShutdownData

static string kConfigurationFilePath

static string kProcFDSoftLimit

static string kMemoryUsedTotal

static string kMemoryUsedShared

static string kSeqIdsParam

static string kSystemTime

static string kPhysicalMemory

static string kUsernameParam

static string kMemoryUsedResidentPeak

static string kMemoryUsedText

static size_t s_ShutdownSize

static string kTimeoutParam

static string kDataSizeParam

static string kExcludeBlobCacheUserCount

static string kMostRecentTimeParam

static string kMemoryUsedData

static string kConfiguration

static string kMemoryUsedStack

static string kTSELastModifiedParam

static string kMemoryUsedLib

static const char * s_Shutdown

static string kShuttingDownMsg

static string kCommandLineArguments

static string kMostAncientTimeParam

static string kMemoryUsedResident

static string kExecutablePath

static string kProcFDHardLimit

static string kAlertParam

static string kResetParam

static string kClientIdParam

static string kMemoryUsedTotalPeak

static string kStartupDataState

#define PSG_ERROR(message)

#define PSG_MESSAGE(message)

#define PSG_WARNING(message)

@ ePSGS_GetSatMappingError

@ ePSGS_ConnectionsStatusError

@ ePSGS_DispatcherStatusError

@ ePSGS_MalformedParameter

@ ePSGS_InsufficientArguments

@ ePSGS_ConnectionExceedsSoftLimit

psg_clock_t::time_point psg_time_point_t

string SanitizeInputValue(const string &input_val)

long PSGToString(long signed_value, char *buf)

string GetCassStartupDataStateMessage(EPSGS_StartupDataState state)

#define PUBSEQ_GATEWAY_BUILD_DATE

#define PUBSEQ_GATEWAY_VERSION

Defines CRequestContext class for NCBI C++ diagnostic API.

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

Process memory usage information, in bytes.

EPSGS_AccSubstitutioOption

@ ePSGS_DefaultAccSubstitution

int TPSGS_BioseqIncludeData

int64_t m_TcpMaxConnAlertLimit

size_t m_ConnThrottleByProcess

size_t m_ConnThrottleThreshold

size_t m_ConnThrottleByUserAgent

bool IsAuthProtectedCommand(const string &cmd) const

int64_t m_TcpMaxConnSoftLimit

size_t m_ConnThrottleByHost

double m_ConnThrottleCloseIdleSec

size_t m_ConnThrottleBySite

atomic_bool m_ShutdownRequested

psg_time_point_t m_Expired

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