Definition at line 354 of file Server.h. References Impala::Util::ChannelServer::ConnectionDescr(), Impala::Util::StringParser::GetInt(), Impala::Util::StringParser::GetString(), ILOG_DEBUG, ILOG_WARN, Impala::Job::State::KILL_ATTEMPT, mJobByPort, mJobsDone, Impala::Util::StringParser::Position(), Impala::Job::State::RUNNING, Impala::Job::State::TERMINATED_ABNRM, and Impala::Job::State::TERMINATED_NRM. Referenced by AcceptRequest(). 00355 { 00356 String curCon = ConnectionDescr(); 00357 ILOG_DEBUG("Receiving job report from " << curCon); 00358 Job* job = mJobByPort[port]; 00359 if (job == 0) 00360 { 00361 ILOG_WARN("Unexpected job report from " << curCon); 00362 sprintf(buf, "ERROR\0"); 00363 return; 00364 } 00365 00366 String bufStr(buf); 00367 Util::StringParser parser(bufStr); 00368 parser.GetString(':'); 00369 if (parser.GetString('=') == "jobId") 00370 { 00371 int jobId = parser.GetInt(';', true, true); 00372 if (jobId == job->id) 00373 { 00374 if (parser.GetString('=') == "state") 00375 { 00376 JobStateType reportedState = 00377 (JobStateType) parser.GetInt(';', false, true); 00378 if (reportedState == State::RUNNING) 00379 { 00380 if (job->state == State::KILL_ATTEMPT) 00381 { 00382 ILOG_WARN("Requesting " << curCon << " to kill job " 00383 << jobId); 00384 sprintf(buf, "Kill\0"); 00385 } 00386 else 00387 { 00388 sprintf(buf, "OK\0"); 00389 } 00390 return; 00391 } 00392 else if (reportedState == State::TERMINATED_NRM || 00393 reportedState == State::TERMINATED_ABNRM) 00394 { 00395 if (job->state == State::KILL_ATTEMPT) 00396 ILOG_WARN("Successfully completed kill for job " 00397 << job->id); 00398 job->state = reportedState; 00399 if (parser.GetString('=') == "exitCode") 00400 job->exitCode = parser.GetInt(';', true, true); 00401 if (parser.GetString('=') == "errorLog") 00402 job->errorLog = bufStr.substr(parser.Position()); 00403 mJobsDone.push_back(job); 00404 mJobByPort[port] = 0; 00405 sprintf(buf, "OK\0"); 00406 return; 00407 } 00408 } 00409 } 00410 } 00411 ILOG_WARN("Invalid job report (from " << curCon << ") : " << 00412 String(buf, len)); 00413 sprintf(buf, "ERROR\0"); 00414 }
Here is the call graph for this function:
|