edu.isi.pegasus.planner.classes
Class Job

java.lang.Object
  extended by edu.isi.pegasus.planner.classes.Data
      extended by edu.isi.pegasus.planner.classes.Job
All Implemented Interfaces:
GraphNodeContent, Cloneable
Direct Known Subclasses:
AggregatedJob, DAGJob, DAXJob, TransferJob

public class Job
extends Data
implements GraphNodeContent

The object of this class holds the information to generate a submit file about one particular job making the Dag.

Version:
$Revision: 4784 $
Author:
Karan Vahi, Gaurang Mehta

Field Summary
static int CHMOD_JOB
          Denotes a chmod job that sets the xbit on the remote end.
static int CLEANUP_JOB
          Denotes a cleanup job, that removes the files that from the remote working directories of the remote sites.
static int COMPUTE_JOB
          Denotes a compute job.
 String condorUniverse
          The universe in which the job has to be executed.
 Condor condorVariables
          For Condor Namespace.
static int CREATE_DIR_JOB
          Denotes a job that creates directories at the remote pools.
static int DAG_JOB
          Denotes a chmod job that sets the xbit on the remote end.
 Dagman dagmanVariables
          The DAGMAN namespace profile variable holding the dagman profiles.
static int DAX_JOB
          Denotes a chmod job that sets the xbit on the remote end.
private static String DELIMITER
          The delimiter that has to be used to combine the name for the staged executable.
 String dvName
          The name of the derivation in Chimera that generated the job.
 String dvNamespace
          The namespace to which the derivation is bound.
 String dvVersion
          The version of the derivation.
 ENV envVariables
          To accomodate the environment variables which might needed to be set.
 String executable
          The path of the executable on the machine at which the job is executed.
 String executionPool
          The pool on which this job has been decided to be executed by the Interpool Engine.
 Globus globusRSL
          The namespace object containing the globus rsl attributes which the user specifies in the dax, or the pool file or the properties file.
 String globusScheduler
          The globus Scheduler for the job.
 Hints hints
          To accomodate all the hints that maybe passed through the DAX.
 Set inputFiles
          Contains the input files for the submit file.
static int INTER_POOL_JOB
          Denotes a job that transfers the output of a compute node to the site where the child compute node is to be generated.
 int jobClass
          The type of the job.
 String jobID
          Identifies of which Pegasus Super Node is a job associated with.
 String jobName
          The name of the job.
 int level
          Identifies the level of the job in the dax.
 String logicalId
          The logical id of the job as referred to in the dax.
 String logicalName
          The logical name of the transformation which is executed as a part of this job.
private  Set<CredentialHandler.TYPE> mCredentialsType
          Set of credential types required by a job.
private  String mDirectory
          The directory in which the job should run.
private  boolean mJobExecutablesStaged
          Boolean indicating whether the job executables were staged for it or not.
private  Notifications mNotifications
          All the notifications associated with the job
private  double mRuntime
          The expected runtime for a job.
private  String mStagingSite
          The staging site associated with the job
 String namespace
          The namespace to which the transformation is bound.
 Set outputFiles
          Contains the output files for the submit file.
static int REPLICA_REG_JOB
          Denotes a job that registers in the replica mechanism the materialized files.
static int STAGE_IN_JOB
          Denotea a job that is used to stage in the input files for a compute job.
static int STAGE_IN_WORKER_PACKAGE_JOB
          Denotes a job that stages the worker package.
static int STAGE_OUT_JOB
          Denotes a job that transfers the date generated by a compute job to the output pool specified by the user.
 String stdErr
          File which contains standard error.
 String stdIn
          File which contains stdin (keyboard input).
 String stdOut
          File which contains stdout.
 String strargs
          The arguements for the job.
static int UNASSIGNED_JOB
          Denotes a job that does not fall into the other categories.
 Pegasus vdsNS
          The Pegasus namespace variable.
 String version
          The version of the transformation.
 
Fields inherited from class edu.isi.pegasus.planner.classes.Data
mLogger, mLogMsg
 
Constructor Summary
Job()
          Intialises the member variables.
Job(Job job)
          Overloaded constructor.
 
