Package edu.isi.pegasus.planner.classes
Class Job
- java.lang.Object
-
- edu.isi.pegasus.planner.classes.Data
-
- edu.isi.pegasus.planner.classes.Job
-
- All Implemented Interfaces:
GraphNodeContent,java.lang.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$
- Author:
- Karan Vahi, Gaurang Mehta
-
-
Field Summary
Fields Modifier and Type Field Description static intCHMOD_JOBDenotes a chmod job that sets the xbit on the remote end.static intCLEANUP_JOBDenotes a cleanup job, that removes the files that from the remote working directories of the remote sites.static intCOMPUTE_JOBDenotes a compute job.java.lang.StringcondorUniverseThe universe in which the job has to be executed.CondorcondorVariablesFor Condor Namespace.static intCREATE_DIR_JOBDenotes a job that creates directories at the remote pools.static intDAG_JOBDenotes a chmod job that sets the xbit on the remote end.DagmandagmanVariablesThe DAGMAN namespace profile variable holding the dagman profiles.static intDAX_JOBDenotes a chmod job that sets the xbit on the remote end.private static java.lang.StringDELIMITERThe delimiter that has to be used to combine the name for the staged executable.java.lang.StringdvNameThe name of the derivation in Chimera that generated the job.java.lang.StringdvNamespaceThe namespace to which the derivation is bound.java.lang.StringdvVersionThe version of the derivation.ENVenvVariablesTo accomodate the environment variables which might needed to be set.java.lang.StringexecutableThe path of the executable on the machine at which the job is executed.java.lang.StringexecutionPoolThe pool on which this job has been decided to be executed by the Interpool Engine.GlobusglobusRSLThe namespace object containing the globus rsl attributes which the user specifies in the dax, or the pool file or the properties file.java.lang.StringglobusSchedulerThe globus Scheduler for the job.HintshintsTo accomodate all the hints that maybe passed through the DAX.java.util.SetinputFilesContains the input files for the submit file.static intINTER_POOL_JOBDenotes a job that transfers the output of a compute node to the site where the child compute node is to be generated.intjobClassThe type of the job.java.lang.StringjobIDIdentifies of which Pegasus Super Node is a job associated with.java.lang.StringjobNameThe name of the job.intlevelIdentifies the level of the job in the dax.java.lang.StringlogicalIdThe logical id of the job as referred to in the dax.java.lang.StringlogicalNameThe logical name of the transformation which is executed as a part of this job.private java.util.Map<java.lang.String,java.util.Set<CredentialHandler.TYPE>>mCredentialsTypeSet of credential types required by a job to execute remotely.private java.lang.StringmDirectoryThe directory in which the job should run.private booleanmJobExecutablesStagedBoolean indicating whether the job executables were staged for it or not.private NotificationsmNotificationsAll the notifications associated with the jobprivate doublemRuntimeThe expected runtime for a job.private java.lang.StringmStagingSiteThe staging site associated with the jobprivate CredentialHandler.TYPEmSubmissionCredentialThe credential to use for job submission if required.java.lang.StringnamespaceThe namespace to which the transformation is bound.java.util.SetoutputFilesContains the output files for the submit file.static intREPLICA_REG_JOBDenotes a job that registers in the replica mechanism the materialized files.static intSTAGE_IN_JOBDenotea a job that is used to stage in the input files for a compute job.static intSTAGE_IN_WORKER_PACKAGE_JOBDenotes a job that stages the worker package.static intSTAGE_OUT_JOBDenotes a job that transfers the date generated by a compute job to the output pool specified by the user.java.lang.StringstdErrFile which contains standard error.java.lang.StringstdInFile which contains stdin (keyboard input).java.lang.StringstdOutFile which contains stdout.java.lang.StringstrargsThe arguements for the job.static intUNASSIGNED_JOBDenotes a job that does not fall into the other categories.PegasusvdsNSThe Pegasus namespace variable.java.lang.StringversionThe version of the transformation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCredentialType(java.lang.String site, CredentialHandler.TYPE type)Adds a type of credential that will be required by a job.voidaddCredentialType(java.lang.String site, java.lang.String url)Looks at a URL to determine whether a credential should be associated with a job or not.voidaddInputFile(PegasusFile file)Adds an input file to the underlying collection of input files associated with the job.voidaddNotification(Invoke invoke)Adds a Invoke object correpsonding to a notification.voidaddNotifications(TransformationCatalogEntry entry)Adds all the notifications specfied in the TransformationCatalogEntry to the underlying job notifications.voidaddNotifications(Notifications invokes)Adds all the notifications passed to the underlying container.voidaddOutputFile(PegasusFile file)Adds an output file to the underlying collection of output files associated with the job.voidaddProfile(Profile p)Adds a profile to the job objectprivate voidappend(java.lang.StringBuffer sb, java.lang.String key, java.lang.Object value, java.lang.String newLine)Appends a key value mapping to the StringBuffer.java.lang.Objectclone()Returns a new copy of the Object.private static java.lang.Stringcombine(java.lang.String namespace, java.lang.String name, java.lang.String version)Combines the three components together into a single string as namespace-name-version.doublecomputeRuntime()Returns the runtime associated with the job.booleanequals(java.lang.Object obj)Checks if an object is similar to the one referred to by this class.java.lang.StringgetArguments()Returns the argument string with which the job has to be invoked.java.lang.StringgetCompleteDVName()Constructs the fully qualified name of the corresponding derivation used to generate this job in Chimera including the namespace and version.java.lang.StringgetCompleteTCName()Constructs the fully qualified name of a transformation with which to query the TC, including the namespace and version.java.util.Map<java.lang.String,java.util.Set<CredentialHandler.TYPE>>getCredentialTypes()Returns the various credential types required by a job indexed by a site from which to pick up the credentialjava.lang.StringgetDAXID()Returns the DAX ID for the job if it appeared in the DAX, else nulljava.lang.StringgetDirectory()Returns the directory where the job runs.protected java.lang.StringgetDOTColor()Returns the color with which DOT should color the node representing the job.java.lang.StringgetDVName()Returns the name of the underlying derivation.java.lang.StringgetDVNamespace()Returns the namespace of the underlying derivation.java.lang.StringgetDVVersion()Returns the version of the underlying derivation.GridGateway.JOB_TYPEgetGridGatewayJobType()Returns the corresponding grid gateway job typejava.lang.StringgetID()Returns the ID associated with the job.java.util.Set<PegasusFile>getInputFiles()Returns the set of input files associated with the job.java.lang.StringgetJobManager()Returnss the remote jobmanager on which the job has to run.intgetJobType()Returns the type of the job.java.lang.StringgetJobTypeDescription()Gets the textual description of the type associated with the job.java.lang.StringgetJobTypeDescription(int type)Gets the textual description of the type that can be associated with a job.intgetLevel()Returns the level associated with the job.java.lang.StringgetLogicalID()Returns the logical id of the job.java.lang.StringgetName()Returns the name of the job.NotificationsgetNotifications()Returns all the notifications associated with the job.java.util.Collection<Invoke>getNotifications(Invoke.WHEN when)Returns a collection of all the notifications that need to be done for a particular conditionjava.util.Set<PegasusFile>getOutputFiles()Returns the set of output files associated with the job.java.lang.StringgetPreScriptArguments()Returns the arguments to the prescript for the job if set.java.lang.StringgetPreScriptPath()Returns the path to the prescript for the job if set.java.lang.StringgetRemoteExecutable()Returns the path of the underlying executable on the remote grid site.doublegetRuntime()Returns the expected runtime for the job that is set using the setRuntime method.java.lang.StringgetSiteHandle()Returns the handle of the site where the job is scheduled.java.lang.StringgetStagedExecutableBaseName()Returns the basename for the staged executable corresponding to the job.static java.lang.StringgetStagedExecutableBaseName(java.lang.String txNamespace, java.lang.String txName, java.lang.String txVersion)Returns the basename for the staged executable corresponding to the job.java.lang.StringgetStagingSiteHandle()Returns the staging site.java.lang.StringgetStdErr()Returns the file to which the stderr of the job is written to.java.lang.StringgetStdIn()Returns the file from which the stdin is picked up.java.lang.StringgetStdOut()Returns the file to which the stdout of the job is written to.CredentialHandler.TYPEgetSubmissionCredential()Sets the credential to use for job submission.java.lang.StringgetTXName()Returns the name of the underlying transformation.java.lang.StringgetTXNamespace()Returns the namespace of the underlying transformation.java.lang.StringgetTXVersion()Returns the version of the underlying transformation.java.lang.StringgetUniverse()Returns the universe associated with the job.java.lang.StringgetVDSSuperNode()Returns the name of the compute job of Pegasus supernode containing this job.booleanisMPIJob()Returns a boolean value denoting whether the job is MPI or not.private static GridGateway.JOB_TYPEjobType2GridGatewayJobType(int type)Returns an appropriate grid gateway job type corresponding to a job typevoidmergeProfiles(Job job)Merges profiles from another job to this job in a controlled fashion.booleanrequiresCredentials()A boolean method indicating whether credentials are associated with the jobvoidresetCredentialTypes()Resets the credential types required by a job.voidresetNotifications()Resets the notifications associated with the jobvoidresetProfiles()Resets all the profiles associated with the job.booleanrunInWorkDirectory()Returns whether a job should be run in the work directory or not.voidsetArguments(java.lang.String arguments)Sets the argument string with which the job has to be invoked.voidsetDerivation(java.lang.String ns, java.lang.String name, java.lang.String vs)Sets the various attributes of underlying derivation.voidsetDirectory(java.lang.String directory)Setter method to set the name of the job.voidsetDVName(java.lang.String name)Sets the derivation name of the underlying derivation.voidsetDVNamespace(java.lang.String ns)Sets the derivation namespace to be associated with the job.voidsetDVVersion(java.lang.String vs)Sets the version of the underlying derivation.voidsetExecutableStagingForJob(boolean value)Sets the executable staging flag in the job to the value passed.voidsetInputFiles(java.util.Set<PegasusFile> ipFiles)Sets the input files associated with the job.voidsetJobManager(java.lang.String jobmanager)Sets the remote jobmanager on which the job has to run.voidsetJobType(int type)Sets the type of the job.voidsetLevel(int value)Sets the level for the job.voidsetLogicalID(java.lang.String id)Setter method to set the logical id of the job.voidsetName(java.lang.String name)Setter method to set the name of the job.voidsetOutputFiles(java.util.Set<PegasusFile> opFiles)Sets the output files associated with the job.voidsetPreScript(java.lang.String path)It sets the prescript for the job.voidsetPreScript(java.lang.String path, java.lang.String arguments)It sets the prescript for the job.voidsetRemoteExecutable(java.lang.String path)Sets the path to the executable on the remote grid site.voidsetRuntime(double runtime)Sets the expected runtime for the job.voidsetRuntime(java.lang.String runtime)Sets the expected runtime for the job.voidsetSiteHandle(java.lang.String site)Sets the site handle of the site, where teh job is to be executedvoidsetStagingSiteHandle(java.lang.String site)Sets the staging site.voidsetStdErr(java.lang.String fileName)Sets the file to which the stderr of the job needs to be written to at the remote grid site.voidsetStdIn(java.lang.String fileName)Sets the file to from which to pick up the stdin for the job.voidsetStdOut(java.lang.String fileName)Sets the file to which the stdout of the job needs to be written to at the remote grid site.voidsetSubmissionCredential(CredentialHandler.TYPE cred)Sets the credential to use for job submission.voidsetTransformation(java.lang.String ns, java.lang.String name, java.lang.String vs)Sets the various attributes of underlying transformation.voidsetTXName(java.lang.String name)Sets the transformation name of the underlying transformation.voidsetTXNamespace(java.lang.String ns)Sets the transformation namespace to be associated with the job.voidsetTXVersion(java.lang.String vs)Sets the version of the underlying transformation.voidsetTypeRecursive()Sets the job to be recursive.voidsetUniverse(java.lang.String universe)Set the universe associated with the job.voidsetVDSSuperNode(java.lang.String name)Setter method to the name of the compute job of Pegasus supernode containing this job.java.lang.StringtoDOT()Returns the DOT description of the object.voidtoDOT(java.io.Writer stream, java.lang.String indent)Returns the DOT description of the object.java.lang.StringtoString()Returns a textual description of the object.static booleantypeInRange(int type)Returns whether the job type value for the job is in range or not.booleantypeRecursive()Returns whether the job is recursive or not.voidupdateProfiles(Profiles profiles)Updates all the profile namespaces with the information specified in list of profile objects passed.voidupdateProfiles(TransformationCatalogEntry entry)Updates all the profile namespaces with the information associated in the transformation catalog for this job.voidupdateProfiles(PegasusProperties properties)Updates all the profile namespaces with the information specified by the user in the properties file, that apply to this job.voidupdateProfiles(java.util.List profiles)Updates all the profile namespaces with the information specified in list of profile objects passed.booleanuserExecutablesStagedForJob()Returns whether user executables need to be staged for job or not.-
Methods inherited from class edu.isi.pegasus.planner.classes.Data
setToString, vectorToString
-
-
-
-
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 java.lang.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 java.lang.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 java.lang.String jobName
The name of the job.
-
logicalName
public java.lang.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 java.lang.String logicalId
The logical id of the job as referred to in the dax.
-
namespace
public java.lang.String namespace
The namespace to which the transformation is bound.
-
version
public java.lang.String version
The version of the transformation.
-
dvName
public java.lang.String dvName
The name of the derivation in Chimera that generated the job.
-
dvNamespace
public java.lang.String dvNamespace
The namespace to which the derivation is bound.
-
dvVersion
public java.lang.String dvVersion
The version of the derivation.
-
globusScheduler
public java.lang.String globusScheduler
The globus Scheduler for the job.
-
executable
public java.lang.String executable
The path of the executable on the machine at which the job is executed.
-
condorUniverse
public java.lang.String condorUniverse
The universe in which the job has to be executed. Can be standard, vanilla or globus.
-
stdIn
public java.lang.String stdIn
File which contains stdin (keyboard input).
-
stdOut
public java.lang.String stdOut
File which contains stdout.
-
stdErr
public java.lang.String stdErr
File which contains standard error.
-
strargs
public java.lang.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 java.util.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 java.util.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 java.lang.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 java.lang.String mStagingSite
The staging site associated with the job
-
mDirectory
private java.lang.String mDirectory
The directory in which the job should run.
-
mSubmissionCredential
private CredentialHandler.TYPE mSubmissionCredential
The credential to use for job submission if required.
-
mCredentialsType
private java.util.Map<java.lang.String,java.util.Set<CredentialHandler.TYPE>> mCredentialsType
Set of credential types required by a job to execute remotely.
-
-
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- theJobobject 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 java.lang.Object clone()
Returns a new copy of the Object.- Overrides:
clonein classjava.lang.Object- Returns:
- clone of the object.
-
setRuntime
public void setRuntime(java.lang.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(java.lang.String universe)
Set the universe associated with the job.- Parameters:
universe- the universe to be associated.
-
getUniverse
public java.lang.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- thePegasusFilecontaining the input file.
-
setInputFiles
public void setInputFiles(java.util.Set<PegasusFile> ipFiles)
Sets the input files associated with the job.- Parameters:
ipFiles- Set ofPegasusFileobjects containing the input files.
-
getInputFiles
public java.util.Set<PegasusFile> getInputFiles()
Returns the set of input files associated with the job.- Returns:
- Set of
PegasusFileobjects 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 java.util.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
-
setSubmissionCredential
public void setSubmissionCredential(CredentialHandler.TYPE cred)
Sets the credential to use for job submission.- Parameters:
cred- the job submission credential
-
addCredentialType
public void addCredentialType(java.lang.String site, java.lang.String url)Looks at a URL to determine whether a credential should be associated with a job or not.- Parameters:
site- the site with which the credential is associatedurl- the url for which a credential needs to be added
-
addCredentialType
public void addCredentialType(java.lang.String site, CredentialHandler.TYPE type)Adds a type of credential that will be required by a job.- Parameters:
type- the credential type.
-
requiresCredentials
public boolean requiresCredentials()
A boolean method indicating whether credentials are associated with the job- Returns:
- boolean
-
getSubmissionCredential
public CredentialHandler.TYPE getSubmissionCredential()
Sets the credential to use for job submission.- Returns:
- the credential to use for job submission
-
getCredentialTypes
public java.util.Map<java.lang.String,java.util.Set<CredentialHandler.TYPE>> getCredentialTypes()
Returns the various credential types required by a job indexed by a site from which to pick up the credential- 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- thePegasusFilecontaining the output file.
-
setOutputFiles
public void setOutputFiles(java.util.Set<PegasusFile> opFiles)
Sets the output files associated with the job.- Parameters:
opFiles- Set ofPegasusFileobjects containing the output files.
-
getOutputFiles
public java.util.Set<PegasusFile> getOutputFiles()
Returns the set of output files associated with the job.- Returns:
- Set of
PegasusFileobjects containing the output files.
-
setJobType
public void setJobType(int type)
Sets the type of the job.- Parameters:
type- the type of the job.- Throws:
java.lang.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(java.lang.String site)
Sets the site handle of the site, where teh job is to be executed- Parameters:
site- the site handle.
-
getSiteHandle
public java.lang.String getSiteHandle()
Returns the handle of the site where the job is scheduled.- Returns:
- site handle.
-
setRemoteExecutable
public void setRemoteExecutable(java.lang.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 java.lang.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(java.lang.String jobmanager)
Sets the remote jobmanager on which the job has to run.- Parameters:
jobmanager- the jobmanager url.- See Also:
getJobManager()
-
getJobManager
public java.lang.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(java.lang.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 java.lang.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(java.lang.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 java.lang.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(java.lang.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 java.lang.String getStdIn()
Returns the file from which the stdin is picked up.- Returns:
- the basename of the file.
-
getID
public java.lang.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(java.lang.String site)
Sets the staging site.- Parameters:
site- the staging
-
getStagingSiteHandle
public java.lang.String getStagingSiteHandle()
Returns the staging site.- Returns:
- the staging
-
getName
public java.lang.String getName()
Returns the name of the job.- Returns:
- String
-
setName
public void setName(java.lang.String name)
Setter method to set the name of the job.- Parameters:
name- the name of the job.
-
getDirectory
public java.lang.String getDirectory()
Returns the directory where the job runs.- Returns:
- String
-
setDirectory
public void setDirectory(java.lang.String directory)
Setter method to set the name of the job.- Parameters:
name- the name of the job.
-
getLogicalID
public java.lang.String getLogicalID()
Returns the logical id of the job.- Returns:
- String
-
getDAXID
public java.lang.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(java.lang.String id)
Setter method to set the logical id of the job.- Parameters:
id- the logical id of the job.
-
getVDSSuperNode
public java.lang.String getVDSSuperNode()
Returns the name of the compute job of Pegasus supernode containing this job.- Returns:
- String
-
setVDSSuperNode
public void setVDSSuperNode(java.lang.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 java.lang.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 java.lang.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 java.lang.String getTXNamespace()
Returns the namespace of the underlying transformation.- Returns:
- namespace
-
setTXNamespace
public void setTXNamespace(java.lang.String ns)
Sets the transformation namespace to be associated with the job.- Parameters:
ns- the namespace.
-
getTXName
public java.lang.String getTXName()
Returns the name of the underlying transformation.- Returns:
- name
-
setTXName
public void setTXName(java.lang.String name)
Sets the transformation name of the underlying transformation.- Parameters:
name- the logical name of the transformation.
-
getTXVersion
public java.lang.String getTXVersion()
Returns the version of the underlying transformation.- Returns:
- version
-
setTXVersion
public void setTXVersion(java.lang.String vs)
Sets the version of the underlying transformation.- Parameters:
vs- the version.
-
setTransformation
public void setTransformation(java.lang.String ns, java.lang.String name, java.lang.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 java.lang.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 java.lang.String getDVNamespace()
Returns the namespace of the underlying derivation.- Returns:
- namespace
-
setDVNamespace
public void setDVNamespace(java.lang.String ns)
Sets the derivation namespace to be associated with the job.- Parameters:
ns- the namespace.
-
getDVName
public java.lang.String getDVName()
Returns the name of the underlying derivation.- Returns:
- name
-
setDVName
public void setDVName(java.lang.String name)
Sets the derivation name of the underlying derivation.- Parameters:
name- the logical name of the derivation.
-
getDVVersion
public java.lang.String getDVVersion()
Returns the version of the underlying derivation.- Returns:
- version
-
setDVVersion
public void setDVVersion(java.lang.String vs)
Sets the version of the underlying derivation.- Parameters:
vs- the version.
-
setDerivation
public void setDerivation(java.lang.String ns, java.lang.String name, java.lang.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 java.lang.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 java.lang.String getStagedExecutableBaseName()
Returns the basename for the staged executable corresponding to the job.- Returns:
- the staged executable basename
-
getStagedExecutableBaseName
public static java.lang.String getStagedExecutableBaseName(java.lang.String txNamespace, java.lang.String txName, java.lang.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 java.lang.String getArguments()
Returns the argument string with which the job has to be invoked.- Returns:
- the argument string.
-
setArguments
public void setArguments(java.lang.String arguments)
Sets the argument string with which the job has to be invoked.- Parameters:
arguments- the argument string.
-
combine
private static java.lang.String combine(java.lang.String namespace, java.lang.String name, java.lang.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(java.lang.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(java.lang.String path, java.lang.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 java.lang.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 java.lang.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- theTCEntryobject 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- thePegasusPropertiesobject 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 ofProfileobjects 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- TheProfilesthat need to be incorporated in the jobs profile namespaces.
-
updateProfiles
public void updateProfiles(java.util.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 ofProfileobjects 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 ofProfileobjects 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- theJobobject containing the job description for the job whose profiles have to be merged into this job.
-
equals
public boolean equals(java.lang.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:
equalsin classjava.lang.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 java.lang.String toString()
Returns a textual description of the object.
-
toDOT
public java.lang.String toDOT() throws java.io.IOExceptionReturns the DOT description of the object. This is used for visualizing the workflow.- Returns:
- String containing the Partition object in XML.
- Throws:
java.io.IOException- if something fishy happens to the stream.
-
toDOT
public void toDOT(java.io.Writer stream, java.lang.String indent) throws java.io.IOExceptionReturns 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 aStringof 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:
java.io.IOException- if something fishy happens to the stream.
-
getDOTColor
protected java.lang.String getDOTColor()
Returns the color with which DOT should color the node representing the job.- Returns:
- the color.
-
append
private void append(java.lang.StringBuffer sb, java.lang.String key, java.lang.Object value, java.lang.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
-
-