org.gridbus.broker.common
Class Job

java.lang.Object
  extended by org.gridbus.broker.common.WorkUnit
      extended by org.gridbus.broker.common.Job

public class Job
extends WorkUnit

This class represents a Job. A job consists of the Task from which it was derived, a Hashtable of the variable values for this job, a status string

Author:
Srikumar Venugopal (srikumar@cs.mu.oz.au), Jia Yu (jiayu@cs.mu.oz.au), Krishna Nadiminti (kna@csse.unimelb.edu.au)

Field Summary
 
Fields inherited from class org.gridbus.broker.common.WorkUnit
application, name, service, status, task, type, variableTable
 
Constructor Summary
Job()
          Constructor
 
Method Summary
 JobEnvironment getEnvironment()
           
 java.lang.String getHandle()
          Get the unique handle for the job (middleware-dependent)
 java.lang.String getLocalWorkingDirectory()
          Returns the local working directory (where the broker puts the job output files locally on the broker machine).
 java.lang.String getQueueName()
           
 java.lang.String getRemoteStagingDirectory()
          Returns the staging directory on a file-staging-server (where the broker puts the job input/output files for copying to/from the compute node).
 java.lang.String getRemoteWorkingDirectory()
           
 JobRequirement getRequirements()
           
 ComputeServer getServer()
          Returns the server to which the job is allocated
 int getStatus()
          Returns the integer value of the job status.
 java.lang.String getStatusString()
          Returns the status in the form of a string.
 java.lang.String getStdErrorFileName()
          Returns the name of the stderr filename for this job
 java.lang.String getStdOutputFileName()
          Returns the name of the stdout filename for this job
 int getType()
          Returns the integer value of the job type.
 void setEnvironment(JobEnvironment environment)
           
 void setHandle(java.lang.String handle)
          Sets the unique handle for the job which comes from the middleware.
 void setLocalWorkingDirectory(java.lang.String localWorkingDirectory)
          Sets the local working directory (where the broker puts the job output files locally on the broker machine).
 void setQueueName(java.lang.String queueName)
           
 void setRemoteWorkingDirectory(java.lang.String remoteWorkingDirectory)
          Sets name of the remote working directory for this job (default = REMOTE.GBB.TMP/appId/jobName).
 void setRequirements(JobRequirement requirements)
           
 void setType(int type)
          Sets the job type.
 java.lang.String toString()
           
 
Methods inherited from class org.gridbus.broker.common.WorkUnit
addVariable, clearVariables, getApplication, getCompletedTime, getErrorDescription, getName, getSubmittedTime, getTask, getUserCredential, getVariableTable, getVariableValue, getVariableValueTable, getWallClockTimeTaken, removeVariable, setApplication, setCompletedTime, setErrorDescription, setName, setSubmittedTime, setTask, setUserCredential
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Job

public Job()
Constructor

Method Detail

getServer

public ComputeServer getServer()
Returns the server to which the job is allocated

Returns:
server - the Compute Server if the job is allocated to a server otherwise null

getStdErrorFileName

public java.lang.String getStdErrorFileName()
Returns the name of the stderr filename for this job

Returns:

getStdOutputFileName

public java.lang.String getStdOutputFileName()
Returns the name of the stdout filename for this job

Returns:

getRemoteWorkingDirectory

public java.lang.String getRemoteWorkingDirectory()
Returns:
name of the remote working directory for this job (REMOTE.GBB.TMP/appId/jobName)

setRemoteWorkingDirectory

public void setRemoteWorkingDirectory(java.lang.String remoteWorkingDirectory)
                               throws GridBrokerException
Sets name of the remote working directory for this job (default = REMOTE.GBB.TMP/appId/jobName). Can only be set prior to a job being scheduled.

Parameters:
remoteWorkingDirectory -
Throws:
GridBrokerException

getQueueName

public java.lang.String getQueueName()
Returns:
queueName name

setQueueName

public void setQueueName(java.lang.String queueName)
Parameters:
queueName -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getLocalWorkingDirectory

public java.lang.String getLocalWorkingDirectory()
Returns the local working directory (where the broker puts the job output files locally on the broker machine). This path is relative to the current directory. (i.e where the broker is running / started)

Returns:

setLocalWorkingDirectory

public void setLocalWorkingDirectory(java.lang.String localWorkingDirectory)
                              throws GridBrokerException
Sets the local working directory (where the broker puts the job output files locally on the broker machine). This path is relative to the current directory. (i.e where the broker is running / started) Can only be set prior to a job being scheduled.

Throws:
GridBrokerException

getRemoteStagingDirectory

public java.lang.String getRemoteStagingDirectory()
Returns the staging directory on a file-staging-server (where the broker puts the job input/output files for copying to/from the compute node). This file-staging-server may or may not be the same machine as the compute node.

Returns:
name of the remote staging directory for this job (STAGING.REMOTE.GBB.TMP/appId/jobName)

getRequirements

public JobRequirement getRequirements()
Returns:
Returns the requirements.

setRequirements

public void setRequirements(JobRequirement requirements)
Parameters:
requirements - The requirements to set.

getType

public int getType()
Returns the integer value of the job type.

Returns:
job status

setType

public void setType(int type)
Sets the job type.

Parameters:
type -

getEnvironment

public JobEnvironment getEnvironment()
Returns:
Returns the environment.

setEnvironment

public void setEnvironment(JobEnvironment environment)
Parameters:
environment - The environment to set.

getStatus

public int getStatus()
Returns the integer value of the job status.

Returns:
job status

getStatusString

public java.lang.String getStatusString()
Returns the status in the form of a string. The staus can be any one of "unsubmitted","submitted","active","pending","done" or "failed"

Returns:
status string

getHandle

public java.lang.String getHandle()
Get the unique handle for the job (middleware-dependent)

Returns:
job handle

setHandle

public void setHandle(java.lang.String handle)
Sets the unique handle for the job which comes from the middleware. This handle would the identifier object using which we can query the job status / access the job details on the remote side.

Parameters:
handle -

Copyright © The University of Melbourne. 2006