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

NCBI C++ ToolKit: src/app/netschedule/ns_handler.cpp Source File

45 #include <sys/types.h> 46 #include <sys/socket.h> 47 #include <netinet/in.h> 48 #include <netinet/tcp.h> 335

{

"affinity_may_change"

,

350

{

"affinity_may_change"

,

594

((

string

*)

data

)->append((

const char

*) ptr,

size

);

615

m_ProcessMessage(

NULL

),

619

m_WithinBatchSubmit(

false

),

620

m_SingleCmdParser(sm_CommandMap),

621

m_BatchHeaderParser(sm_BatchHeaderMap),

622

m_BatchEndParser(sm_BatchEndMap),

623

m_ClientIdentificationPrinted(

false

),

624

m_RollbackAction(

NULL

)

708

(read_count > 0 || write_count > 0)) {

716  ERR_POST

(

"Unseccessfull client socket shutdown. " 717  "The socket may have data not delivered to the client. " 718  "Error code: "

<< status <<

": "

<<

IO_StatusStr

(status));

746  ERR_POST

(

"eCommunicationError:Connection pool full"

);

749  ERR_POST

(

"eCommunicationError:Unpollable connection"

);

752  ERR_POST

(

"eCommunicationError:Request queue full"

);

755  ERR_POST

(

"eCommunicationError:Unknown overflow error"

);

767  ERR_POST

(

"NetSchedule is shutting down. Client input rejected."

);

770  "is shutting down. Session aborted."

+

777  string

error_client_message;

819  catch

(

const

exception & ex) {

821

error_client_message =

"ERR:"

+

823  "error - "

+

string

(ex.

what

()));

827  ERR_POST

(

"ERR:Unknown server exception."

);

828

error_client_message =

"ERR:eInternalError:Unknown server exception."

;

852

setsockopt(fd, IPPROTO_TCP, TCP_QUICKACK, &

val

,

sizeof

(

val

));

860  size_t

required_size)

872  #if defined(_DEBUG) && !defined(NDEBUG) 880

nanosleep(&delay,

NULL

);

897

msg_size =

value

.size();

898  while

(msg_size >= 1 &&

msg

[msg_size-1] ==

'\n'

)

900

required_size = msg_size + 1;

922  size_t

msg_size =

msg

.size();

923  bool

has_eom =

false

;

925  while

(msg_size >= 1 &&

msg

[msg_size-1] ==

'\n'

) {

930  size_t

required_size = msg_size + 1;

931  const char

* msg_buf =

NULL

;

934

msg_buf =

msg

.data();

947  #if defined(_DEBUG) && !defined(NDEBUG) 970  size_t

written_bytes,

976  "Error writing message to the client. " 978  "Socket write error status: "

+

IO_StatusStr

(write_result) +

". " 979  "Written bytes: "

+ to_string(written_bytes) +

". " 980  "Socket write timing: "

+ to_string(

double

(timing)) +

". " 981  "Message begins with: "

;

982  if

(

msg

.size() > 32)

983

report +=

msg

.substr(0, 32) +

" (TRUNCATED)"

;

1011  unsigned int

peer_addr;

1056  string msg

=

"Error authenticating client: '"

;

1090  for

(

const auto

& param : params) {

1091  if

(param.first ==

"status"

) {

1092

diag_extra.

Print

(

"job_status"

, param.second);

1094

diag_extra.

Print

(param.first, param.second);

1195  bool

restore_client =

false

;

1197  unsigned int

orig_client_id = 0;

1212

restore_client =

true

;

1220  "Job queue is required"

);

1239  bool

client_was_found =

false

;

1240  bool

session_was_reset =

false

;

1242  bool

had_wn_pref_affs =

false

;

1243  bool

had_reader_pref_affs =

false

;

1247

session_was_reset, old_session,

1248

had_wn_pref_affs, had_reader_pref_affs);

1249  if

(client_was_found && session_was_reset) {

1251  string

wn_val =

"true"

;

1252  if

(!had_wn_pref_affs)

1253

wn_val =

"had none"

;

1254  string

reader_val =

"true"

;

1255  if

(!had_reader_pref_affs)

1256

reader_val =

"had none"

;

1261

.

Print

(

"client_old_session"

, old_session)

1262

.

Print

(

"wn_preferred_affinities_reset"

, wn_val)

1263

.

Print

(

"reader_preferred_affinities_reset"

, reader_val);

1273  if

(restore_client) {

1320  if

(!size_str.

empty

())

1335  ERR_POST

(

"Server error: "

<< ex);

1347  ERR_POST

(

"Error processing command: "

<< ex);

1359  ERR_POST

(

"Unknown error while expecting BTCH or ENDS"

);

1407  ERR_POST

(

"Error processing command: "

<< ex);

1410  "Invalid batch submission, syntax error"

+

1421  ERR_POST

(

"Arguments parsing unknown exception. " 1422  "Batch submit is rejected."

);

1425  "Arguments parsing unknown exception"

+

1480  ERR_POST

(

"Error processing command: "

<< ex);

1483  "Batch submit error - unexpected end of batch"

+

1494  ERR_POST

(

"Unknown error while expecting ENDB."

);

1497  "Unknown error while expecting ENDB."

+

1513  ctx

->SetRequestID();

1516

.Print(

"_type"

,

"cmd"

)

1520

.Print(

"cmd"

,

"BTCH"

)

1537

.

Print

(

"start_job"

, job_id)

1538

.

Print

(

"commit_time"

,

1541

.

Print

(

"transaction_time"

,

1556

SetRequestStatus(ex.ErrCodeToHTTPStatusCode());

1602

<<

" for unknown job: " 1615

reply.reserve(1024);

1617

reply.append(

"OK:job_status="

)

1619

.append(

"&job_exptime="

)

1620

.append(to_string(lifetime.

Sec

()));

1623

reply.append(

"&pause=pullback"

);

1625

reply.append(

"&pause=nopullback"

);

1628

reply.append(

"&msg="

)

1649  string

progress_msg;

1651

client_ip, client_sid,

1652

client_phid, progress_msg,

1658

<<

" for unknown job: " 1672

reply.reserve(1024);

1673

reply.append(

"OK:job_status="

)

1675

.append(

"&job_exptime="

)

1676

.append(to_string(lifetime.

Sec

()));

1679

reply.append(

"&pause=pullback"

);

1681

reply.append(

"&pause=nopullback"

);

1684

reply.append(

"&msg="

)

1706

<<

" with neither add list nor del list"

);

1713

list<string> aff_to_add_list;

1714

list<string> aff_to_del_list;

1717  "\t,"

, aff_to_add_list);

1719  "\t,"

, aff_to_del_list);

1727  for

(list<string>::const_iterator k = aff_to_add_list.begin();

1728

k != aff_to_add_list.end(); ++k) {

1729  if

(find(aff_to_del_list.begin(), aff_to_del_list.end(), *k) !=

1730

aff_to_del_list.end()) {

1733  " is in both add and del lists"

+

1758  for

(list<string>::const_iterator k = msgs.begin();

1759

k != msgs.end(); ++k)

1760  msg

+=

"WARNING:"

+ *k +

";"

;

1777

list<string> aff_to_set;

1779  "\t,"

, aff_to_set);

1928  "Neither job key nor a group nor an " 1929  "affinity nor a status list is provided " 1930  "for the CANCEL command"

);

1933  "Job key or any combination of a group and an affinity " 1945  "CANCEL can accept either a job " 1946  "key or any combination of a group " 1947  "and an affinity and job statuses"

);

1949  x_WriteMessage

(

"ERR:eInvalidParameter:CANCEL can accept either a job " 1950  "key or any combination of a group and an affinity and " 1964

vector<string> warnings;

1965

vector<TJobStatus> statuses;

1968  bool

reported =

false

;

1969

vector<TJobStatus>::iterator k =

1974

warnings.push_back(

"eInvalidJobStatus:unknown job " 1975  "status in the status list"

);

1978  "Unknown job status in the status list. " 1979  "Ignore and continue."

);

1992

k = statuses.begin();

1993  while

(k != statuses.end()) {

1995

warnings.push_back(

"eIgnoringCanceledStatus:attempt to " 1996  "cancel jobs in the 'Canceled' status"

);

1999  "Attempt to cancel jobs in the 'Canceled' " 2000  "status. Ignore and continue."

);

2014  if

(warnings.empty())

2018  for

(vector<string>::const_iterator k = warnings.begin();

2019

k != warnings.end(); ++k) {

2020  msg

+=

"WARNING:"

+ *k +

";"

;

2037  "CANCEL for unknown job: "

<<

2066

<<

" for unknown job: " 2081

reply.reserve(2048);

2084  string

pause_status_msg;

2088

pause_status_msg =

"&pause=pullback"

;

2090

pause_status_msg =

"&pause=nopullback"

;

2092  string

progress_msg_part;

2094

progress_msg_part.append(

"&msg="

)

2097

reply.append(

"OK:"

)

2098

.append(

"job_status="

)

2100

.append(

"&client_ip="

)

2102

.append(

"&client_sid="

)

2104

.append(

"&ncbi_phid="

)

2106

.append(

"&job_exptime="

)

2107

.append(to_string(lifetime.

Sec

()))

2108

.append(

"&ret_code="

)

2110

.append(

"&output="

)

2112

.append(

"&err_msg="

)

2114

.append(

"&input="

)

2116

.append(pause_status_msg)

2117

.append(progress_msg_part)

2120

reply.append(

"OK:"

)

2121

.append(to_string((

int

) job.

GetStatus

()))

2170  string

pause_status_str;

2173

pause_status_str =

"pullback"

;

2175

pause_status_str =

"nopullback"

;

2184

.

Print

(

"reason"

,

2185  "pause: "

+ pause_status_str);

2192

list<string> aff_list;

2195

list<string> group_list;

2197  "\t,"

, group_list);

2200  string

added_pref_aff;

2214

added_pref_aff) ==

false

) {

2223  if

(!added_pref_aff.empty()) {

2227

.

Print

(

"added_preferred_affinity"

, added_pref_aff);

2232

.

Print

(

"added_preferred_affinity"

, added_pref_aff);

2289  ERR_POST

(

Warning

<<

"Accepting results for a job in the FAILED state."

);

2298

<<

" results. The job has already been done."

);

2308

<<

" results. The job is unknown"

);

