Definition at line 85 of file Manager.h. References CreateInitialStageJobs(), Impala::Core::VideoJob::ProcessDefinition::FirstStageNr(), Impala::Core::VideoJob::ProcessDefinition::GetCmdLine(), GetNextJob(), HasMoreJobs(), ILOG_ERROR, ILOG_INFO, ILOG_WARN, mCurrentStage, mData, mJobServer, Impala::Core::VideoJob::Data::mJobsScheduled, MonitorJobs(), Impala::Core::VideoJob::Data::mPasswordFile, Impala::Core::VideoJob::Data::mPort, Impala::Core::VideoJob::Data::mProcessDef, mProcessDone, Impala::Core::VideoJob::Data::mServerName, Impala::Core::VideoJob::Data::mVideoSetName, Prepare(), ReportState(), Impala::Core::VideoJob::ServerProxy::ScheduleJob(), and Impala::Job::State::SUBMITTED. Referenced by Impala::Application::mainVideoJobManager(). 00086 { 00087 ILOG_INFO("Start managing video processing"); 00088 00089 if (!Prepare(options)) 00090 return 0; 00091 00092 mCurrentStage = mData.mProcessDef->FirstStageNr(); 00093 ILOG_INFO("Entering stage " << mCurrentStage + 1); 00094 CreateInitialStageJobs(); 00095 00096 mJobServer = new ServerProxy(mData.mServerName, mData.mPort, 00097 mData.mPasswordFile, 00098 serverRequestIntervalSec); 00099 mProcessDone = false; 00100 while (!mProcessDone) 00101 { 00102 while (HasMoreJobs()) 00103 { 00104 VideoJob* job = GetNextJob(); 00105 String cmdLine = mData.mProcessDef->GetCmdLine 00106 (job->stepNr, mData.mVideoSetName, job->videoNrCompact); 00107 int attempts = 0; 00108 int jobId = mJobServer->ScheduleJob(cmdLine, job->videoNr); 00109 while (jobId <= 0) 00110 { 00111 if (attempts++ < 3) 00112 { 00113 ILOG_WARN("Job dispatch failed; retrying..."); 00114 jobId = mJobServer->ScheduleJob(cmdLine, job->videoNr, 00115 true); 00116 } 00117 else 00118 { 00119 ILOG_ERROR("Job dispatch failed"); 00120 return -3; 00121 } 00122 } 00123 job->id = jobId; 00124 job->state = Job::State::SUBMITTED; 00125 mData.mJobsScheduled[jobId] = job; 00126 } 00127 00128 int nrOfJobsCompleted = 0; 00129 do 00130 { 00131 nrOfJobsCompleted = MonitorJobs(); 00132 ReportState(); 00133 if (nrOfJobsCompleted < 0) // SK: lousy trick 00134 mProcessDone = true; 00135 } 00136 while (nrOfJobsCompleted == 0); 00137 } 00138 00139 ReportState(); 00140 ILOG_INFO("Finished managing video processing"); 00141 return 0; 00142 }
Here is the call graph for this function:
|