Method Summary
 void addCredentialType(CredentialHandler.TYPE type)
          Adds a type of credential that will be required by a job.
 void addCredentialType(String url)
          Looks at a URL to determine whether a credential should be associated with a job or not.
 void addInputFile(PegasusFile file)
          Adds an input file to the underlying collection of input files associated with the job.
 void addNotification(Invoke invoke)
          Adds a Invoke object correpsonding to a notification.
 void addNotifications(Notifications invokes)
          Adds all the notifications passed to the underlying container.
 void addNotifications(TransformationCatalogEntry entry)
          Adds all the notifications specfied in the TransformationCatalogEntry to the underlying job notifications.
 void addOutputFile(PegasusFile file)
          Adds an output file to the underlying collection of output files associated with the job.
 void addProfile(Profile p)
          Adds a profile to the job object
private  void append(StringBuffer sb, String key, Object value, String newLine)
          Appends a key value mapping to the StringBuffer.
 Object clone()
          Returns a new copy of the Object.
private static String combine(String namespace, String name, String version)
          Combines the three components together into a single string as namespace-name-version.
 double computeRuntime()
          Returns the runtime associated with the job.
 boolean equals(Object obj)
          Checks if an object is similar to the one referred to by this class.
 String getArguments()
          Returns the argument string with which the job has to be invoked.
 String getCompleteDVName()
          Constructs the fully qualified name of the corresponding derivation used to generate this job in Chimera including the namespace and version.
 String getCompleteTCName()
          Constructs the fully qualified name of a transformation with which to query the TC, including the namespace and version.
 Set<CredentialHandler.TYPE> getCredentialTypes()
          Returns the various credential types required by a job
 String getDAXID()
          Returns the DAX ID for the job if it appeared in the DAX, else null
 String getDirectory()
          Returns the directory where the job runs.
protected  String getDOTColor()
          Returns the color with which DOT should color the node representing the job.
 String getDVName()
          Returns the name of the underlying derivation.
 String getDVNamespace()
          Returns the namespace of the underlying derivation.
 String getDVVersion()
          Returns the version of the underlying derivation.
 GridGateway.JOB_TYPE getGridGatewayJobType()
          Returns the corresponding grid gateway job type
 String getID()
          Returns the ID associated with the job.
 Set getInputFiles()
          Returns the set of input files associated with the job.
 String getJobManager()
          Returnss the remote jobmanager on which the job has to run.
 int getJobType()
          Returns the type of the job.
 String getJobTypeDescription()
          Gets the textual description of the type associated with the job.
 String getJobTypeDescription(int type)
          Gets the textual description of the type that can be associated with a job.
 int getLevel()
          Returns the level associated with the job.
 String getLogicalID()
          Returns the logical id of the job.
 String getName()
          Returns the name of the job.
 Notifications getNotifications()
          Returns all the notifications associated with the job.
 Collection<Invoke> getNotifications(Invoke.WHEN when)
          Returns a collection of all the notifications that need to be done for a particular condition
 Set getOutputFiles()
          Returns the set of output files associated with the job.
 String getPreScriptArguments()
          Returns the arguments to the prescript for the job if set.
 String getPreScriptPath()
          Returns the path to the prescript for the job if set.
 String getRemoteExecutable()
          Returns the path of the underlying executable on the remote grid site.
 double getRuntime()
          Returns the expected runtime for the job that is set using the setRuntime method.
 String getSiteHandle()
          Returns the handle of the site where the job is scheduled.
 String getStagedExecutableBaseName()
          Returns the basename for the staged executable corresponding to the job.
static String getStagedExecutableBaseName(String txNamespace, String txName, String txVersion)
          Returns the basename for the staged executable corresponding to the job.
 String getStagingSiteHandle()
          Returns the staging site.
 String getStdErr()
          Returns the file to which the stderr of the job is written to.
 String getStdIn()
          Returns the file from which the stdin is picked up.
 String getStdOut()
          Returns the file to which the stdout of the job is written to.
 String getTXName()
          Returns the name of the underlying transformation.
 String getTXNamespace()
          Returns the namespace of the underlying transformation.
 String getTXVersion()
          Returns the version of the underlying transformation.
 String getUniverse()
          Returns the universe associated with the job.
 String getVDSSuperNode()
          Returns the name of the compute job of Pegasus supernode containing this job.
 boolean isMPIJob()
          Returns a boolean value denoting whether the job is MPI or not.
