| java.lang.Object org.griphyn.vdl.planner.Scriptor
Scriptor | public class Scriptor (Code) | | This class generates the shell scripts from a DAX. There is a script
for each job in the dag, and there is a control script to coordinate
these jobs.
The scripts are assembled mostly from template files and substitutions.
The template files reside in $PEGASUS_HOME/share :
template | purpose |
sp-job-1.tmpl | start of job script |
sp-job-2.tmpl | unused |
sp-job-3.tmpl | final portion of job script |
sp-master-1.tmpl | start of master script |
sp-master-2.tmpl | intermediary of master script |
sp-master-3.tmpl | final portion of master script |
sp-master-job.tmpl | Invocation of job from master |
The following substitutions are available by default. Some substitutions
are only available during job generation:
variable | purpose |
DAXLABEL | user-given label of the workflow |
DV | Job: fully-qualified DV of job |
FILELIST | Job: Name of file of output mappings |
HOME | JRE system property user.home |
JOBID | Job: the IDxxxxx of the current job |
JOBLOG | Job: the log file of the job |
JOBSCRIPT | Job: name of script file for job |
KICKSTART | if set, path to local kickstart |
LOGFILE | Name of master log file |
NOW | Start time stamp of processing (compile time)
REGISTER | 0 or 1 for replica registration |
TR | Job: fully-qualified TR of job |
USER | JRE system property user.name |
author: Jens-S. Vöckler author: Yong Zhao version: $Revision: 50 $ |
Constructor Summary | |
public | Scriptor(String dirName, ADAG adag, RCWrapper rc, SCWrapper sc, TCWrapper tc, HashMap fnMap, File dataDir) Constructor
Parameters: dirName - names the directory into which to produce the scripts. Parameters: adag - is the DAX as a parsed data structure in memory. Parameters: rc - is the replica catalog wrapper. Parameters: sc - is the site catalog wrapper, may be null . Parameters: tc - is the transformation catalog wrapper. Parameters: fnMap - is a map containing all filesnames in the DAG. |
Scriptor | public Scriptor(String dirName, ADAG adag, RCWrapper rc, SCWrapper sc, TCWrapper tc, HashMap fnMap, File dataDir)(Code) | | Constructor
Parameters: dirName - names the directory into which to produce the scripts. Parameters: adag - is the DAX as a parsed data structure in memory. Parameters: rc - is the replica catalog wrapper. Parameters: sc - is the site catalog wrapper, may be null . Parameters: tc - is the transformation catalog wrapper. Parameters: fnMap - is a map containing all filesnames in the DAG. Parameters: dataDir - is the location of $PEGASUS_HOME/share from properties. |
addSubstitution | public String addSubstitution(String key, String value)(Code) | | Inserts a substitution into the substitutable variables.
Parameters: key - is the template variable name Parameters: value - is the replacement the previous setting, or null . See Also: Scriptor.getSubstitution(String) |
copyFromTemplate | public void copyFromTemplate(Writer w, String tfn) throws IOException(Code) | | Copies a template file into the open writer. During copy,
certain substitutions may take place. The substitutable variables
are dynamically adjusted from the main class.
Parameters: w - is the writer open for writing. Parameters: tfn - is the template base file name. throws: IOException - in case some io operation goes wrong. |
finalizeControlScript | public void finalizeControlScript() throws IOException(Code) | | Write the control script tail to the control file.
exception: IOException - if adding to the master script fails forsome reason. |
getRegister | public boolean getRegister()(Code) | | Gets the flag indicating whether to register output files.
true, if output files are going to be registered. See Also: Scriptor.setRegister(boolean) |
initializeControlScript | public String initializeControlScript() throws IOException(Code) | | Writes the control script head, including functions for file
registration.
the name of the control (master) script. throws: IOException - if writing to the master script somehow failes. |
intermediateControlScript | public void intermediateControlScript() throws IOException(Code) | | Adds scripts between stages.
exception: IOException - if adding to the master script fails forsome reason. |
processJob | public String processJob(String jobID, boolean checkInputFiles) throws IOException(Code) | | Processes each job in the adag. Also checks for input file
existence, if necessary.
Parameters: jobID - is the DAX-unique job id to generate a scripts for. Parameters: checkInputFiles - if set, checks in the filesystem for theexistence of all input files into the job. the name of the job control script. throws: IOException - for failure to write any job related files. |
setKickstart | public void setKickstart(String kickstart)(Code) | | Sets kickstart path, if the path is null, kickstart will not be used.
Parameters: kickstart - the path to invoke kickstart See Also: Scriptor.getKickstart() |
setRegister | public void setRegister(boolean b)(Code) | | Sets the flag indicating whether to register output files.
Parameters: b - is a flag to set the registration state. See Also: Scriptor.getRegister() |
|
|