2318

<<

" results; job is in " 2323  "Cannot accept job results; job is in "

+

2355

<<

" results. The job is unknown"

);

2358  ERR_POST

(

Warning

<<

"Accepting results for a job in the FAILED state."

);

2365

<<

" results. The job has already been done."

);

2382  string

pause_status_str;

2385

pause_status_str =

"pullback"

;

2387

pause_status_str =

"nopullback"

;

2390

.

Print

(

"reason"

,

2391  "pause: "

+ pause_status_str);

2397

list<string> aff_list;

2401  string

added_pref_aff;

2415

added_pref_aff) ==

false

) {

2421  if

(added_pref_aff.empty() ==

false

) {

2425

.

Print

(

"added_preferred_affinity"

, added_pref_aff);

2430

.

Print

(

"added_preferred_affinity"

, added_pref_aff);

2471

<<

"MGET for unknown job " 2515  x_WriteMessage

(

"OK:WARNING:eJobAlreadyFailed:Already failed;"

+

2529  x_WriteMessage

(

"ERR:eInvalidJobStatus:Cannot fail job; job is in "

+

2538  if

(warning.empty())

2583

warning, return_option);

2586  if

(warning.empty())

2610  x_WriteMessage

(

"ERR:eInvalidJobStatus:Cannot return job; job is in "

+

2625  bool

auth_token_ok =

true

;

2645  if

(!auth_token_ok) {

2675  x_WriteMessage

(

"ERR:eInvalidJobStatus:Cannot reschedule job; job is in "

+

2712  x_WriteMessage

(

"ERR:eInvalidJobStatus:Cannot redo job; job is in "

+

2729

<<

" in JDEX for job " 2776

<<

" in JDREX for job " 2821  size_t

last_event_index = 0;

2839  string

progress_msg_part;

2841

progress_msg_part =

"&msg="

+

2846  "&last_event_index="

+

2847

to_string(last_event_index) +

2863  if

(!what.empty() && what !=

"QCLASSES"

&& what !=

"QUEUES"

&&

2864

what !=

"JOBS"

&& what !=

"ALL"

&& what !=

"CLIENTS"

&&

2865

what !=

"NOTIFICATIONS"

&& what !=

"AFFINITIES"

&&

2866

what !=

"GROUPS"

&& what !=

"WNODE"

&& what !=

"SERVICES"

&&

2867

what !=

"ALERTS"

&& what !=

"SCOPES"

) {

2869  "Unsupported '"

+ what +

2870  "' parameter for the STAT command."

);

2873  if

(q ==

NULL

&& (what ==

"CLIENTS"

|| what ==

"NOTIFICATIONS"

||

2874

what ==

"AFFINITIES"

|| what ==

"GROUPS"

||

2875

what ==

"WNODE"

|| what ==

"SCOPES"

)) {

2877  "STAT "

+ what +

" requires a queue"

);

2883  if

(what ==

"QCLASSES"

) {

2886  if

(!

info

.empty())

2893  if

(what ==

"QUEUES"

) {

2896  if

(!

info

.empty())

2903  if

(what ==

"SERVICES"

) {

2908

k != services.

end

(); ++k) {

2911  output

+= k->first +

"="

+ k->second;

2917  if

(what ==

"ALERTS"

) {

2928  if

(what ==

"JOBS"

)

2935  info

+=

"OK:SubmitsDisabledEffective: "

;

2940  info

+=

"OK:DrainedShutdown: "

;

2956  if

(!what.empty() && what !=

"ALL"

) {

2962  string info

=

"OK:Started: "

+

2965  info

+=

"OK:SubmitsDisabledEffective: "

;

2970  info

+=

"OK:SubmitsDisabledPrivate: "

;

2982  if

(what ==

"ALL"

) {

2986  " bit_blk="

+ to_string(bv_stat.

bit_blocks

) +

2987  "; gap_blk="

+ to_string(bv_stat.

gap_blocks

) +

2988  "; mem_used="

+ to_string(bv_stat.

memory_used

) +

3009  "to execute RECO"

);

3011  "Access denied: admin privileges required"

);

3024

vector<string> config_warnings;

3025  bool

admin_decrypt_error(

false

);

3028  if

(!config_warnings.empty()) {

3031  for

(vector<string>::const_iterator k = config_warnings.begin();

3032

k != config_warnings.end(); ++k) {

3034  if

(!

msg

.empty()) {

3044  msg

=

"ERR:eInvalidParameter:Configuration file is not " 3045  "well formed. "

+

msg

;

3046  if

(

msg

.size() > 1024) {

3048  msg

+=

" TRUNCATED"

;

3057

vector<string> config_checksum_warnings;

3060  if

(config_checksum_warnings.empty()) {

3064  for

(vector<string>::const_iterator

3065

k = config_checksum_warnings.begin();

3066

k != config_checksum_warnings.end(); ++k)

3081  if

(what_changed.

GetSize

() == 0 &&

3083

services_changed.

GetSize

() == 0) {

3088  x_WriteMessage

(

"OK:WARNING:eNoParametersChanged:No changes in " 3089  "changeable parameters were identified in the new " 3097

diff.

SetByKey

(k.GetKey(), k.GetNode());

3099

diff.

SetByKey

(k.GetKey(), k.GetNode());

3101  string

diff_as_string = diff.

Repr

();

3110  x_WriteMessage

(

"OK:WARNING:eConfigFileNotChanged:Configuration " 3111  "file has not been changed, RECO ignored;"

+

3135  "parameters or any combination of a group and " 3136  "an affinity and job statuses"

);

3138  x_WriteMessage

(

"ERR:eInvalidParameter:DUMP can accept either a job " 3139  "key or no parameters or any combination of a group and " 3148  bool

reported =

false

;

3149

vector<TJobStatus>::iterator k =

3156  "Unknown job status in the status list. " 3157  "Ignore and continue."

);

3166

vector<string> warnings;

3175

statuses.size() == 0)

3198  if

(job_info.empty()) {

3220  x_WriteMessage

(

"OK:WARNING:eAlreadyDrainShutdown:The server is " 3221  "already in drain shutdown state;"

+

3243  string

configuration;

3263

configuration =

string

(converter);

3274  static string

reply =

3299  bool

mem_used_result =

3302  int

proc_fd_soft_limit;

3303  int

proc_fd_hard_limit;

3305

&proc_fd_soft_limit,

3306

&proc_fd_hard_limit);

3309  #if defined(_DEBUG) && !defined(NDEBUG) 3314  if

(err_emul.

as_int

>= 0)

3315

proc_fd_used = err_emul.

as_int

;

3319  if

(err_emul.

as_int

>= 0)

3335  if

(process_time_result)

3336

reply +=

"&user_time="

+ to_string(user_time) +

3337  "&system_time="

+ to_string(system_time) +

3338  "&real_time="

+ to_string(real_time);

3340

reply +=

"&user_time=n/a&system_time=n/a&real_time=n/a"

;

3342  if

(physical_memory > 0)

3343

reply +=

"&physical_memory="

+ to_string(physical_memory);

3345

reply +=

"&physical_memory=n/a"

;

3347  if

(mem_used_result)

3348

reply +=

"&mem_used_total="

+ to_string(mem_used.

total

) +

3349  "&mem_used_total_peak="

+ to_string(mem_used.

total_peak

) +

3350  "&mem_used_resident="

+ to_string(mem_used.

resident

) +

3351  "&mem_used_resident_peak="

+ to_string(mem_used.

resident_peak

) +

3352  "&mem_used_shared="

+ to_string(mem_used.

shared

) +

3353  "&mem_used_data="

+ to_string(mem_used.

data

) +

3354  "&mem_used_stack="

+ to_string(mem_used.

stack

) +

3355  "&mem_used_text="

+ to_string(mem_used.

text

) +

3356  "&mem_used_lib="

+ to_string(mem_used.

lib

) +

3357  "&mem_used_swap="

+ to_string(mem_used.

swap

);

3359

reply +=

"&mem_used_total=n/a" 3360  "&mem_used_total_peak=n/a" 3361  "&mem_used_resident=n/a" 3362  "&mem_used_resident_peak=n/a" 3363  "&mem_used_shared=n/a" 3364  "&mem_used_data=n/a" 3365  "&mem_used_stack=n/a" 3366  "&mem_used_text=n/a" 3368  "&mem_used_swap=n/a"

;

3370  if

(proc_fd_soft_limit >= 0)

3371

reply +=

"&proc_fd_soft_limit="

+ to_string(proc_fd_soft_limit);

3373

reply +=

"&proc_fd_soft_limit=n/a"

;

3375  if

(proc_fd_hard_limit >= 0)

3376

reply +=

"&proc_fd_hard_limit="

+ to_string(proc_fd_hard_limit);

3378

reply +=

"&proc_fd_hard_limit=n/a"

;

3380  if

(proc_fd_used >= 0)

3381

reply +=

"&proc_fd_used="

+ to_string(proc_fd_used);

3383

reply +=

"&proc_fd_used=n/a"

;

3385  if

(proc_thread_count >= 1)

3386

reply +=

"&proc_thread_count="

+ to_string(proc_thread_count);

3388

reply +=

"&proc_thread_count=n/a"

;

3391  if

(!alerts.empty())

3392

reply +=

"&"

+ alerts;

3401  size_t

args_size = arguments.

Size

();

3402  string

cmdline_args;

3403  for

(

size_t

index = 0; index < args_size; ++index) {

3405

cmdline_args +=

" "

;

3406

cmdline_args += arguments[index];

3426  x_WriteMessage

(

"OK:WARNING:eAlertAlreadyAcknowledged:Alert has " 3483  if

(qname.empty()) {

3498  string

linked_sections_part;

3502

vector<string> warnings;

3507

jobs_per_state, warnings);

3511

jobs_part.append(1,

'&'

)

3514

.append(to_string(jobs_per_state[index]));

3515

total += jobs_per_state[index];

3517

jobs_part.append(

"&Total="

)

3518

.append(to_string(total));

3521

k = linked_sections.

begin

(); k != linked_sections.end(); ++k) {

3522  string

prefix((k->first).c_str() + strlen(

"linked_section_"

));

3524

j != k->second.end(); ++j) {

3525

linked_sections_part.append(1,

'&'

)

3535

qname_part.append(

"queue_name="

)

3547

params.

qclass

+

"\t\""

+

3598  bool

client_was_found =

false

;

3599  bool

session_was_reset =

false

;

3601  bool

had_wn_pref_affs =

false

;

3602  bool

had_reader_pref_affs =

false

;

3605

session_was_reset, old_session,

3607

had_reader_pref_affs);

3608  if

(client_was_found && session_was_reset) {

3610  string

wn_val =

"true"

;

3611  if

(!had_wn_pref_affs)

3612

wn_val =

"had none"

;

3613  string

reader_val =

"true"

;

3614  if

(!had_reader_pref_affs)

3615

reader_val =

"had none"

;

3620

.

Print

(

"client_old_session"

, old_session)

3621

.

Print

(

"wn_preferred_affinities_reset"

, wn_val)

3622

.

Print

(

"reader_preferred_affinities_reset"

, reader_val);

3642  if

(used_slots >= max_slots) {

3643  ERR_POST

(

"All scope slots are in use"

);

3645  x_WriteMessage

(

"ERR:eInternalError:All scope slots are in use"

+

3661  unsigned int

max_input_size;

3662  unsigned int

max_output_size;

3670  string result

(

"OK:max_input_size="

+

3671

to_string(max_input_size) +

"&"

+

3672  "max_output_size="

+

3673

to_string(max_output_size));

3676

k = linked_sections.

begin

(); k != linked_sections.end(); ++k) {

3677  string

prefix((k->first).c_str() + strlen(

"linked_section_"

));

3679

j != k->second.end(); ++j) {

3680  result

+=

"&"

+ prefix +

"::"

+

3687  x_WriteMessage

(

"OK:max_input_size="

+ to_string(max_input_size) +

";" 3688  "max_output_size="

+ to_string(max_output_size) +

";"

+

3698  string

configuration;

3701

configuration +=

"OK:"

+ it->first +

'='

+ it->second +

kEndOfResponse

;

3728  bool

no_more_jobs =

true

;

3729  string

added_pref_aff;

3731

list<string> aff_list;

3733

list<string> group_list;

3750

added_pref_aff) ==

false

) {

3756  unsigned int

job_id = job.

GetId

();

3776  if

(!added_pref_aff.empty()) {

3780

.

Print

(

"added_preferred_affinity"

, added_pref_aff);

3785

.

Print

(

"added_preferred_affinity"

, added_pref_aff);

3799

.

Print

(

"no_more_jobs"

, no_more_jobs);

3865  bool

no_op =

false

;

3890  x_WriteMessage

(

"ERR:eInvalidJobStatus:Cannot reread job; job is in "

+

3896

<<

"; job has not been read yet"

);

3897  x_WriteMessage

(

"OK:WARNING:eJobNotRead:The job has not been read yet;"

+

3929

<<

" read job; job is in " 3950  if

(data_size > limit) {

3953

<<

" bytes. Received " 3957  x_WriteMessage

(

"ERR:eInvalidParameter:Client data is too long. " 3958  "It must be <= "

+ to_string(limit) +

3959  " bytes. Received "

+ to_string(data_size) +

3965  x_WriteMessage

(

"OK:version="

+ to_string(current_data_version) +

3974  bool

client_found =

false

;

3975  bool

had_wn_pref_affs =

false

;

3976  bool

had_reader_pref_affs =

false

;

3980

old_session, had_wn_pref_affs, had_reader_pref_affs);

3984  string

wn_val =

"true"

;

3985  if

(!had_wn_pref_affs)

3986

wn_val =

"had none"

;

3987  string

reader_val =

"true"

;

3988  if

(!had_reader_pref_affs)

3989

reader_val =

"had none"

;

3994

.

Print

(

"client_old_session"

, old_session)

3995

.

Print

(

"wn_preferred_affinities_reset"

, wn_val)

3996

.

Print

(

"reader_preferred_affinities_reset"

, reader_val);

4019  "Server is in drained shutting down state"

+

4040  x_WriteMessage

(

"OK:WARNING:eSubmitsDisabledForServer:Submits are " 4063  string

reply =

"OK:WARNING:eQueueAlreadyPaused:The queue has " 4064  "already been paused (previous pullback value is "

;

4066  else

reply +=

"false"

;

4067

reply +=

", new pullback value is "

;

4069  else

reply +=

"false"

;

4102  "Command is obsolete and will be ignored;"

+

4112  "Anonymous client (no client_node and client_session" 4113  " at handshake) cannot "

+ message);

4124  "Either both or neither of the port and " 4125  "timeout parameters must be 0"

);

4133  "Invalid authorization token. It cannot be empty."

);

4145  "without preferred affinities and " 4146  "with any_aff flag set to false " 4147  "will never match any job."

);

4152  "It is forbidden to have both any_affinity and " 4153  "exclusive_new_aff GET2 flags set to 1."

);

4157  "It is forbidden to have both prioritized_aff and " 4158  "wnode_aff GET2 flags set to 1."

);

4162  "It is forbidden to have both prioritized_aff and " 4163  "exclusive_new_aff GET2 flags set to 1."

);

4167  "If the prioritized_aff GET2 flag set to 1 then " 4168  "a non empty list of explicit affinities must be provided."

);

4179  ERR_POST

(

Warning

<<

"The job read request without explicit affinities, " 4180  "without preferred affinities and " 4181  "with any_aff flag set to false " 4182  "will never match any job."

);

4187  "It is forbidden to have both any_aff and " 4188  "exclusive_new_aff READ2 flags set to 1."

);

4192  "It is forbidden to have both prioritized_aff and " 4193  "reader_aff READ2 flags set to 1."

);

4197  "It is forbidden to have both prioritized_aff and " 4198  "exclusive_new_aff READ2 flags set to 1."

);

4202  "If the prioritized_aff READ2 flag set to 1 then " 4203  "a non empty list of explicit affinities must be provided."

);

4213  "QINF2 command expects a queue name or a service name. " 4214  "Nothing has been provided."

);

4219  "QINF2 command expects only one value: queue name or " 4220  "a service name. Both have been provided."

);

4234  if

(!is_worker_node_command) {

4236  if

(it->first ==

"ip"

)

4238  else if

(it->first ==

"sid"

)

4245

.Print(

"_type"

,

"cmd"

)

4247

.Print(

"cmd"

,

cmd

.command->cmd)

4251  for

(

const auto

& param :

cmd

.params) {

4253  if

(param.first ==

"ip"

)

4256  if

(param.first ==

"sid"

)

4259  if

(param.first ==

"ncbi_phid"

)

4262  if

(param.first ==

"status"

)

4263

ctxt_extra.

Print

(

"job_status"

, param.second);

4265

ctxt_extra.

Print

(param.first, param.second);

4267

ctxt_extra.

Flush

();

4284

.Print(

"_type"

,

"cmd"

)

4286

.Print(

"info"

,

msg

)

4317  if

(!job.

GetId

()) {

4332  string

submitter_notif_info;

4335  if

(host ==

"127.0.0.1"

) {

4338  if

(host ==

"127.0.0.1"

) {

4340  "Could not detect the self host address " 4341  "to provide it to a worker node"

);

4344

submitter_notif_info.append(

"&submitter_notif_host="

)

4346

.append(

"&submitter_notif_port="

)

4350

reply.reserve(1024);

4351

reply.append(

"OK:job_key="

)

4353

.append(

"&input="

)

4355

.append(

"&affinity="

)

4357

.append(

"&client_ip="

)

4359

.append(

"&client_sid="

)

4361

.append(

"&ncbi_phid="

)

4364

.append(to_string(job.

GetMask

()))

4365

.append(

"&auth_token="

)

4367

.append(submitter_notif_info)

4379  " "

+ to_string(job.

GetMask

()) +

4468  const string

& client_sid,

4469  const string

& phid)

const 4513

.Print(

"_type"

,

"conn"

)

4524  const string

&

msg

,

4525  const string

& suffix)

4529  if

(need_request_start) {

4536  ERR_POST

(

"Error parsing command: "

<<

msg

+ suffix);

4538  ERR_POST

(

"Error parsing command: "

<<

4540  " (TRUNCATED)"

+ suffix);

4544  string

client_error =

"ERR:eProtocolSyntaxError:"

;

4546

client_error +=

msg

+ suffix;

4549  " (TRUNCATED)"

+ suffix;

4558  const string

& what,

4563

vector<string> warnings;

4565  if

(what ==

"CLIENTS"

) {

4568  else if

(what ==

"NOTIFICATIONS"

) {

4571  else if

(what ==

"AFFINITIES"

) {

4574  else if

(what ==

"GROUPS"

) {

4577  else if

(what ==

"SCOPES"

) {

4580  else if

(what ==

"JOBS"

) {

4586  else if

(what ==

"WNODE"

) {

4587

warnings.push_back(

"eCommandObsolete:Command is obsolete, " 4588  "use STAT CLIENTS instead"

);

4592  for

(vector<string>::const_iterator k = warnings.begin();

4593

k != warnings.end(); ++k) {

4594  msg

+=

"WARNING:"

+ *k +

";"

;

4609  "max_connections=\""

+

4619  "network_timeout=\""

+

4623  "log_batch_each_job=\""

+

4625  "log_notification_thread=\""

+

4627  "log_cleaning_thread=\""

+

4629  "log_execution_watcher_thread=\""

+

4632  "log_statistics_thread=\""

+

4634  "del_batch_size=\""

+

4636  "markdel_batch_size=\""

+

4638  "scan_batch_size=\""

+

4640  "purge_timeout=\""

+

4642  "stat_interval=\""

+

4644  "job_counters_interval=\""

+

4647  "max_client_data=\""

+

4651  "admin_client_name=\""

+

4653  "state_transition_perf_log_queues=\""

+

4655  "state_transition_perf_log_classes=\""

+

4660  "reserve_dump_space=\""

+

4667  const string

& section_name,

4670  if

(values.

empty

())

4673  string

ret =

"["

+ section_name +

"]\n"

;

4675

k != values.

end

(); ++k)

4676

ret += k->first +

"=\""

+ k->second +

"\"\n"

;

4699

vector<string> & warnings)

const 4701

vector<TJobStatus> no_duplicates;

4703  for

(vector<TJobStatus>::const_iterator k = src.begin();

4704

k != src.end(); ++k) {

4705  if

(find(no_duplicates.begin(), no_duplicates.end(), *k) !=

4706

no_duplicates.end()) {

4707

warnings.push_back(

"eStatusDuplicates:job status "

+

4709  " provided more than once"

);

4713  " provided more than once"

);

4715

no_duplicates.push_back(*k);

4718  return

no_duplicates;

4747

message.resize(message.size() - 1);

4749  if

(!message.empty())

TJobStatus GetStatusBeforeReading(void) const

const string & GetClientSID() const

void SetNCBIPHID(const string &ncbi_phid)

void SetSubmNotifTimeout(const CNSPreciseTime &t)

unsigned GetSubmAddr() const

void SetClientIP(const string &client_ip)

unsigned short GetSubmNotifPort() const

const string & GetInput() const

const string & GetOutput() const

TJobStatus GetStatus() const

string GetAuthToken() const

void SetMask(unsigned mask)

void SetInput(const string &input)

string GetErrorMsg() const

const string & GetClientIP() const

unsigned GetAffinityId() const

const string & GetNCBIPHID() const

const string & GetProgressMsg() const

void SetClientSID(const string &client_sid)

void SetSubmNotifPort(unsigned short port)

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

string Repr(TReprFlags flags=0) const

Return a string representation of this node.

SJsonIteratorImpl * Iterate(EIterationMode mode=eNatural) const

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

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.

void SetPassedChecks(TNSCommandChecks check)

void SetScope(const string &scope)

void ResetPassedCheck(void)

const string & GetClientName(void) const

unsigned int GetID(void) const

bool IsComplete(void) const

const string & GetProgramName(void) const

const string & GetSession(void) const

void SetID(unsigned int id)

const string & GetNode(void) const

void CheckAccess(TNSCommandChecks cmd_reqs, CNetScheduleServer *server, const string &cmd)

TNSCommandChecks GetPassedChecks(void) const

void Update(unsigned int peer_addr, const TNSProtoParams &params)

unsigned int GetAddress(void) const

static CNSPreciseTime Current(void)

virtual const char * GetErrCodeString(void) const override

Get error code interpreted as text.

virtual void Rollback(CQueue *queue)=0

static CNcbiApplication * Instance(void)

Singleton method.

static void Reload(void)

Re-read key file locations and domain paths, reload encryption keys.

CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:

string GetAsFromConfig(void) const

map< string, string > GetOrigDiagSection(void) const

map< string, string > GetOrigLogSection(void) const

NetSchedule internal exception.

void x_PrintGetJobResponse(const CQueue *q, const CJob &job, bool add_security_token)

void x_ProcessQueueInfo(CQueue *)

void x_ProcessCancelWaitGet(CQueue *)

void x_ProcessGetParam(CQueue *)

virtual void OnOpen(void)

Runs in response to an external event [asynchronous].

CNetScheduleHandler(CNetScheduleServer *server)

void x_ProcessFastStatusW(CQueue *)

void x_ProcessCancelWaitRead(CQueue *)

void x_ProcessReloadConfig(CQueue *)

void x_ProcessReadRollback(CQueue *)

CRef< CQueue > GetQueue(void)

void x_ProcessGetMessage(CQueue *)

@ eStatus_OK

Command is ok and execution is good.

@ eStatus_SubmitRefused

In refuse submits mode and received SUBMIT.

@ eStatus_SocketIOError

Error writing to socket.

@ eStatus_NotImplemented

Command is not implemented.

@ eStatus_HTTPProbe

Routine test from systems.

@ eStatus_Inactive

Connection was closed due to inactivity timeout.

@ eStatus_BadAuth

Bad authorization token.

@ eStatus_ServerError

Internal server error.

@ eStatus_NotFound

Job is not found.

@ eStatus_ShuttingDown

Server is shutting down.

@ eStatus_BadRequest

Command is incorrect.

@ eStatus_InvalidJobStatus

Invalid job status.

void x_OnCmdParserError(bool need_request_start, const string &msg, const string &suffix)

virtual void OnMessage(BUF buffer)

void x_ProcessPutFailure(CQueue *)

void x_ProcessDropQueue(CQueue *)

string x_GetConnRef(void) const

void x_HandleSocketErrorOnResponse(const string &msg, EIO_Status write_result, size_t written_bytes, const CNSPreciseTime &timing)

void x_ProcessQuitSession(CQueue *)

void x_ProcessMsgAuth(BUF buffer)

bool x_NeedToGeneratePHIDAndSID(FProcessor processor) const

void x_CheckAuthorizationToken(void)

void x_ProcessChangeAffinity(CQueue *)

TProtoParser m_BatchEndParser

void x_ProcessCancel(CQueue *)

void x_ProcessSetClientData(CQueue *)

void x_ProcessDump(CQueue *)

void x_ProcessReading(CQueue *)

void x_ProcessQList(CQueue *)

EIO_Status x_PrepareWriteBuffer(const string &msg, size_t msg_size, size_t required_size)

void x_FinalizeReadCommand(const string &command, TJobStatus status, const CJob &job)

CNSRollbackInterface * m_RollbackAction

bool x_CanBeWithoutQueue(FProcessor processor) const

static void x_MakeSureSingleEOR(string &message)

void x_ProcessMsgBatchSubmit(BUF buffer)

void x_ProcessRefuseSubmits(CQueue *)

TProtoParser m_BatchHeaderParser

static SCommandMap sm_BatchHeaderMap[]

void x_ProcessMsgBatchHeader(BUF buffer)

CStopWatch m_BatchStopWatch

void x_PrintCmdRequestStop(void)

string x_GetServerSection(void) const

void x_ProcessSubmitBatch(CQueue *)

void x_ProcessReadFailed(CQueue *)

void x_SetConnRequestStatus(unsigned int status)

void x_ProcessCancelQueue(CQueue *)

void x_CmdObsolete(CQueue *)

void x_ProcessGetConfiguration(CQueue *)

bool x_NeedCmdLogging(void) const

virtual void OnWrite(void)

The client is ready to receive data.

void x_ProcessJobDelayExpiration(CQueue *)

void x_ProcessGetConf(CQueue *)

CWeakRef< CQueue > m_QueueRef

void x_ClearRollbackAction(void)

void x_ProcessRedo(CQueue *)

unsigned int x_GetPeerAddress(void)

void x_ProcessConfirm(CQueue *)

void x_SetCmdRequestStatus(unsigned int status)

void x_ProcessDeleteDynamicQueue(CQueue *)

EIO_Status x_WriteMessage(const string &msg)

void x_UpdateClientPassedChecks(CQueue *q)

virtual void OnClose(IServer_ConnectionHandler::EClosePeer peer)

The connection has closed (with information on type of closing)

void x_ProcessAckAlert(CQueue *)

TProtoParser m_SingleCmdParser

void x_ProcessPause(CQueue *)

void x_ExecuteRollbackAction(CQueue *q)

void x_ProcessJobExchange(CQueue *)

void x_ProcessClearWorkerNode(CQueue *)

void x_ProcessCreateDynamicQueue(CQueue *)

virtual void OnTimeout(void)

Runs when a client has been idle for too long, prior to closing the connection [synchronous].

void x_CheckReadParameters(void)

string x_GetLogSection(void) const

void x_LogCommandWithJob(const CJob &job) const

void x_CmdNotImplemented(CQueue *)

void x_CreateConnContext(void)

void x_ProcessActiveCount(CQueue *)

void x_ProcessMsgBatchJob(BUF buffer)

string x_GetStoredSectionValues(const string &section_name, const map< string, string > &values) const

void x_SetRequestContext(void)

CRef< CRequestContext > m_CmdContext

void x_ProcessVersion(CQueue *)

void x_ProcessMsgRequest(BUF buffer)

void x_ProcessGetJob(CQueue *)

void x_SetQuickAcknowledge(void)

string x_GetDiagSection(void) const

bool m_ClientIdentificationPrinted

void x_ProcessSetAffinity(CQueue *)

CNSPreciseTime m_BatchSubmTimeout

void(CNetScheduleHandler::* m_ProcessMessage)(BUF buffer)

static SCommandMap sm_BatchEndMap[]

void x_ProcessPut(CQueue *)

CRef< CRequestContext > m_ConnContext

void x_CheckGetParameters(void)

void x_ProcessPutMessage(CQueue *)

void x_StatisticsNew(CQueue *q, const string &what, const CNSPreciseTime &curr)

void x_ProcessResume(CQueue *)

void x_CheckPortAndTimeout(void)

void x_ProcessJobDelayReadExpiration(CQueue *)

vector< TJobStatus > x_RemoveDuplicateStatuses(const vector< TJobStatus > &src, vector< string > &warnings) const

void x_ProcessSetQueue(CQueue *)

void x_ProcessMsgQueue(BUF buffer)

void x_CheckQInf2Parameters(void)

void x_ProcessSetScope(CQueue *)

void x_ProcessReread(CQueue *)

CNetScheduleServer * m_Server

virtual void OnOverflow(EOverflowReason reason)

Runs when there are insufficient resources to queue a connection, prior to closing it.

virtual void OnError(const string &err_message)

Runs when a socket error is detected.

void x_ProcessFastStatusS(CQueue *)

void x_ProcessSubmit(CQueue *)

static SCommandMap sm_CommandMap[]

void x_ProcessReturn(CQueue *)

void x_ProcessBatchSequenceEnd(CQueue *)

void x_CheckNonAnonymousClient(const string &message)

void x_ProcessHealth(CQueue *)

void x_ProcessListenJob(CQueue *)

void x_ProcessShutdown(CQueue *)

bool x_WorkerNodeCommand(void) const

void x_ProcessReschedule(CQueue *)

void x_PrintCmdRequestStart(const SParsedCmd &cmd)

void x_ProcessStatistics(CQueue *)

void x_ProcessBatchStart(CQueue *)

vector< pair< CJob, string > > m_BatchJobs

SNSCommandArguments m_CommandArguments

void x_ProcessStatus(CQueue *)

NetScheduler threaded server.

const CNetScheduleAccessList & GetAdminHosts(void) const

unsigned int GetReserveDumpSpace(void) const

string ResolveService(const string &service) const

string GetSessionID(void) const

string GetQueueNames(const string &sep) const

string GetDebugGarbage(void) const

SErrorEmulatorParameter GetDebugConnDropBeforeWrite(void) const

unsigned GetHostNetAddr() const

void GetServices(map< string, string > &services) const

string GetAdminClientNames(void) const

SErrorEmulatorParameter GetDebugFDCount(void) const

unsigned GetInactivityTimeout(void) const

unsigned GetScanBatchSize(void) const

string SerializeAlerts(void) const

string GetStateTransitionPerfLogClasses(void) const

string GetNodeID(void) const

bool AdminHostValid(unsigned host) const

bool GetRefuseSubmits() const

unsigned int DecrementCurrentSubmitsCounter(void)

void SetAnybodyCanReconfigure(bool val)

SErrorEmulatorParameter GetDebugConnDropAfterWrite(void) const

void RegisterAlert(EAlertType alert_type, const string &message)

const bool & IsLogNotificationThread() const

string GetStateTransitionPerfLogQueues(void) const

void SetDrainShutdown(void)

unsigned int IncrementCurrentSubmitsCounter(void)

enum EAlertAckResult AcknowledgeAlert(const string &id, const string &user)

string PrintTransitionCounters(void)

const bool & IsLogExecutionWatcherThread() const

SNSRegistryParameters GetAffRegistrySettings(void) const

void CreateDynamicQueue(const CNSClientId &client, const string &qname, const string &qclass, const string &description)

const unsigned int & GetJobCountersInterval() const

const unsigned int & GetStatInterval() const

const bool & IsLogBatchEachJob() const

SErrorEmulatorParameter GetDebugWriteDelay(void) const

CJsonNode SetNSParameters(const SNS_Parameters &new_params, bool limited)

unsigned int GetMaxClientData(void) const

string GetAlerts(void) const

string GetQueueClassesInfo(void) const

void SetShutdownFlag(int signum=0, bool db_was_drained=false)

string GetQueueInfo(void) const

virtual bool ShutdownRequested(void)

Runs synchronously between iterations.

const bool & IsLogCleaningThread() const

SQueueParameters QueueInfo(const string &qname) const

unsigned GetMarkdelBatchSize(void) const

void SetDiskConfigFileChecksum(const string &checksum)

unsigned GetDeleteBatchSize(void) const

string GetServiceToQueueSectionConfig(void) const

unsigned CountActiveJobs() const

bool GetUseHostname(void) const

unsigned int Configure(const IRegistry &reg, CJsonNode &diff)

SErrorEmulatorParameter GetDebugMemCount(void) const

const CTime & GetStartTime(void) const

bool IsAdminClientName(const string &name) const

bool IsDrainShutdown(void) const

SErrorEmulatorParameter GetDebugReplyWithGarbage(void) const

double GetPurgeTimeout(void) const

void SetRefuseSubmits(bool val)

void DeleteDynamicQueue(const CNSClientId &client, const string &qname)

string GetLinkedSectionConfig(void) const

CCompoundIDPool GetCompoundIDPool(void) const

const bool & IsLogStatisticsThread() const

CJsonNode ReadServicesConfig(const CNcbiRegistry &reg)

string PrintJobsStat(const CNSClientId &client)

bool AnybodyCanReconfigure(void) const

void SetRAMConfigFileChecksum(const string &checksum)

const bool & IsLog() const

SNSRegistryParameters GetScopeRegistrySettings(void) const

string GetQueueConfig(void) const

string GetQueueClassesConfig(void) const

CRef< CQueue > OpenQueue(const string &name)

SNSRegistryParameters GetGroupRegistrySettings(void) const

void ParseArguments(CTempString str, const SNSProtoArgument *arg_descr, TNSProtoParams *params)

TParsedCmd ParseCommand(CTempString command)

TPauseStatus GetPauseStatus(void) const

void SetPauseStatus(const CNSClientId &client, TPauseStatus status)

bool IsSubmitAllowed(unsigned host) const

TJobStatus ConfirmReadingJob(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token)

int SetClientData(const CNSClientId &client, const string &data, int data_version)

unsigned CountStatus(TJobStatus) const

bool IsProgramAllowed(const string &program_name) const

unsigned int CancelAllJobs(const CNSClientId &client, bool logging)

string PrintNotificationsList(bool verbose) const

void SetAffinity(const CNSClientId &client, const list< string > &aff, ECommandGroup cmd_group)

void SetRefuseSubmits(bool val)

void StatusStatistics(TJobStatus status, TNSBitVector::statistics *st) const

string PrintClientsList(bool verbose) const

bool PutProgressMessage(unsigned int job_id, CJob &job, const string &msg)

unsigned int CancelSelectedJobs(const CNSClientId &client, const string &group, const string &aff_token, const vector< TJobStatus > &statuses, bool logging, vector< string > &warnings)

TJobStatus ReadAndTouchJob(unsigned int job_id, CJob &job, CNSPreciseTime *lifetime)

TJobStatus FailReadingJob(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, const string &err_msg, bool no_retries)

TJobStatus SetJobListener(unsigned int job_id, CJob &job, unsigned int address, unsigned short port, const CNSPreciseTime &timeout, bool need_stolen, bool need_progress_msg, size_t *last_event_index)

void ClearWorkerNode(const CNSClientId &client, bool &client_was_found, string &old_session, bool &had_wn_pref_affs, bool &had_reader_pref_affs)

void RegisterQueueResumeNotification(unsigned int address, unsigned short port, bool new_format)

string GetAffinityTokenByID(unsigned int aff_id) const

bool GetJobForReadingOrWait(const CNSClientId &client, unsigned int port, unsigned int timeout, const list< string > *aff_list, bool reader_affinity, bool any_affinity, bool exclusive_new_affinity, bool prioritized_aff, const list< string > *group_list, bool affinity_may_change, bool group_may_change, CJob *job, bool *no_more_jobs, CNSRollbackInterface *&rollback_action, string &added_pref_aff)

TJobStatus JobDelayExpiration(unsigned int job_id, CJob &job, const CNSPreciseTime &tm)

void SetClientScope(const CNSClientId &client)

string PrintTransitionCounters(void) const

string PrintScopesList(bool verbose) const

void CancelWaitRead(const CNSClientId &client)

TJobStatus FailJob(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, const string &err_msg, const string &output, int ret_code, bool no_retries, string warning)

TJobStatus ReturnReadingJob(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, bool is_ns_rollback, bool blacklist, TJobStatus target_status)

TParameterList GetParameters() const

void MarkClientAsAdmin(const CNSClientId &client)

TJobStatus JobDelayReadExpiration(unsigned int job_id, CJob &job, const CNSPreciseTime &tm)

string MakeJobKey(unsigned int job_id) const

string PrintJobDbStat(const CNSClientId &client, unsigned int job_id, TDumpFields dump_fields)

TJobStatus PutResult(const CNSClientId &client, const CNSPreciseTime &curr, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, int ret_code, const string &output)

bool GetRefuseSubmits(void) const

unsigned int Submit(const CNSClientId &client, CJob &job, const string &aff_token, const string &group, bool logging, CNSRollbackInterface *&rollback_action)

TJobStatus GetStatusAndLifetime(unsigned int job_id, string &client_ip, string &client_sid, string &client_phid, string &progress_msg, CNSPreciseTime *lifetime)

void GetJobsPerState(const CNSClientId &client, const string &group_token, const string &aff_token, size_t *jobs, vector< string > &warnings) const

list< pair< string, string > > TParameterList

TJobStatus ReturnJob(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, const string &auth_token, string &warning, TJobReturnOption how)

bool IsReaderAllowed(unsigned host) const

string PrintGroupsList(const CNSClientId &client, bool verbose) const

void GetLinkedSections(map< string, map< string, string > > &linked_sections) const

string PrintAllJobDbStat(const CNSClientId &client, const string &group, const string &aff_token, const vector< TJobStatus > &job_statuses, unsigned int start_after_job_id, unsigned int count, bool order_first, TDumpFields dump_fields, bool logging)

TJobStatus RescheduleJob(const CNSClientId &client, unsigned int job_id, const string &job_key, const string &auth_token, const string &aff_token, const string &group, bool &auth_token_ok, CJob &job)

string PrintAffinitiesList(const CNSClientId &client, bool verbose) const

bool GetJobOrWait(const CNSClientId &client, unsigned short port, unsigned int timeout, const list< string > *aff_list, bool wnode_affinity, bool any_affinity, bool exclusive_new_affinity, bool prioritized_aff, bool new_format, const list< string > *group_list, CJob *new_job, CNSRollbackInterface *&rollback_action, string &added_pref_aff)

size_t GetScopeSlotsUsed(void) const

bool IsWorkerAllowed(unsigned host) const

TJobStatus RedoJob(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job)

TJobStatus RereadJob(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, bool &no_op)

string PrintJobsStat(const CNSClientId &client, const string &group_token, const string &aff_token, vector< string > &warnings) const

void GetMaxIOSizesAndLinkedSections(unsigned int &max_input_size, unsigned int &max_output_size, map< string, map< string, string > > &linked_sections) const

TJobStatus GetStatusAndLifetimeAndTouch(unsigned int job_id, CJob &job, CNSPreciseTime *lifetime)

void TouchClientsRegistry(CNSClientId &client, bool &client_was_found, bool &session_was_reset, string &old_session, bool &had_wn_pref_affs, bool &had_reader_pref_affs)

void CancelWaitGet(const CNSClientId &client)

list< string > ChangeAffinity(const CNSClientId &client, const list< string > &aff_to_add, const list< string > &aff_to_del, ECommandGroup cmd_group)

TJobStatus Cancel(const CNSClientId &client, unsigned int job_id, const string &job_key, CJob &job, bool is_ns_rollback=false)

~CRequestContextResetter()

CRequestContextResetter()

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

container_type::const_iterator const_iterator

const_iterator begin() const

const_iterator end() const

static SQLCHAR output[256]

static const char * str(char *buf, int n)

bool ReloadConfig(CMetaRegistry::TFlags flags=CMetaRegistry::fReloadIfChanged, IRegistry::TFlags reg_flags=IRegistry::fWithNcbirc)

Reload the configuration file.

const string & GetProgramExecutablePath(EFollowLinks follow_links=eIgnoreLinks) const

Get the application's executable path.

const CNcbiRegistry & GetConfig(void) const

Get the application's cached configuration parameters (read-only).

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

const string & GetConfigPath(void) const

Get the full path to the configuration file (if any) we ended up using.

const CNcbiArguments & GetArguments(void) const

Get the application's cached unprocessed command-line arguments.

size_t BUF_Read(BUF buf, void *data, size_t size)

size_t BUF_PeekAtCB(BUF buf, size_t pos, size_t(*callback)(void *cbdata, const void *buf, size_t size), void *cbdata, size_t size)

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.

void SetBytesWr(Int8 bytes)

int GetRequestStatus(void) const

Request exit status.

string GetStringUID(TUID uid=0) const

Return string representation of UID.

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)

void SetRequestID(TCount rid)

Set request ID.

void SetSessionID(const string &session)

CDiagContext_Extra Extra(void) const

Create a temporary CDiagContext_Extra object.

void SetClientIP(const string &client)

static CRequestContext & GetRequestContext(void)

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

TCount GetRequestID(void) const

Get request ID (or zero if not set).

static TPID GetPID(void)

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

void SetRequestStatus(int status)

void Flush(void)

Print the message and reset object.

void SetBytesRd(Int8 bytes)

#define ERR_POST(message)

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

SIZE_TYPE Size(void) const

Get size (number) of arguments.

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.

const string & GetMsg(void) const

Get message string.

void Warning(CExceptionArgs_Base &args)

virtual const char * what(void) const noexcept

Standard report (includes full backlog).

unsigned ErrCodeToHTTPStatusCode() const

EJobStatus

Job status codes.

virtual const char * GetErrCodeString() const override

Get error code interpreted as text.

static string StatusToString(EJobStatus status)

Printable status type.

@ eDone

Job is ready (computed successfully)

@ eReading

Job has its output been reading.

@ eCanceled

Explicitly canceled.

@ eRunning

Running on a worker node.

@ eJobNotFound

No such job.

@ ePending

Waiting for execution.

@ eFailed

Failed to run (execution timeout)

bool NotNull(void) const THROWS_NONE

Check if pointer is not null – same effect as NotEmpty().

TObjectType * GetPointer(void) THROWS_NONE

Get pointer,.

void Reset(void)

Reset reference object.

void Reset(void)

Reset the containing pointer to null.

bool IsNull(void) const THROWS_NONE

Check if pointer is null – same effect as Empty().

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.

bool Write(CNcbiOstream &os, TFlags flags=0) const

Write the registry content to output stream.

EIO_Status Shutdown(EIO_Event how)

Shutdown socket I/O in the specified direction.

virtual EIO_Status GetOSHandle(void *handle_buf, size_t handle_size, EOwnership ownership=eNoOwnership) const

Access to the system-specific socket handle.

static CNCBI_IPAddr GetLoopbackAddress(void)

Loopback address is in network byte order (when "unsigned int")

EIO_Status SetTimeout(EIO_Event event, const STimeout *timeout)

Set timeout for I/O in the specified direction.

void DisableOSSendDelay(bool on_off=true)

static CNCBI_IPAddr GetLocalHostAddress(ESwitch reget=eDefault)

Local host address in network byte order (cached for faster retrieval)

TNCBI_BigCount GetCount(EIO_Event direction) const

void GetPeerAddress(unsigned int *host, unsigned short *port, ENH_ByteOrder byte_order) const

Get peer address.

static string ntoa(const CNCBI_IPAddr &addr)

BSD-like API.

EIO_Status Write(const void *buf, size_t size, size_t *n_written=0, EIO_WriteMethod how=eIO_WritePersist)

Write to socket.

@ eSAF_IP

only numeric IP if INET socket, empty otherwise

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

Get a printable version of the specified string.

static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)

Convert double to string.

static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)

Case-insensitive compare of a substring with another string.

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

Convert string to int.

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 bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)

Check if a string ends with a specified suffix value.

static const string BoolToString(bool value)

Convert bool to string.

bool empty(void) const

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

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

URL-encode string.

@ fDoubleFixed

DoubleToString*(): Use n.nnnn format for double conversions.

void GetParameters(SServer_Parameters *params)

EClosePeer

Type of connection closing.

EOverflowReason

Error codes for OnOverflow method in IServer_ConnectionHandler.

void CloseConnection(CSocket *sock)

Close connection.

unsigned int max_threads

Maximum simultaneous threads.

unsigned int max_connections

Maximum # of open connections.

CSocket & GetSocket(void)

Get underlying socket.

unsigned int init_threads

Number of initial threads.

@ eClientClose

Connection closed by other peer.

@ eOurClose

Connection closed by ourselves.

double Restart(void)

Return time elapsed since first Start() or last Restart() call (in seconds).

double Elapsed(void) const

Return time elapsed since first Start() or last Restart() call (in seconds).

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

Transform time to string.

@ eStart

Start timer immediately after creating.

const char * IO_StatusStr(EIO_Status status)

Get the text form of an enum status value.

uint64_t TNCBI_BigCount

Big unsigned integer for file size and position.

@ eIO_Success

everything is fine, no error occurred

@ eIO_ReadWrite

eIO_Read | eIO_Write (also, eCONN_OnFlush)

operation

Bit operations.

const size_t g_ValidJobStatusesSize

const CNetScheduleAPI::EJobStatus g_ValidJobStatuses[]

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

const GenericPointer< typename T::ValueType > T2 value

int strncmp(const char *str1, const char *str2, size_t count)

#define NETSCHEDULED_VERSION

#define NETSCHEDULED_FEATURES

#define NETSCHEDULED_STORAGE_VERSION

#define NETSCHEDULED_PROTOCOL_VERSION

#define NETSCHEDULED_BUILD_DATE

unsigned int TNSCommandChecks

const string k_NoAffinityToken

const string k_NoGroupToken

SNSProtoArgument s_BatchArgs[]

const string kEndOfResponse

const string kOKResponsePrefix

static SNSProtoArgument s_AuthArgs[]

static void s_ReadBufToString(BUF buf, string &str)

const string kOKCompleteResponse

static size_t s_BufReadHelper(void *data, const void *ptr, size_t size)

const string kErrNoJobFoundResponse

static const unsigned int kMaxParserErrMsgLength

const size_t kInitialMessageBufferSize

const size_t kMessageBufferIncrement

void SerializeRefuseSubmitState(CNetScheduleServer *server)

const unsigned int kSubmitCounterInitialValue

void NS_ValidateConfigFile(const IRegistry &reg, vector< string > &warnings, bool throw_port_exception, bool &decrypting_error)

string NS_GetConfigFileChecksum(const string &file_name, vector< string > &warnings)

Defines NCBI C++ secure resources API.

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

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

Process memory usage information, in bytes.

bool IsActive(void) const

string job_statuses_string

vector< TJobStatus > job_statuses

void AssignValues(TNSProtoParams &params, const string &command, bool need_to_generate, CSocket &peer_socket, CCompoundIDPool::TInstance id_pool)

unsigned int start_after_job_id

string queue_from_job_key

const SNSProtoCmdDef< Extra > * command

string Serialize(const string &name, const string &prefix, const string &suffix) const

void Read(const IRegistry &reg)

string GetPrintableParameters(bool include_class, bool url_encoded) const

size_t gap_blocks

Number of GAP blocks.

size_t bit_blocks

Number of bit blocks.

size_t memory_used

memory usage for all blocks and service tables

Statistical information about bitset's memory allocation details.


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