Main Page   Class Hierarchy   Compound List   File List   Compound Members  

Job Class Reference

Allow controlling the job and perform several operations. More...

List of all members.

Constructors/Destructor

 Job ()
 Instantiates an empty Job object.

 Job (const edg::workload::common::jobid::JobId &id)
 Instantiates an Job object with a JobId. More...

 Job (const edg::workload::common::requestad::JobAd &ad)
 Instantiates an Job object with a JobAd. More...

 Job (const Job &job)
 Copy constructor.

 ~Job ()
 destructor.

void operator= (const Job &job)
 Assignment operator.

void initialise ()
 Static Open ssl initialisation, called before any operation Prepare the.


Public Methods

Get/Set Methods
edg::workload::common::jobid::JobId * getJobId ()
 Get the JobId instance. More...

edg::workload::common::requestad::JobAd * getJobAd ()
 Get the JobAd instance. More...

void setCredPath (const std::string cp)
 Set a different Proxy certificate from the default one. More...

void unsetCredPath ()
 Set the Proxy certificate as default.

void setLoggerLevel (int level)
 Se the verbosity level for NS debug default value = 0 (no verbosity) max value = 6 (dreadful verbosity, print screen).

void setJobAd (const edg::workload::common::requestad::JobAd &ad)
 set the JobAd instance. More...

void setJobId (const edg::workload::common::jobid::JobId &id)
 set the JobId instance. More...

void retrieveJobAd ()
 Set the JobAd member attribute of the Job instance to the job description got from the LB.

jType getType ()
 returns the type of the job _jobType.

Job Special Action Methods
edg::workload::checkpointing::JobState getState (unsigned int step=0)
 Allow to retrieve back the state of a Job in the specified step (default value is last reached step, 1 means lust but one ect etc...). More...

int attach (Listener *, int port=0)
 Attach the job to a new listener (if possible) and log new information to LB. More...

LB retrieve info Methods
Status getStatus (bool ad=true)
 Retrieve the status of the job. More...

Events getLogInfo ()
 Retrieve the bookkeeping information of the job. More...

Job NS require operation Methods
void submit (const std::string &nSHost, int nsPort, const std::string &lbHost, int lbPort,const std::string &ce_id="")
 Submit the job to the Network Server. More...

void submit (const std::string &ns_host, int ns_port, const std::string &lbHost, int lbPort, edg::workload::checkpointing::JobState *state, Listener *ls, const std::string &ce_id="")
 Submit the job to the Network Server starting from an intermediate step specified in the JobState. More...

std::vector< std::pair< std::string,
double > > 
listMatchingCE (const std::string &host, int port)
 Look for matching Computing Element available resources. More...

edg::workload::common::utilities::ResultCode cancel ()
 Cancel the job from the Network Server. More...

void getOutput (const std::string &dir_path)
 Retrieve output files of a submitted job ( Success Done status has to be reached). More...


Static Public Methods

Static Methods
edg::workload::common::jobid::JobId * submit (const std::string &host, int port, const std::string &lbHost, int lbPort, const std::string &executable, const std::string &stdOutput, const std::string &stdErr, const std::string &outputDir="/tmp", const std::string &ce_id="", int timeout=10, int time_interval=60)
 Submits and get the output of a simple Job once it's ready. More...


Friends

class JobCollection


Detailed Description

Allow controlling the job and perform several operations.

The Job class provides methods that allow controlling the job during its lifetime. The allowed operations are:

Also some special features are provided:


Constructor & Destructor Documentation

Job const edg::workload::common::jobid::JobId &    id
 

Instantiates an Job object with a JobId.

Exceptions:
JobOperationException  If the JobId is empty

Job const edg::workload::common::requestad::JobAd &    ad
 

Instantiates an Job object with a JobAd.

Exceptions:
JobOperationException  If the JobAd is empty


Member Function Documentation

int attach Listener  ,
int    port = 0
 

Attach the job to a new listener (if possible) and log new information to LB.

Parameters:
port  the local machine port to be forced as listener
A  pointer to a Listener interface implementation which manages input/output/error streams
Returns:
the pid corresponding to the launched listener process id (in a new window)
Exceptions:
JobOperationException  The Operation required is not allowed for the Job

edg::workload::common::utilities::ResultCode cancel  
 

