public class Shell extends Abstract
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
JOBSTATE_JOB_PREFIX
The prefix for events associated with job in jobstate.log file
|
static java.lang.String |
JOBSTATE_POST_SCRIPT_PREFIX
The prefix for events associated with POST_SCRIPT in jobstate.log file
|
static java.lang.String |
JOBSTATE_PRE_SCRIPT_PREFIX
The prefix for events associated with job in jobstate.log file
|
protected CredentialHandlerFactory |
mFactory
Handle to the Credential Factory
|
protected GridStartFactory |
mGridStartFactory
The handle to the GridStart Factory.
|
protected boolean |
mInitializeGridStart
A boolean indicating whether grid start has been initialized or not.
|
private SiteStore |
mSiteStore
Handle to the Site Store.
|
private java.io.PrintWriter |
mWriteHandle
The handle to the output file that is being written to.
|
static java.lang.String |
PEGASUS_SHELL_RUNNER_FUNCTIONS_BASENAME |
mBag, mLogger, mPOptions, mProps, mSubmitFileDirVERSION| Constructor and Description |
|---|
Shell()
The default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
generateCallToCheckExitcode(Job job,
java.lang.String prefix)
Generates a call to check_exitcode function that is used
|
protected java.lang.String |
generateCallToExecuteJob(Job job,
java.lang.String scratchDirectory,
java.lang.String submitDirectory)
Generates a call to execute_job function , that is used to launch
a job from the shell script.
|
protected java.lang.String |
generateCallToExecutePostScript(Job job,
java.lang.String directory)
Generates a call to execute_post_script function , that is used to launch
a job from the shell script.
|
java.util.Collection<java.io.File> |
generateCode(ADag dag)
Generates the code for the concrete workflow in the GRMS input format.
|
void |
generateCode(ADag dag,
Job job)
Generates the code for a single job in the input format of the workflow
executor being used.
|
java.util.Map<java.lang.String,java.lang.String> |
getAdditionalBraindumpEntries(ADag workflow)
Returns a Map containing additional braindump entries that are specific
to a Code Generator
|
protected java.lang.String |
getExecutionDirectory(Job job)
Returns the directory in which a job should be executed.
|
protected java.lang.String |
getPathToShellScript(ADag dag)
Returns path to the shell script that is generated
|
protected java.lang.String |
getScriptFooter()
Returns the footer for the generated shell script.
|
protected java.lang.String |
getScriptHeader(java.lang.String submitDirectory)
Returns the header for the generated shell script.
|
protected java.lang.String |
getSubmitHostPathToShellRunnerFunctions()
Determines the path to common shell functions file that the generated
shell script will use.
|
void |
initialize(PegasusBag bag)
Initializes the Code Generator implementation.
|
private void |
initializeWriteHandle(java.lang.String filename)
It initializes the write handle to the output file.
|
protected boolean |
setXBitOnFile(java.lang.String file)
Sets the xbit on the file.
|
protected void |
writeString(java.lang.String st)
Writes a string to the associated write handle with the class
|
getDAGFilename, getDAGFilename, getFileBaseName, getWriter, reset, startMonitoring, writeOutBraindump, writeOutDAXReplicaStore, writeOutNotifications, writeOutStampedeEventspublic static final java.lang.String PEGASUS_SHELL_RUNNER_FUNCTIONS_BASENAME
public static final java.lang.String JOBSTATE_JOB_PREFIX
public static final java.lang.String JOBSTATE_POST_SCRIPT_PREFIX
public static final java.lang.String JOBSTATE_PRE_SCRIPT_PREFIX
private java.io.PrintWriter mWriteHandle
private SiteStore mSiteStore
protected GridStartFactory mGridStartFactory
protected CredentialHandlerFactory mFactory
protected boolean mInitializeGridStart
public void initialize(PegasusBag bag) throws CodeGeneratorException
initialize in interface CodeGeneratorinitialize in class Abstractbag - the bag of initialization objects.CodeGeneratorException - in case of any error occuring code generation.public java.util.Collection<java.io.File> generateCode(ADag dag) throws CodeGeneratorException
dag - the concrete workflow.CodeGeneratorException - in case of any error occuring code generation.public void generateCode(ADag dag, Job job) throws CodeGeneratorException
dag - the dag of which the job is a part of.job - the Job object holding the information about
that particular job.CodeGeneratorException - in case of any error occuring code generation.public java.util.Map<java.lang.String,java.lang.String> getAdditionalBraindumpEntries(ADag workflow)
getAdditionalBraindumpEntries in class Abstractworkflow - the executable workflowprotected java.lang.String generateCallToCheckExitcode(Job job, java.lang.String prefix)
job - the associated jobprefix - the prefix for the jobstate.log eventsprotected java.lang.String generateCallToExecutePostScript(Job job, java.lang.String directory)
job - the job to be launcheddirectory - the directory in which the job needs to be launched.protected java.lang.String generateCallToExecuteJob(Job job, java.lang.String scratchDirectory, java.lang.String submitDirectory)
job - the job to be launchedscratchDirectory - the workflow specific execution directory created during running of the workflowsubmitDirectory - the submit directory of the workflowprotected java.lang.String getScriptHeader(java.lang.String submitDirectory)
submitDirectory - the submit directory for the workflow.protected java.lang.String getSubmitHostPathToShellRunnerFunctions()
protected java.lang.String getScriptFooter()
protected java.lang.String getPathToShellScript(ADag dag)
dag - the workflowprivate void initializeWriteHandle(java.lang.String filename)
throws CodeGeneratorException
filename - the name of the file to which you want the write handle.CodeGeneratorExceptionprotected void writeString(java.lang.String st)
st - the string to be written.protected java.lang.String getExecutionDirectory(Job job)
job - the job.protected boolean setXBitOnFile(java.lang.String file)
file - the file for which the xbit is to be set