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

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

84  if

(event < eSubmit || event >

eReread

)

115

last_update = last_touch;

119  return

last_update + job_run_timeout;

120  return

last_update + queue_run_timeout;

125  return

last_update + job_read_timeout;

126  return

last_update + queue_read_timeout;

133

regular_expiration = last_update + job_timeout;

135

queue_pending_timeout;

137  if

(regular_expiration < pending_expiration)

138  return

regular_expiration;

139  return

pending_expiration;

143  return

last_update + job_timeout;

144  return

last_update + queue_timeout;

161

m_SubmNotifTimeout(),

162

m_ListenerNotifAddress(0),

163

m_ListenerNotifPort(0),

164

m_ListenerNotifAbsTime(),

171

m_NeedSubmProgressMsgNotif(

false

),

172

m_NeedLsnrProgressMsgNotif(

false

),

173

m_NeedStolenNotif(

false

)

184

m_SubmNotifPort(request.port),

185

m_SubmNotifTimeout(request.timeout, 0),

186

m_ListenerNotifAddress(0),

187

m_ListenerNotifPort(0),

188

m_ListenerNotifAbsTime(),

193

m_Mask(request.job_mask),

197

m_NeedSubmProgressMsgNotif(request.need_progress_msg),

198

m_NeedLsnrProgressMsgNotif(

false

),

199

m_NeedStolenNotif(

false

)

262

vector<string> parts;

265  if

(parts.size() < 2)

317

timeout = queue_timeout;

319

run_timeout = queue_run_timeout;

321

read_timeout = queue_read_timeout;

338  if

(dump_fields &

eId

)

340  if

(dump_fields &

eKey

)

368  if

(dump_fields &

eGroup

)

370  if

(dump_fields &

eMask

)

372  if

(dump_fields &

eInput

)

396  static string

prefix =

"OK:id: "

;

398

.append(to_string(

m_Id

))

404  static string

prefix =

"OK:key: "

;

412  static string

prefix =

"OK:status: "

;

420  static string

prefix =

"OK:last_touch: "

;

429  string

&

dump

)

const 431  static string

prefix =

"OK:erase_time: "

;

432  static string

na_prefix = prefix +

"n/a (timeout: "

;

433  static string

timeout_suffix =

" (timeout: "

;

434  static string

postfix =

" sec)"

+

kNewLine

;

435  static string

pending_suffix =

" sec, pending timeout: "

;

437  dump

.append(na_prefix)

439

.append(pending_suffix)

445

.append(timeout_suffix)

447

.append(pending_suffix)

454  string

&

dump

)

const 456  static string

prefix =

"OK:run_expiration: "

;

457  static string

na_prefix = prefix +

"n/a (timeout: "

;

458  static string

suffix =

" (timeout: "

;

459  static string

postfix =

" sec)"

+

kNewLine

;

467  dump

.append(na_prefix)

474  string

&

dump

)

const 476  static string

prefix =

"OK:read_expiration: "

;

477  static string

na_prefix = prefix +

"n/a (timeout: "

;

478  static string

suffix =

" (timeout: "

;

479  static string

postfix =

" sec)"

+

kNewLine

;

487  dump

.append(na_prefix)

494  static string

prefix =

"OK:subm_notif_port: "

;

495  static string

na_reply = prefix +

"n/a"

+

kNewLine

;

501  dump

.append(na_reply);

506  static string

prefix =

"OK:subm_notif_expiration: "

;

507  static string

suffix =

" (timeout: "

;

508  static string

postfix =

" sec)"

+

kNewLine

;

509  static string

na_reply = prefix +

"n/a"

+

kNewLine

;

517  dump

.append(na_reply);

522  static string

prefix =

"OK:listener_notif: "

;

523  static string

na_reply = prefix +

"n/a"

+

kNewLine

;

524  static string

colon =

":"

;

526  dump

.append(na_reply);

537  static string

prefix =

"OK:listener_notif_expiration: "

;

538  static string

na_reply = prefix +

"n/a"

+

kNewLine

;

544  dump

.append(na_reply);

549  static string

prefix =

"OK:event"

;

550  static string client

=

": client="

;

551  static string

ns =

"ns"

;

552  static string event

=

" event="

;

553  static string

status =

" status="

;

554  static string

ret_code =

" ret_code="

;

555  static string

timestamp =

" timestamp="

;

556  static string

na =

"n/a "

;

557  static string

node =

"' node='"

;

558  static string

session =

"' session='"

;

559  static string

err_msg =

"' err_msg="

;

562  for

(

const auto

& ev :

m_Events

) {

563  unsigned int addr

= ev.GetNodeAddr();

566

.append(to_string(event_no))

578

.append(to_string(ev.GetRetCode()))

585  dump

.append(1,

'\''

)

588

.append(ev.GetClientNode())

590

.append(ev.GetClientSession())

592

.append(ev.GetQuotedErrorMsg())

600  static string

prefix =

"OK:run_counter: "

;

608  static string

prefix =

"OK:read_counter: "

;

615  string

&

dump

)