private static GridGateway.JOB_TYPE jobType2GridGatewayJobType(int type)
          Returns an appropriate grid gateway job type corresponding to a job type
 void mergeProfiles(Job job)
          Merges profiles from another job to this job in a controlled fashion.
 void resetCredentialTypes()
          Resets the credential types required by a job.
 void resetNotifications()
          Resets the notifications associated with the job
 void resetProfiles()
          Resets all the profiles associated with the job.
 boolean runInWorkDirectory()
          Returns whether a job should be run in the work directory or not.
 void setArguments(String arguments)
          Sets the argument string with which the job has to be invoked.
 void setDerivation(String ns, String name, String vs)
          Sets the various attributes of underlying derivation.
 void setDirectory(String directory)
          Setter method to set the name of the job.
 void setDVName(String name)
          Sets the derivation name of the underlying derivation.
 void setDVNamespace(String ns)
          Sets the derivation namespace to be associated with the job.
 void setDVVersion(String vs)
          Sets the version of the underlying derivation.
 void setExecutableStagingForJob(boolean value)
          Sets the executable staging flag in the job to the value passed.
 void setInputFiles(Set ipFiles)
          Sets the input files associated with the job.
 void setJobManager(String jobmanager)
          Sets the remote jobmanager on which the job has to run.
 void setJobType(int type)
          Sets the type of the job.
 void setLevel(int value)
          Sets the level for the job.
 void setLogicalID(String id)
          Setter method to set the logical id of the job.
 void setName(String name)
          Setter method to set the name of the job.
 void setOutputFiles(Set opFiles)
          Sets the output files associated with the job.
 void setPreScript(String path)
          It sets the prescript for the job.
 void setPreScript(String path, String arguments)
          It sets the prescript for the job.
 void setRemoteExecutable(String path)
          Sets the path to the executable on the remote grid site.
 void setRuntime(double runtime)
          Sets the expected runtime for the job.
 void setRuntime(String runtime)
          Sets the expected runtime for the job.
 void setSiteHandle(String site)
          Sets the site handle of the site, where teh job is to be executed
 void setStagingSiteHandle(String site)
          Sets the staging site.
 void setStdErr(String fileName)
          Sets the file to which the stderr of the job needs to be written to at the remote grid site.
 void setStdIn(String fileName)
          Sets the file to from which to pick up the stdin for the job.
 void setStdOut(String fileName)
          Sets the file to which the stdout of the job needs to be written to at the remote grid site.
 void setTransformation(String ns, String name, String vs)
          Sets the various attributes of underlying transformation.
 void setTXName(String name)
          Sets the transformation name of the underlying transformation.
 void setTXNamespace(String ns)
          Sets the transformation namespace to be associated with the job.
 void setTXVersion(String vs)
          Sets the version of the underlying transformation.
 void setTypeRecursive()
          Sets the job to be recursive.
 void setUniverse(String universe)
          Set the universe associated with the job.
 void setVDSSuperNode(String name)
          Setter method to the name of the compute job of Pegasus supernode containing this job.
 String toDOT()
          Returns the DOT description of the object.
 void toDOT(Writer stream, String indent)
          Returns the DOT description of the object.
 String toString()
          Returns a textual description of the object.
static boolean typeInRange(int type)
          Returns whether the job type value for the job is in range or not.
 boolean typeRecursive()
          Returns whether the job is recursive or not.
 void updateProfiles(List profiles)
          Updates all the profile namespaces with the information specified in list of profile objects passed.
 void updateProfiles(PegasusProperties properties)
          Updates all the profile namespaces with the information specified by the user in the properties file, that apply to this job.
 void updateProfiles(Profiles profiles)
          Updates all the profile namespaces with the information specified in list of profile objects passed.
 void updateProfiles(TransformationCatalogEntry entry)
          Updates all the profile namespaces with the information associated in the transformation catalog for this job.
 boolean userExecutablesStagedForJob()
          Returns whether user executables need to be staged for job or not.
 
Methods inherited from class edu.isi.pegasus.planner.classes.Data
setToString, vectorToString
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNASSIGNED_JOB

public static final int UNASSIGNED_JOB
Denotes a job that does not fall into the other categories. It might denote an error condition or a faulty logic in the planner.

See Also:
Constant Field Values

COMPUTE_JOB

public static final int COMPUTE_JOB
Denotes a compute job. Generally these are the jobs that are specified in the DAX.

See Also:
Constant Field Values

STAGE_IN_JOB

public static final int STAGE_IN_JOB
Denotea a job that is used to stage in the input files for a compute job.

See Also:
Constant Field Values

STAGE_OUT_JOB

public static final int STAGE_OUT_JOB
Denotes a job that transfers the date generated by a compute job to the output pool specified by the user.

See Also:
Constant Field Values

REPLICA_REG_JOB

public static final int REPLICA_REG_JOB
Denotes a job that registers in the replica mechanism the materialized files.

