eNumberOfRequiredFields
59 switch(field->name[0]) {
61 if(field->name ==
"job_key") {
62job.
job_id= field->value;
63job_fields |= (1 << eJobKey);
68 if(field->name ==
"status") {
75 if(field->name ==
"auth_token") {
78}
else if(field->name ==
"affinity")
83 if(field->name ==
"client_ip")
85 else if(field->name ==
"client_sid")
90 if(field->name ==
"ncbi_phid")
92 else if(field->name ==
"no_more_jobs") {
99 returnjob_fields == (1 << eNumberOfRequiredFields) - 1;
104 const string& prio_aff_list,
110 boolno_more_jobs =
true;
112 string cmd(
"READ2 reader_aff=0 ");
113 boolprioritized_aff =
false;
116 cmd.append(
"any_aff=0 aff=");
118}
else if(!prio_aff_list.empty()) {
119prioritized_aff =
true;
125 cmd.append(
"any_aff=1 aff=");
127 cmd.append(
"any_aff=0 aff=");
130 cmd.append(prio_aff_list);
132 cmd.append(
"any_aff=1");
138 cmd.append(
" group=");
144 if(prioritized_aff) {
145 cmd.append(
" prioritized_aff=1");
153job_status, &no_more_jobs);
168 string cmd=
"RDRB job_key=";
170 cmd+=
" auth_token=";
172 cmd+=
" blacklist=0";
175m_API->ExecOnJobServer(job,
cmd,
eOn);
180 if(m_API->m_NotificationThread->m_ReadNotifications.Wait(deadline)) {
181 returnReadNotifications();
192 if(m_API->m_NotificationThread->m_ReadNotifications.GetNextNotification(
194m_API->GetServerByNode(ns_node, &server);
227 const boolany_affinity = explicit_affinity || !affinity_ladder;
229 if(explicit_affinity && affinity_ladder) {
230 ERR_POST(
Warning<<
"Both explicit affinity and affinity ladder are provided, the latter will be ignored");
233 switch(
m_Timeline.GetJob(deadline, *job, job_status, any_affinity)) {
260 return m_Impl->ReadNextJob(job, job_status, timeout);
266 m_Impl->InterruptReading();
CTimeout â Timeout interval.
CNetServer WaitForNotifications(const CDeadline &deadline)
bool CheckEntry(SEntry &entry, const string &prio_aff_list, bool any_affinity, CNetScheduleJob &job, CNetScheduleAPI::EJobStatus *job_status)
void ReturnJob(CNetScheduleJob &job)
bool MoreJobs(const SEntry &entry)
CNetServer ReadNotifications()
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
void Warning(CExceptionArgs_Base &args)
EJobStatus
Job status codes.
void InterruptReading()
Abort waiting for a completed job in the above method.
EReadNextJobResult ReadNextJob(CNetScheduleJob *job, CNetScheduleAPI::EJobStatus *job_status, const CTimeout *timeout=NULL)
Wait and return the next completed job.
EReadNextJobResult
Possible outcomes of ReadNextJob() calls.
static EJobStatus StringToStatus(const CTempString &status_str)
Parse status string into enumerator value.
string job_id
Output job key.
@ eRNJ_NotReady
No matching jobs are ready for reading.
@ eRNJ_JobReady
A job is returned.
@ eRNJ_NoMoreJobs
No matching jobs.
@ eRNJ_Interrupt
ReadNextJob() has been interrupted.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool StringToBool(const CTempString str)
Convert string to bool.
const TArgs & GetArgs(void) const
Get the const list of arguments.
static bool s_ParseReadJobResponse(const string &response, CNetScheduleJob &job, CNetScheduleAPI::EJobStatus *job_status, bool *no_more_jobs)
void g_AppendClientIPSessionIDHitID(string &cmd)
SSocketAddress server_address
CNetScheduleExecutor::EJobAffinityPreference m_AffinityPreference
CNetScheduleGetJob::TAffinityLadder m_AffinityLadder
CRef< SNetScheduleNotificationThread > m_NotificationThread
void x_StartNotificationThread()
CNetScheduleGetJobImpl< CImpl > m_Timeline
CNetScheduleJobReader::EReadNextJobResult ReadNextJob(CNetScheduleJob *job, CNetScheduleAPI::EJobStatus *job_status, const CTimeout *timeout)
void CmdAppendPortAndTimeout(string *cmd, unsigned remaining_seconds)
SServerNotifications m_ReadNotifications
CNetServer::SExecResult ConnectAndExec(const string &cmd, bool multiline_output, bool retry_on_exception=false)
CNetServer GetServer(SSocketAddress server_address)
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