const 617  static string

prefix =

"OK:affinity: "

;

618  static string

na_reply = prefix +

"n/a"

+

kNewLine

;

619  static string

open_paren =

" ('"

;

620  static string

close_paren =

"')"

;

629  dump

.append(na_reply);

633  string

&

dump

)

const 635  static string

prefix =

"OK:group: "

;

636  static string

na_reply = prefix +

"n/a"

+

kNewLine

;

637  static string

open_paren =

" ('"

;

638  static string

close_paren =

"')"

;

647  dump

.append(na_reply);

652  static string

prefix =

"OK:mask: "

;

654

.append(to_string(

m_Mask

))

660  static string

prefix =

"OK:input: '"

;

669  static string

prefix =

"OK:output: '"

;

678  static string

prefix =

"OK:progress_msg: '"

;

687  static string

prefix =

"OK:remote_client_sid: "

;

695  static string

prefix =

"OK:remote_client_ip: "

;

703  static string

prefix =

"OK:ncbi_phid: "

;

711  static string

prefix =

"OK:need_subm_progress_msg_notif: "

;

719  static string

prefix =

"OK:need_lsnr_progress_msg_notif: "

;

727  static string

prefix =

"OK:need_stolen_notif: "

;

746  "inconsistency in the job history. " 747  "No reading status found or no event before reading."

);

748  return m_Events

[index].GetStatus();

795

}

catch