See Also:
Constant Field Values

INTER_POOL_JOB

public static final int INTER_POOL_JOB
Denotes a job that transfers the output of a compute node to the site where the child compute node is to be generated.

See Also:
Constant Field Values

CREATE_DIR_JOB

public static final int CREATE_DIR_JOB
Denotes a job that creates directories at the remote pools.

See Also:
Constant Field Values

STAGE_IN_WORKER_PACKAGE_JOB

public static final int STAGE_IN_WORKER_PACKAGE_JOB
Denotes a job that stages the worker package.

See Also:
Constant Field Values

CLEANUP_JOB

public static final int CLEANUP_JOB
Denotes a cleanup job, that removes the files that from the remote working directories of the remote sites.

See Also:
Constant Field Values

CHMOD_JOB

public static final int CHMOD_JOB
Denotes a chmod job that sets the xbit on the remote end.

See Also:
Constant Field Values

DAX_JOB

public static final int DAX_JOB
Denotes a chmod job that sets the xbit on the remote end.

See Also:
Constant Field Values

DAG_JOB

public static final int DAG_JOB
Denotes a chmod job that sets the xbit on the remote end.

See Also:
Constant Field Values

DELIMITER

private static String DELIMITER
The delimiter that has to be used to combine the name for the staged executable.


jobClass

public int jobClass
The type of the job. Pegasus tags the jobs according to the function of the job. The jobs are tagged according to the functionality they serve in the Pegasus super node. The job class can be unassigned compute job stage-in stage-out replica registration inter-pool transfer create-dir job staged-compute job


jobID

public String jobID
Identifies of which Pegasus Super Node is a job associated with. Pegasus Supernode is identified by the jobName of the compute node in the super node.


jobName

public String jobName
The name of the job.


logicalName

public String logicalName
The logical name of the transformation which is executed as a part of this job. Note: The tc is looked up by namespace__logicalName_version.


logicalId

public String logicalId
The logical id of the job as referred to in the dax.


namespace

public String namespace
The namespace to which the transformation is bound.


version

public String version
The version of the transformation.


dvName

public String dvName
The name of the derivation in Chimera that generated the job.


dvNamespace

public String dvNamespace
The namespace to which the derivation is bound.


dvVersion

public String dvVersion
The version of the derivation.


globusScheduler

public String globusScheduler
The globus Scheduler for the job.


executable

public String executable
The path of the executable on the machine at which the job is executed.


condorUniverse

public String condorUniverse
The universe in which the job has to be executed. Can be standard, vanilla or globus.


stdIn

public String stdIn
File which contains stdin (keyboard input).


stdOut

public String stdOut
File which contains stdout.


stdErr

public String stdErr
File which contains standard error.


strargs

public String strargs
The arguements for the job. It is the contains the arguments for the job. This string is put in the arguments in Condor Submit File.


inputFiles

public Set inputFiles
Contains the input files for the submit file. They are vector of PegasusFile Objects which store the transiency information of each logical file.

See Also:
org.griphyn.cPlanner.classes.PegasusFile

outputFiles

public Set outputFiles
Contains the output files for the submit file. They are vector of PegasusFile Objects which store the transiency information of each logical file.

See Also:
org.griphyn.cPlanner.classes.PegasusFile

executionPool

public String executionPool
The pool on which this job has been decided to be executed by the Interpool Engine.


globusRSL

public Globus globusRSL
The namespace object containing the globus rsl attributes which the user specifies in the dax, or the pool file or the properties file.


condorVariables

public Condor condorVariables
For Condor Namespace. This contains the extra Condor options which one may want to specify. These are copied straightaway to the Submit file.


envVariables

public ENV envVariables
To accomodate the environment variables which might needed to be set.


dagmanVariables

public Dagman dagmanVariables
The DAGMAN namespace profile variable holding the dagman profiles. It holds the prescript and the postscripts for the jobs.


hints

public Hints hints
To accomodate all the hints that maybe passed through the DAX.


vdsNS

public Pegasus vdsNS
The Pegasus namespace variable.


level

public int level
Identifies the level of the job in the dax. The level is bottom up from the final child node.


mRuntime

private double mRuntime
The expected runtime for a job.


mJobExecutablesStaged

private boolean mJobExecutablesStaged
Boolean indicating whether the job executables were staged for it or not.


mNotifications

private Notifications mNotifications
All the notifications associated with the job


mStagingSite

private String mStagingSite
The staging site associated with the job


mDirectory

private String mDirectory
The directory in which the job should run.


