public class Job extends Data implements GraphNodeContent
Modifier and Type | Field and Description |
---|---|
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 Map<String,Set<CredentialHandler.TYPE>> |
mCredentialsType
Set of credential types required by a job to execute remotely.
|
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
|
private CredentialHandler.TYPE |
mSubmissionCredential
The credential to use for job submission if required.
|
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.
|
Constructor and Description |
---|
Job()
Intialises the member variables.
|
Job(Job job)
Overloaded constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addCredentialType(String site,
CredentialHandler.TYPE type)
Adds a type of credential that will be required by a job.
|
void |
addCredentialType(String site,
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.
|
Map<String,Set<CredentialHandler.TYPE>> |
getCredentialTypes()
Returns the various credential types required by a job indexed by a site
from which to pick up the credential
|
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<PegasusFile> |
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<PegasusFile> |
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.
|
CredentialHandler.TYPE |
getSubmissionCredential()
Sets the credential to use for job submission.
|
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.
|
boolean |
requiresCredentials()
A boolean method indicating whether credentials are associated with the
job
|
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<PegasusFile> 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<PegasusFile> 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 |
setSubmissionCredential(CredentialHandler.TYPE cred)
Sets the credential to use for job submission.
|
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.
|
setToString, vectorToString
public static final int UNASSIGNED_JOB
public static final int COMPUTE_JOB
public static final int STAGE_IN_JOB
public static final int STAGE_OUT_JOB
public static final int REPLICA_REG_JOB
public static final int INTER_POOL_JOB
public static final int CREATE_DIR_JOB
public static final int STAGE_IN_WORKER_PACKAGE_JOB
public static final int CLEANUP_JOB
public static final int CHMOD_JOB
public static final int DAX_JOB
public static final int DAG_JOB
private static String DELIMITER
public int jobClass
public String jobID
public String jobName
public String logicalName
public String logicalId
public String namespace
public String version
public String dvName
public String dvNamespace
public String dvVersion
public String globusScheduler
public String executable
public String condorUniverse
public String stdIn
public String stdOut
public String stdErr
public String strargs
public Set inputFiles
org.griphyn.cPlanner.classes.PegasusFile
public Set outputFiles
org.griphyn.cPlanner.classes.PegasusFile
public String executionPool
public Globus globusRSL
public Condor condorVariables
public ENV envVariables
public Dagman dagmanVariables
public Hints hints
public Pegasus vdsNS
public int level
private double mRuntime
private boolean mJobExecutablesStaged
private Notifications mNotifications
private String mStagingSite
private String mDirectory
private CredentialHandler.TYPE mSubmissionCredential
private Map<String,Set<CredentialHandler.TYPE>> mCredentialsType
public Job()
public Job(Job job)
job
- the Job
object containing the job description.private static GridGateway.JOB_TYPE jobType2GridGatewayJobType(int type)
type
- the job typepublic Object clone()
public void setRuntime(String runtime)
runtime
- the runtime for the job.public void setRuntime(double runtime)
runtime
- the runtime for the job.public double getRuntime()
public double computeRuntime()
org.griphyn.cPlanner.namespace.Pegasus#RUNTIME_KEY
public void setUniverse(String universe)
universe
- the universe to be associated.public String getUniverse()
public void setExecutableStagingForJob(boolean value)
value
- the boolean value.public boolean userExecutablesStagedForJob()
public void addInputFile(PegasusFile file)
file
- the PegasusFile
containing the input file.public void setInputFiles(Set<PegasusFile> ipFiles)
ipFiles
- Set of PegasusFile
objects containing the input files.public Set<PegasusFile> getInputFiles()
PegasusFile
objects containing the input files.public void resetNotifications()
public void addNotification(Invoke invoke)
invoke
- the invoke object containing the notificationpublic void addNotifications(TransformationCatalogEntry entry)
entry
- the TransformationCatalogEntry objectpublic void addNotifications(Notifications invokes)
invokes
- the notifications to be addedpublic Collection<Invoke> getNotifications(Invoke.WHEN when)
when
- the conditionpublic Notifications getNotifications()
public void setSubmissionCredential(CredentialHandler.TYPE cred)
cred
- the job submission credentialpublic void addCredentialType(String site, String url)
site
- the site with which the credential is associatedurl
- the url for which a credential needs to be addedpublic void addCredentialType(String site, CredentialHandler.TYPE type)
type
- the credential type.public boolean requiresCredentials()
public CredentialHandler.TYPE getSubmissionCredential()
public Map<String,Set<CredentialHandler.TYPE>> getCredentialTypes()
public void resetCredentialTypes()
public void addOutputFile(PegasusFile file)
file
- the PegasusFile
containing the output file.public void setOutputFiles(Set<PegasusFile> opFiles)
opFiles
- Set of PegasusFile
objects containing the
output files.public Set<PegasusFile> getOutputFiles()
PegasusFile
objects containing the output files.public void setJobType(int type)
type
- the type of the job.IllegalArgumentException
- if the job type is outside its legal
range.UNASSIGNED_JOB
,
COMPUTE_JOB
,
STAGE_IN_JOB
,
STAGE_OUT_JOB
,
REPLICA_REG_JOB
,
INTER_POOL_JOB
,
CREATE_DIR_JOB
,
#STAGED_COMPUTE_JOB
,
CLEANUP_JOB
public void setSiteHandle(String site)
site
- the site handle.public String getSiteHandle()
public void setRemoteExecutable(String path)
path
- the path to the underlying transformation on the remote grid
site.getSiteHandle()
public String getRemoteExecutable()
public void setJobManager(String jobmanager)
jobmanager
- the jobmanager url.getJobManager()
public String getJobManager()
setJobManager(java.lang.String)
public void setStdOut(String fileName)
fileName
- the basename of the file.public String getStdOut()
public void setStdErr(String fileName)
fileName
- the basename of the file.public String getStdErr()
public void setStdIn(String fileName)
fileName
- the basename of the file.public String getStdIn()
public String getID()
public void setStagingSiteHandle(String site)
site
- the stagingpublic String getStagingSiteHandle()
public String getName()
public void setName(String name)
name
- the name of the job.public String getDirectory()
public void setDirectory(String directory)
name
- the name of the job.public String getLogicalID()
public String getDAXID()
public void setLogicalID(String id)
id
- the logical id of the job.public String getVDSSuperNode()
public void setVDSSuperNode(String name)
name
- the name of the job.public int getJobType()
public GridGateway.JOB_TYPE getGridGatewayJobType()
public String getJobTypeDescription()
public String getJobTypeDescription(int type)
type
- the type of the job.public String getTXNamespace()
public void setTXNamespace(String ns)
ns
- the namespace.public String getTXName()
public void setTXName(String name)
name
- the logical name of the transformation.public String getTXVersion()
public void setTXVersion(String vs)
vs
- the version.public void setTransformation(String ns, String name, String vs)
ns
- the namespace of the transformation.name
- the logical name of the transformation.vs
- the version of the transformation.public String getCompleteTCName()
public String getDVNamespace()
public void setDVNamespace(String ns)
ns
- the namespace.public String getDVName()
public void setDVName(String name)
name
- the logical name of the derivation.public String getDVVersion()
public void setDVVersion(String vs)
vs
- the version.public void setDerivation(String ns, String name, String vs)
ns
- the namespace of the derivation.name
- the logical name of the derivation.vs
- the version of the derivation.public int getLevel()
public void setLevel(int value)
value
- the levelpublic String getCompleteDVName()
public String getStagedExecutableBaseName()
public static String getStagedExecutableBaseName(String txNamespace, String txName, String txVersion)
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 nullpublic String getArguments()
public void setArguments(String arguments)
arguments
- the argument string.private static String combine(String namespace, String name, String version)
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.public void setPreScript(String path)
path
- the path to the script that has to be run as a prescript.public void setPreScript(String path, String arguments)
path
- the path to the script that has to be run as a prescript.arguments
- the arguments to the prescript,public String getPreScriptPath()
public String getPreScriptArguments()
public boolean typeRecursive()
public void setTypeRecursive()
public static boolean typeInRange(int type)
type
- the job type.public void updateProfiles(TransformationCatalogEntry entry)
entry
- the TCEntry
object corresponding to the
entry in the Transformation Catalog for the job.public void updateProfiles(PegasusProperties properties)
properties
- the PegasusProperties
object containing
the user properties.public void updateProfiles(Profiles profiles)
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.profiles
- The Profiles
that need to be incorporated in
the jobs profile namespaces.public void updateProfiles(List profiles)
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.profiles
- the list of Profile
objects that need to be
incorporated in the jobs profile namespaces.public void mergeProfiles(Job job)
job
- the Job
object containing the job description
for the job whose profiles have to be merged into this job.public boolean equals(Object obj)
public boolean isMPIJob()
public boolean runInWorkDirectory()
public void resetProfiles()
public String toString()
public String toDOT() throws IOException
IOException
- if something fishy happens to the stream.public void toDOT(Writer stream, String indent) throws IOException
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.IOException
- if something fishy happens to the stream.protected String getDOTColor()
private void append(StringBuffer sb, String key, Object value, String newLine)
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.public void addProfile(Profile p)
p
- the profile to be added