(

const

exception & ex) {

796  throw

runtime_error(

"Writing error while dumping a job properties: "

+

801  for

(vector<CJobEvent>::const_iterator it =

m_Events

.begin();

806

events_dump.

event

=

int

(event.m_Event);

807

events_dump.

status

=

int

(event.m_Status);

808

events_dump.

timestamp

= (double)event.m_Timestamp;

809

events_dump.

node_addr

= event.m_NodeAddr;

810

events_dump.

ret_code

= event.m_RetCode;

816

events_dump.

Write

(jobs_file, event.m_ClientNode.data(),

817  event

.m_ClientSession.data(),

818  event

.m_ErrorMsg.data());

819

}

catch

(

const

exception & ex) {

820  throw

runtime_error(

"Writing error while dumping a job events: "

+

833

}

catch

(

const

exception & ex) {

834  throw

runtime_error(

"Writing error while dumping a job " 835  "input/output: "

+

string

(ex.what()));

852

progress_msg_buf) == 1)

893  if

(event_dump.

Read

(jobs_file,

895

client_node_buf, client_session_buf,

897  throw

runtime_error(

"Unexpected end of the dump file. " 898  "Cannot read expected job events."

);

905  event

.m_NodeAddr = event_dump.

node_addr

;

906  event

.m_RetCode = event_dump.

ret_code

;

907  event

.m_ClientNode.clear();

909  event

.m_ClientNode =

string

(client_node_buf,

911  event

.m_ClientSession.clear();

913  event

.m_ClientSession =

string

(client_session_buf,

915  event

.m_ErrorMsg.clear();

917  event

.m_ErrorMsg =

string

(err_msg_buf,

928

input_buf, output_buf) != 0)

929  throw

runtime_error(

"Unexpected end of the dump file. " 930  "Cannot read expected job input/output."

);

static std::string EventToString(EJobEvent event)

const string & GetErrorMsg() const

TJobStatus GetStatusBeforeReading(void) const

void x_AppendRunCounter(string &dump) const

void x_AppendReadExpiration(const CNSPreciseTime &read_timeout, const CNSPreciseTime &exp_time, string &dump) const

void x_AppendEraseTime(const CNSPreciseTime &timeout, const CNSPreciseTime &pending_timeout, const CNSPreciseTime &exp_time, string &dump) const

void x_AppendOutput(string &dump) const

void x_AppendRemoteClientIP(string &dump) const

void SetNCBIPHID(const string &ncbi_phid)

CNSPreciseTime m_SubmNotifTimeout

CNSPreciseTime m_ReadTimeout

void SetClientIP(const string &client_ip)

bool ShouldNotifyListener(const CNSPreciseTime &current_time) const

void Dump(FILE *jobs_file) const

CNSPreciseTime GetLastEventTime(void) const

void x_AppendMask(string &dump) const

EAuthTokenCompareResult CompareAuthToken(const string &auth_token) const

void SetOutput(const string &output)

bool m_NeedLsnrProgressMsgNotif

void x_AppendNcbiPhid(string &dump) const

void x_AppendNeedSubmitProgressMsgNotif(string &dump) const

void x_AppendId(string &dump) const

void x_AppendListenerNotifExpiration(string &dump) const

CNSPreciseTime m_ListenerNotifAbsTime

void x_AppendSubmitNotifExpiration(string &dump) const

void x_AppendEvents(string &dump) const

const CJobEvent * GetLastEvent() const

void x_AppendProgressMsg(string &dump) const

string Print(TDumpFields dump_fields, const CQueue &queue, const CNSAffinityRegistry &aff_registry, const CNSGroupsRegistry &group_registry) const

unsigned short m_SubmNotifPort

TJobStatus GetStatus() const

unsigned short m_ListenerNotifPort

CJobEvent & AppendEvent()

void x_AppendNeedListenerProgressMsgNotif(string &dump) const

bool m_NeedSubmProgressMsgNotif

void x_AppendLastTouch(string &dump) const

void x_AppendRunExpiration(const CNSPreciseTime &run_timeout, const CNSPreciseTime &exp_time, string &dump) const

void x_AppendNeedStolenNotif(string &dump) const

void SetInput(const string &input)

vector< CJobEvent > m_Events

bool ShouldNotifySubmitter(const CNSPreciseTime &current_time) const

void x_AppendReadCounter(string &dump) const

string GetErrorMsg() const

CNSPreciseTime m_LastTouch

void x_AppendRemoteClientSID(string &dump) const

CNSPreciseTime GetExpirationTime(const CNSPreciseTime &queue_timeout, const CNSPreciseTime &queue_run_timeout, const CNSPreciseTime &queue_read_timeout, const CNSPreciseTime &queue_pending_timeout, const CNSPreciseTime &event_time) const

void x_AppendGroup(const CNSGroupsRegistry &group_registry, string &dump) const

void SetClientSID(const string &client_sid)

void x_AppendStatus(string &dump) const

void x_AppendSubmitNotifPort(string &dump) const

unsigned int m_ListenerNotifAddress

void x_AppendKey(const CQueue &queue, string &dump) const

void x_AppendInput(string &dump) const

CNSPreciseTime m_RunTimeout

void x_AppendAffinity(const CNSAffinityRegistry &aff_registry, string &dump) const

void x_AppendListenerNotif(string &dump) const

bool LoadFromDump(FILE *jobs_file, char *input_buf, char *output_buf, const SJobDumpHeader &header)

string GetTokenByID(unsigned int aff_id) const

unsigned int ResolveGroup(const string &group)

Client API for NCBI NetSchedule server.

NetSchedule internal exception.

string MakeJobKey(unsigned int job_id) const

CNSPreciseTime GetTimeout() const

CNSPreciseTime GetReadTimeout() const

CNSPreciseTime GetPendingTimeout() const

CNSPreciseTime GetRunTimeout() const

static SQLCHAR output[256]

#define NCBI_THROW(exception_class, err_code, message)

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

EJobStatus

Job status codes.

static string StatusToString(EJobStatus status)

Printable status type.

@ eReading

Job has its output been reading.

@ eRunning

Running on a worker node.

@ ePending

Waiting for execution.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

static string gethostbyaddr(const CNCBI_IPAddr &addr, ESwitch log=eOff)

Return empty string on error.

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

Get a printable version of the specified string.

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 size_t StringToSizet(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to size_t.

static const string BoolToString(bool value)

Convert bool to string.

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

Convert string to unsigned int.

unsigned int

A callback function used to compare two keys in a database.

static string s_EventAsString[]

CNSPreciseTime GetJobExpirationTime(const CNSPreciseTime &last_touch, TJobStatus status, const CNSPreciseTime &job_submit_time, const CNSPreciseTime &job_timeout, const CNSPreciseTime &job_run_timeout, const CNSPreciseTime &job_read_timeout, const CNSPreciseTime &queue_timeout, const CNSPreciseTime &queue_run_timeout, const CNSPreciseTime &queue_read_timeout, const CNSPreciseTime &queue_pending_timeout, const CNSPreciseTime &event_time)

const unsigned int kNetScheduleMaxDBDataSize

const unsigned int kNetScheduleMaxDBErrSize

@ eListenerNotifExpiration

@ eNeedSubmitProgressMsgNotif

@ eNeedListenerProgressMsgNotif

const CNSPreciseTime kTimeZero

string NS_FormatPreciseTimeAsSec(const CNSPreciseTime &t)

string NS_FormatPreciseTime(const CNSPreciseTime &t)

const unsigned kMaxHitIdSize

const unsigned kMaxWorkerNodeIdSize

const unsigned kMaxSessionIdSize

static string kNewLine("\n")

const unsigned kMaxClientIpSize

CNetScheduleAPI::EJobStatus TJobStatus

static CNamedPipeClient * client

void Write(FILE *f, const char *progress_msg)

bool need_lsnr_progress_msg_notif

Uint4 listener_notif_addr

bool need_subm_progress_msg_notif

double subm_notif_timeout

char client_sid[kMaxSessionIdSize]

double listener_notif_abstime

int Read(FILE *f, size_t fixed_size_from_header, char *progress_msg)

char client_ip[kMaxClientIpSize]

Uint4 listener_notif_port

char ncbi_phid[kMaxHitIdSize]

void Write(FILE *f, const char *client_node, const char *client_session, const char *err_msg)

Uint4 client_session_size

int Read(FILE *f, size_t fixed_size_from_header, char *client_node, char *client_session, char *err_msg)

int Read(FILE *f, size_t fixed_size_from_header, char *input, char *output)

void Write(FILE *f, const char *input, const char *output)


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