mCredentialsType

private Set<CredentialHandler.TYPE> mCredentialsType
Set of credential types required by a job.

Constructor Detail

Job

public Job()
Intialises the member variables.


Job

public Job(Job job)
Overloaded constructor. Does a shallow copy of the job object passed.

Parameters:
job - the Job object containing the job description.
Method Detail

jobType2GridGatewayJobType

private static GridGateway.JOB_TYPE jobType2GridGatewayJobType(int type)
Returns an appropriate grid gateway job type corresponding to a job type

Parameters:
type - the job type
Returns:
corresponding GridGateway job type

clone

public Object clone()
Returns a new copy of the Object.

Overrides:
clone in class Object
Returns:
clone of the object.

setRuntime

public void setRuntime(String runtime)
Sets the expected runtime for the job.

Parameters:
runtime - the runtime for the job.

setRuntime

public void setRuntime(double runtime)
Sets the expected runtime for the job.

Parameters:
runtime - the runtime for the job.

getRuntime

public double getRuntime()
Returns the expected runtime for the job that is set using the setRuntime method.

Returns:
the runtime for the job.

computeRuntime

public double computeRuntime()
Returns the runtime associated with the job. If the runtime variable with the job is set to -ve then, it also attempts to check on the value specified in Pegasus Profile key runtime for the job. If there is a value associated with profile key, that the runtime value is set to that using setRuntime( String ) function.

Returns:
the expected runtime.
See Also:
org.griphyn.cPlanner.namespace.Pegasus#RUNTIME_KEY

setUniverse

public void setUniverse(String universe)
Set the universe associated with the job.

Parameters:
universe - the universe to be associated.

getUniverse

public String getUniverse()
Returns the universe associated with the job.

Returns:
the universe associate with job .

setExecutableStagingForJob

public void setExecutableStagingForJob(boolean value)
Sets the executable staging flag in the job to the value passed.

Parameters:
value - the boolean value.

userExecutablesStagedForJob

public boolean userExecutablesStagedForJob()
Returns whether user executables need to be staged for job or not.

Returns:
user executable staging.

addInputFile

public void addInputFile(PegasusFile file)
Adds an input file to the underlying collection of input files associated with the job.

Parameters:
file - the PegasusFile containing the input file.

setInputFiles

public void setInputFiles(Set ipFiles)
Sets the input files associated with the job.

Parameters:
ipFiles - Set of PegasusFile objects containing the input files.

getInputFiles

public Set getInputFiles()
Returns the set of input files associated with the job.

Returns:
Set of PegasusFile objects containing the input files.

resetNotifications

public void resetNotifications()
Resets the notifications associated with the job


addNotification

public void addNotification(Invoke invoke)
Adds a Invoke object correpsonding to a notification.

Parameters:
invoke - the invoke object containing the notification

addNotifications

public void addNotifications(TransformationCatalogEntry entry)
Adds all the notifications specfied in the TransformationCatalogEntry to the underlying job notifications.

Parameters:
entry - the TransformationCatalogEntry object

addNotifications

public void addNotifications(Notifications invokes)
Adds all the notifications passed to the underlying container.

Parameters:
invokes - the notifications to be added

getNotifications

public Collection<Invoke> getNotifications(Invoke.WHEN when)
Returns a collection of all the notifications that need to be done for a particular condition

Parameters:
when - the condition
Returns:

getNotifications

public Notifications getNotifications()
Returns all the notifications associated with the job.

Returns:
the notifications

addCredentialType

public void addCredentialType(String url)
Looks at a URL to determine whether a credential should be associated with a job or not.

Parameters:
url - the url for which a credential needs to be added

addCredentialType

public void addCredentialType(CredentialHandler.TYPE type)
Adds a type of credential that will be required by a job.

Parameters:
type - the credential type.

getCredentialTypes

public Set<CredentialHandler.TYPE> getCredentialTypes()
Returns the various credential types required by a job

Returns:
the set of credentials required.

resetCredentialTypes

public void resetCredentialTypes()
Resets the credential types required by a job.


addOutputFile

public void addOutputFile(PegasusFile file)
Adds an output file to the underlying collection of output files associated with the job.

Parameters:
file - the PegasusFile containing the output file.

setOutputFiles

public void setOutputFiles(Set opFiles)
Sets the output files associated with the job.

Parameters:
opFiles - Set of PegasusFile objects containing the output files.

getOutputFiles

public Set getOutputFiles()
Returns the set of output files associated with the job.

