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

mainJobServer.cpp

Go to the documentation of this file.
00001 #include "Basis/CmdOptions.h"
00002 #include "Job/Server.h"
00003 
00004 // since we are not using libraries:
00005 #include "Link/ImpalaLib.cpp"
00006 
00007 namespace Impala
00008 {
00009 namespace Application
00010 {
00011 
00012 int 
00013 mainJobServer(int argc, char* argv[])
00014 {
00015     CmdOptions& options = CmdOptions::GetInstance();
00016     options.Initialise(true, true, true);
00017     options.AddOption(0, "noIdle", "", "0");
00018     if (! options.ParseArgs(argc, argv, "port [nrPorts]", 1))
00019         return 1;
00020 
00021     ILOG_VAR(Impala.Application.mainJobServer);
00022 
00023     bool doIdle = ! options.GetBool("noIdle");
00024     String passwordFile = options.GetString("passwordFile");
00025 
00026     int port = atol(options.GetArg(0));
00027     int nrPorts = 2;
00028     if (options.GetNrArg() > 1)
00029         nrPorts = atol(options.GetArg(1));
00030 
00031     Job::Server jobServer(port, nrPorts, passwordFile);
00032     jobServer.Start(doIdle);
00033 
00034     // SK: currently the server will run until killed; 
00035     // gracefully stopping the server is yet to be implemented...
00036     //jobServer.Stop();
00037     return 0;
00038 }
00039 
00040 } // namespace 
00041 } // namespace 
00042 
00043 int
00044 main(int argc, char* argv[])
00045 {
00046     return Impala::Application::mainJobServer(argc, argv);
00047 }

Generated on Fri Mar 19 09:30:29 2010 for ImpalaSrc by  doxygen 1.5.1