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

int Impala::Core::VideoJob::ServerProxy::ScheduleJob ( CString  cmdLine,
int  realVideoNr,
bool  delayFirst = false 
) [inline]

Definition at line 66 of file ServerProxy.h.

References Impala::atoi(), ILOG_DEBUG, ILOG_ERROR, ILOG_INFO, ILOG_WARN, IsConnected(), mChannelProxy, mJobIds, mRequestIntervalSec, Impala::Util::ChannelProxy::Send(), and Impala::Util::Sleep().

Referenced by Impala::Core::IDash::Server::DeleteCases(), Impala::Application::IDash::mainIDashServer(), Impala::Core::IDash::Server::ScheduleJob(), and Impala::Core::VideoJob::Manager::Start().

00067     {
00068         if (!IsConnected())
00069             return 0;
00070 
00071         if (delayFirst)
00072         {
00073             ILOG_DEBUG("Delaying job dispatch");
00074             Util::Sleep(mRequestIntervalSec);
00075         }
00076 
00077         ILOG_INFO("Dispatching job to server (actual video nr = " <<
00078                   realVideoNr << ") : " << cmdLine );
00079         String request = "AcceptJob:cmdLine=" + cmdLine;
00080         String response = mChannelProxy->Send(request);
00081         int jobId = 0;
00082         if (response.substr(0, 18) == "JobAccepted:jobId=")
00083         {
00084             jobId = atoi(response.substr(18));
00085             if (jobId > 0)
00086             {
00087                 ILOG_DEBUG("Received assigned job ID: " << jobId);
00088                 mJobIds.push_back(jobId);
00089             }
00090             else
00091             {
00092                 ILOG_ERROR("Received invalid job ID: " << jobId);
00093             }
00094         }
00095         else if (response == "MaxJobs")
00096         {
00097             ILOG_WARN("Job dispatch rejected: job max reached");
00098         }
00099         else
00100         {
00101             ILOG_ERROR("Job dispatch failed: " << response);
00102         }
00103             
00104         return jobId;
00105     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:28:02 2010 for ImpalaSrc by  doxygen 1.5.1