Returns:
Set of PegasusFile objects containing the output files.

setJobType

public void setJobType(int type)
Sets the type of the job.

Parameters:
type - the type of the job.
Throws:
IllegalArgumentException - if the job type is outside its legal range.
See Also:
UNASSIGNED_JOB, COMPUTE_JOB, STAGE_IN_JOB, STAGE_OUT_JOB, REPLICA_REG_JOB, INTER_POOL_JOB, CREATE_DIR_JOB, #STAGED_COMPUTE_JOB, CLEANUP_JOB

setSiteHandle

public void setSiteHandle(String site)
Sets the site handle of the site, where teh job is to be executed

Parameters:
site - the site handle.

getSiteHandle

public String getSiteHandle()
Returns the handle of the site where the job is scheduled.

Returns:
site handle.

setRemoteExecutable

public void setRemoteExecutable(String path)
Sets the path to the executable on the remote grid site. This executable is invoked whenever a job is run on the remote grid site.

Parameters:
path - the path to the underlying transformation on the remote grid site.
See Also:
getSiteHandle()

getRemoteExecutable

public String getRemoteExecutable()
Returns the path of the underlying executable on the remote grid site.

Returns:
the path to the executable if set.

setJobManager

public void setJobManager(String jobmanager)
Sets the remote jobmanager on which the job has to run.

Parameters:
jobmanager - the jobmanager url.
See Also:
getJobManager()

getJobManager

public String getJobManager()
Returnss the remote jobmanager on which the job has to run.

Returns:
the jobmanager url.
See Also:
setJobManager(java.lang.String)

setStdOut

public void setStdOut(String fileName)
Sets the file to which the stdout of the job needs to be written to at the remote grid site. Should be just the basename. The file appears in the remote working directory for that job.

Parameters:
fileName - the basename of the file.

getStdOut

public String getStdOut()
Returns the file to which the stdout of the job is written to.

Returns:
the basename of the file.

setStdErr

public void setStdErr(String fileName)
Sets the file to which the stderr of the job needs to be written to at the remote grid site. Should be just the basename. The file appears in the remote working directory for that job.

Parameters:
fileName - the basename of the file.

getStdErr

public String getStdErr()
Returns the file to which the stderr of the job is written to.

Returns:
the basename of the file.

setStdIn

public void setStdIn(String fileName)
Sets the file to from which to pick up the stdin for the job. The file is tracked via Replica Catalog, and is staged to the remote grid site.

Parameters:
fileName - the basename of the file.

getStdIn

public String getStdIn()
Returns the file from which the stdin is picked up.

Returns:
the basename of the file.

getID

public String getID()
Returns the ID associated with the job. Unfortunately currently it is the job name.

Returns:
the ID of the job.

setStagingSiteHandle

public void setStagingSiteHandle(String site)
Sets the staging site.

Parameters:
site - the staging

getStagingSiteHandle

public String getStagingSiteHandle()
Returns the staging site.

Returns:
the staging

getName

public String getName()
Returns the name of the job.

Returns:
String

setName

public void setName(String name)
Setter method to set the name of the job.

Parameters:
name - the name of the job.

getDirectory

public String getDirectory()
Returns the directory where the job runs.

Returns:
String

setDirectory

public void setDirectory(String directory)
Setter method to set the name of the job.

Parameters:
name - the name of the job.

getLogicalID

public String getLogicalID()
Returns the logical id of the job.

Returns:
String

getDAXID

public String getDAXID()
Returns the DAX ID for the job if it appeared in the DAX, else null

Returns:
the id of the job in the DAX if present , else null

setLogicalID

public void setLogicalID(String id)
Setter method to set the logical id of the job.

Parameters:
id - the logical id of the job.

getVDSSuperNode

public String getVDSSuperNode()
Returns the name of the compute job of Pegasus supernode containing this job.

Returns:
String

setVDSSuperNode

public void setVDSSuperNode(String name)
Setter method to the name of the compute job of Pegasus supernode containing this job.

Parameters:
name - the name of the job.

getJobType

public int getJobType()
Returns the type of the job. Returns the value matching the jobClass.

Returns:
int value of job class.

getGridGatewayJobType

public GridGateway.JOB_TYPE getGridGatewayJobType()
Returns the corresponding grid gateway job type

Returns:
grid gateway job type

getJobTypeDescription

public String getJobTypeDescription()
Gets the textual description of the type associated with the job.

Returns:
the textual description of the type associated with the job.

getJobTypeDescription

