Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

virtual void Impala::Core::IDash::Server::StatusJob ( char *  buf,
int  len,
int  bufSize,
CString  conn,
int  port 
) [inline, protected, virtual]

Definition at line 183 of file Server.h.

References Impala::Util::ChannelServer::ConnectionDescr(), Impala::Util::StringParser::Eat(), Impala::Core::IDash::XmlJob::Export(), Impala::Core::VideoJob::ServerProxy::GetJobState(), Impala::Util::StringParser::GetString(), ILOG_ERROR, ILOG_INFO, Impala::Core::VideoJob::ServerProxy::IsConnected(), mJobMap, mJobServer, Impala::Job::State::RUNNING, Impala::Job::State::TERMINATED_ABNRM, Impala::Job::State::TERMINATED_NRM, and Impala::Job::State::ToString().

Referenced by AcceptRequest().

00184     {
00185         String curCon = ConnectionDescr();
00186         ILOG_INFO("StatusJob from " << curCon);
00187 
00188         if (!mJobServer->IsConnected())
00189         {
00190             ILOG_ERROR("Cannot do status: No connection to jobserver");
00191             return;
00192         }
00193 
00194         if (strncmp(buf, "StatusJob:job=", 14) == 0)
00195         {
00196             Util::StringParser parser(String(buf, len));
00197             parser.Eat('=');
00198             String jobId = parser.GetString(';', false);
00199 
00200             int serverJobId;
00201             if (!mJobMap.Get(jobId, serverJobId))
00202             {
00203                 ILOG_ERROR("StatusJob: no jobId " << jobId);
00204                 return;
00205             }
00206 
00207             Job::State::StateType state;
00208             int exitCode;
00209             String errorLog;
00210             mJobServer->GetJobState(serverJobId, state, exitCode, errorLog);
00211             ILOG_INFO("state = " << Job::State::ToString(state) <<
00212                       ", exitCode = " << exitCode <<
00213                       ", errorLog = " << errorLog);
00214 
00215             String status = "initial";
00216             String progress = "0";
00217             if (state == Job::State::RUNNING)
00218             {
00219                 status = "running";
00220                 progress = "50";
00221             }
00222             if (state == Job::State::TERMINATED_NRM)
00223             {
00224                 if (exitCode == 0)
00225                     status = "completed";
00226                 else
00227                     status = "error";
00228                 progress = "100";
00229             }
00230             if (state == Job::State::TERMINATED_ABNRM)
00231             {
00232                 status = "error";
00233                 progress = "100";
00234             }
00235 
00236             XmlJob job(jobId, "", "", status, errorLog, progress);
00237             String jobString = job.Export();
00238             sprintf(buf, "JobStatus:job=%s\0", jobString.c_str());
00239         }
00240         else
00241         {
00242             ILOG_ERROR("Invalid job specification: " << String(buf, len));
00243         }
00244     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:12:59 2010 for ImpalaSrc by  doxygen 1.5.1