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

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

Definition at line 317 of file Server.h.

References Impala::Util::ChannelServer::ConnectionDescr(), ILOG_DEBUG, ILOG_INFO, ILOG_WARN, mJobByPort, mJobsWaiting, mPoisoned, PopFirstFromJobQueue(), and Impala::Job::State::RUNNING.

Referenced by AcceptRequest().

00318     {
00319         String curCon = ConnectionDescr();
00320         ILOG_DEBUG("Receiving job request from " << curCon);
00321         if (mJobByPort[port] != 0)
00322         {
00323             ILOG_WARN("Unexpected job request from " << curCon);
00324             sprintf(buf, "ERROR\0");
00325             return;
00326         }
00327 
00328         if (mPoisoned)
00329         {
00330             ILOG_DEBUG("Poisoning " << curCon);
00331             sprintf(buf, "Poison\0");
00332             return;
00333         }
00334 
00335         if (mJobsWaiting.empty())
00336         {
00337             ILOG_DEBUG("No job for " << curCon);
00338             sprintf(buf, "NoJob\0");
00339             return;
00340         }
00341 
00342         Job* job = PopFirstFromJobQueue();
00343         job->portUsed = port;
00344         job->agent = conn;
00345         job->state = State::RUNNING;
00346 
00347         mJobByPort[port] = job;
00348         ILOG_INFO("Serving job " << job->id << " to " << curCon);
00349         sprintf(buf, "RunJob:jobId=%d;cmdLine=%s\0", job->id,
00350                 job->jobSpec.c_str());
00351     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:34:09 2010 for ImpalaSrc by  doxygen 1.5.1