public String getJobTypeDescription(int type)
Gets the textual description of the type that can be associated with a job.

Parameters:
type - the type of the job.
Returns:
the textual description of the type associated with the job.

getTXNamespace

public String getTXNamespace()
Returns the namespace of the underlying transformation.

Returns:
namespace

setTXNamespace

public void setTXNamespace(String ns)
Sets the transformation namespace to be associated with the job.

Parameters:
ns - the namespace.

getTXName

public String getTXName()
Returns the name of the underlying transformation.

Returns:
name

setTXName

public void setTXName(String name)
Sets the transformation name of the underlying transformation.

Parameters:
name - the logical name of the transformation.

getTXVersion

public String getTXVersion()
Returns the version of the underlying transformation.

Returns:
version

setTXVersion

public void setTXVersion(String vs)
Sets the version of the underlying transformation.

Parameters:
vs - the version.

setTransformation

public void setTransformation(String ns,
                              String name,
                              String vs)
Sets the various attributes of underlying transformation.

Parameters:
ns - the namespace of the transformation.
name - the logical name of the transformation.
vs - the version of the transformation.

getCompleteTCName

public String getCompleteTCName()
Constructs the fully qualified name of a transformation with which to query the TC, including the namespace and version.

Returns:
the complete tranformation name.

getDVNamespace

public String getDVNamespace()
Returns the namespace of the underlying derivation.

Returns:
namespace

setDVNamespace

public void setDVNamespace(String ns)
Sets the derivation namespace to be associated with the job.

Parameters:
ns - the namespace.

getDVName

public String getDVName()
Returns the name of the underlying derivation.

Returns:
name

setDVName

public void setDVName(String name)
Sets the derivation name of the underlying derivation.

Parameters:
name - the logical name of the derivation.

getDVVersion

public String getDVVersion()
Returns the version of the underlying derivation.

Returns:
version

setDVVersion

public void setDVVersion(String vs)
Sets the version of the underlying derivation.

Parameters:
vs - the version.

setDerivation

public void setDerivation(String ns,
                          String name,
                          String vs)
Sets the various attributes of underlying derivation.

Parameters:
ns - the namespace of the derivation.
name - the logical name of the derivation.
vs - the version of the derivation.

getLevel

public int getLevel()
Returns the level associated with the job.

Returns:
int designating the level

setLevel

public void setLevel(int value)
Sets the level for the job.

Parameters:
value - the level

getCompleteDVName

public String getCompleteDVName()
Constructs the fully qualified name of the corresponding derivation used to generate this job in Chimera including the namespace and version.

Returns:
the complete derivation name.

getStagedExecutableBaseName

public String getStagedExecutableBaseName()
Returns the basename for the staged executable corresponding to the job.

Returns:
the staged executable basename

getStagedExecutableBaseName

public static String getStagedExecutableBaseName(String txNamespace,
                                                 String txName,
                                                 String txVersion)
Returns the basename for the staged executable corresponding to the job.

Parameters:
txNamespace - is the namespace in which the TR resides, may be null.
txName - is the base name of the transformation, must not be null.
txVersion - is the version of the TR, may be null
Returns:
the staged executable basename

getArguments

public String getArguments()
Returns the argument string with which the job has to be invoked.

Returns:
the argument string.

setArguments

public void setArguments(String arguments)
Sets the argument string with which the job has to be invoked.

Parameters:
arguments - the argument string.

combine

private static String combine(String namespace,
                              String name,
                              String version)
Combines the three components together into a single string as namespace-name-version.

Parameters:
namespace - is the namespace in which the TR resides, may be null.
name - is the base name of the transformation, must not be null.
version - is the version of the TR, may be null.
Returns:
the concatenated form .

setPreScript

public void setPreScript(String path)
It sets the prescript for the job. The argument string is assumed to be empty.

Parameters:
path - the path to the script that has to be run as a prescript.

setPreScript

public void setPreScript(String path,
                         String arguments)
It sets the prescript for the job.

Parameters:
path - the path to the script that has to be run as a prescript.
arguments - the arguments to the prescript,

getPreScriptPath

public String getPreScriptPath()
Returns the path to the prescript for the job if set.

Returns:
the path to the script that has to be run as a prescript, else null if no prescript has been set.

getPreScriptArguments

public String getPreScriptArguments()
Returns the arguments to the prescript for the job if set.

Returns:
the argumetns to the prescript script that has to be run as a prescript, else null if no prescript has been set.

typeRecursive

public boolean typeRecursive()
Returns whether the job is recursive or not.