Cancel the job from the Network Server.

Returns:
The Result of the operation

edg::workload::common::requestad::JobAd* getJobAd  
 

Get the JobAd instance.

Returns:
a pointer to the JobAd intance

edg::workload::common::jobid::JobId* getJobId  
 

Get the JobId instance.

Returns:
a pointer to the JobId intance

Events getLogInfo  
 

Retrieve the bookkeeping information of the job.

Returns:
all the events logged during the job life
See also:
edg::workload::logging::client::Event class documentation

void getOutput const std::string &    dir_path
 

Retrieve output files of a submitted job ( Success Done status has to be reached).

Parameters:
dir_path  the path where to copy the OutputSandbox files (throws exception if it does not exist)

edg::workload::checkpointing::JobState getState unsigned int    step = 0
 

Allow to retrieve back the state of a Job in the specified step (default value is last reached step, 1 means lust but one ect etc...).

Parameters:
step  an positive integer number representing the JobState step we want to retrieve: step= 0 (default): last State of the job. step=1: last but one. step=2: last but two... etc etc
Returns:
the statue of the job in the specified step

Status getStatus bool    ad = true
 

Retrieve the status of the job.

Parameters:
ad  if set to false only basic info are retrieved
Returns:
the status of the job
See also:
edg::workload::logging::client::JobStatus class documentation

std::vector<std::pair <std::string , double> > listMatchingCE const std::string &    host,
int    port
 

Look for matching Computing Element available resources.

Parameters:
ns_addr  The Network Server full address given in the form <NS host>:<NS port>
warning_message  The warnings catched while executing the NS api
Returns:
all the Computing Elemets that match with the given JDL togheter with their rank

void setCredPath const std::string    cp
 

Set a different Proxy certificate from the default one.

Parameters:
cp  The full path of the proxy certificate file to be set

void setJobAd const edg::workload::common::requestad::JobAd &    ad
 

set the JobAd instance.

Parameters:
ad  the JobAd Instance to set from

void setJobId const edg::workload::common::jobid::JobId &    id
 

set the JobId instance.

Parameters:
id  the JobId Instance to set from

edg::workload::common::jobid::JobId* submit const std::string &    host,
int    port,
const std::string &    lbHost,
int    lbPort,
const std::string &    executable,
const std::string &    stdOutput,
const std::string &    stdErr,
const std::string &    outputDir = "/tmp",
const std::string &    ce_id = "",
int    timeout = 10,
int    time_interval = 60
[static]
 

Submits and get the output of a simple Job once it's ready.

once the job has been submitted, a cycle of status retrieval is done untill the status code is reached. Then the output files are retrieved and stored in the specified output directory

Returns:
The JobId pointer to the submitted job
Parameters:
nsHost  The Network Server host name
nsPort  The Network Server port value
lbHost  The LB host name
lbPort  The LB port value
executable  The value of the Executable JDL attribute
stdOutput  The value of the standard Output JDL attribute
stdErr  The value of the standard Error JDL attribute
ce_id  The Computing Element Identificator where to perform the jo
outputDir  the directory where to retrieve the output files from the job once it is ready
timeout  lentgh of status cycle retrieval. Each 30 seconds a getStatus is called for timeout times

void submit const std::string &    ns_host,
int    ns_port,
const std::string &    lbHost,
int    lbPort,
edg::workload::checkpointing::JobState *    state,
Listener   ls,
const std::string &    ce_id = ""
 

Submit the job to the Network Server starting from an intermediate step specified in the JobState.

Parameters:
state  the step where to begin the submission (only for Checkpointable jobs)
Listener  a listener implementation which will perform the job interaction (only for Interactive jobs)
nsHost  The Network Server host name
nsPort  The Network Server port value
lbHost  The LB host name
lbPort  The LB port value

void submit const std::string &    nSHost,
int    nsPort,
const std::string &    lbHost,
int    lbPort,
const std::string &    ce_id = ""
 

Submit the job to the Network Server.

Parameters:
nsHost  The Network Server host name
nsPort  The Network Server port value
lbHost  The LB host name
lbPort  The LB port value
ls  the listener implementation where to attach the job (if interactive)


The documentation for this class was generated from the following file:
Generated on Fri May 14 14:19:39 2004 for USERINTERFACE C++ API by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002