Returns:
boolean

setTypeRecursive

public void setTypeRecursive()
Sets the job to be recursive.


typeInRange

public static boolean typeInRange(int type)
Returns whether the job type value for the job is in range or not.

Parameters:
type - the job type.
Returns:
true if the value is in range. false if the value is not in range.

updateProfiles

public void updateProfiles(TransformationCatalogEntry entry)
Updates all the profile namespaces with the information associated in the transformation catalog for this job. It ends up updating already existing information, and adds supplemental new information if present in the transformation catalog. The method does not explicitly check whehter the data object passed refers to this job or not. The calling method should ensure this.

Parameters:
entry - the TCEntry object corresponding to the entry in the Transformation Catalog for the job.

updateProfiles

public void updateProfiles(PegasusProperties properties)
Updates all the profile namespaces with the information specified by the user in the properties file, that apply to this job. It ends up updating already existing information, and adds supplemental new information if present in the properties file. The method does not explicitly check whehter the data object passed refers to this job or not. The calling method should ensure this.

Parameters:
properties - the PegasusProperties object containing the user properties.

updateProfiles

public void updateProfiles(Profiles profiles)
Updates all the profile namespaces with the information specified in list of profile objects passed. Pool catalog returns profile information as a list of Profile objects that need to be propogated to the job. It ends up updating already existing information, and adds supplemental new information if present in the properties file.

Parameters:
profiles - The Profiles that need to be incorporated in the jobs profile namespaces.

updateProfiles

public void updateProfiles(List profiles)
Updates all the profile namespaces with the information specified in list of profile objects passed. Pool catalog returns profile information as a list of Profile objects that need to be propogated to the job. It ends up updating already existing information, and adds supplemental new information if present in the properties file.

Parameters:
profiles - the list of Profile objects that need to be incorporated in the jobs profile namespaces.

mergeProfiles

public void mergeProfiles(Job job)
Merges profiles from another job to this job in a controlled fashion. The merging of the profile is dependant upon the namespace to which it belongs. Some profiles maybe overriden, others maybe summed up etc.

Parameters:
job - the Job object containing the job description for the job whose profiles have to be merged into this job.

equals

public boolean equals(Object obj)
Checks if an object is similar to the one referred to by this class. We compare the primary key to determine if it is the same or not.

Overrides:
equals in class Object
Parameters:
obj - the object for which equalsto is applied.
Returns:
true if the primary key (jobName) match. else false.

isMPIJob

public boolean isMPIJob()
Returns a boolean value denoting whether the job is MPI or not. If no job type is specified in the globus rsl for the job, the job is assumed to be non mpi.

Returns:
boolean true if jobtype=mpi set in the globus rsl. false in all other cases.

runInWorkDirectory

public boolean runInWorkDirectory()
Returns whether a job should be run in the work directory or not. If a job is not run in the work directory, then it should be run in the submit directory. That would be the case if the job has been scheduled to site "local" and the class of the job coressponds to the auxillary jobs that have been created by Pegasus.

Returns:
boolean true to indicate job can run in work directory, false job cant be run.

resetProfiles

public void resetProfiles()
Resets all the profiles associated with the job.


toString

public String toString()
Returns a textual description of the object.

Specified by:
toString in class Data
Returns:
textual description of the job.

toDOT

public String toDOT()
             throws IOException
Returns the DOT description of the object. This is used for visualizing the workflow.

Returns:
String containing the Partition object in XML.
Throws:
IOException - if something fishy happens to the stream.

toDOT

public void toDOT(Writer stream,
                  String indent)
           throws IOException
Returns the DOT description of the object. This is used for visualizing the workflow.

Parameters:
stream - is a stream opened and ready for writing. This can also be a StringWriter for efficient output.
indent - is a String of spaces used for pretty printing. The initial amount of spaces should be an empty string. The parameter is used internally for the recursive traversal.
Throws:
IOException - if something fishy happens to the stream.

getDOTColor

protected String getDOTColor()
Returns the color with which DOT should color the node representing the job.

Returns:
the color.

append

private void append(StringBuffer sb,
                    String key,
                    Object value,
                    String newLine)
Appends a key value mapping to the StringBuffer.

Parameters:
sb - StringBuffer to which the mapping has to be appended.
key - the field.
value - the value of the field.
newLine - the newLineSeparator to be used.

addProfile

public void addProfile(Profile p)
Adds a profile to the job object

Parameters:
p - the profile to be added


Copyright © 2011 The University of Southern California. All Rights Reserved.