edu.isi.pegasus.planner.code.gridstart
Class VDSPOSTScript

java.lang.Object
  extended by edu.isi.pegasus.planner.code.gridstart.VDSPOSTScript
All Implemented Interfaces:
POSTScript
Direct Known Subclasses:
ExitCode, ExitPOST, PegasusExitCode

public abstract class VDSPOSTScript
extends Object
implements POSTScript

An abstract implementation of the interface, that is a superclass for all the VDS supplied postscripts. These postscripts work can parse kickstart records.

Version:
$Revision: 2590 $
Author:
Karan Vahi vahi@isi.edu

Field Summary
static String EXITCODE_OUTPUT_SUFFIX
          The suffix for the exitcode output file, that is generated at the submit host.
protected  String mExitParserPath
          The path to the exitcode client that parses the exit status of the kickstart.
protected  LogManager mLogger
          The LogManager object which is used to log all the messages.
protected  boolean mPostScriptDebug
          A boolean indicating whether to turn the debug on for the postscript or not.
protected  String mPostScriptProperties
          The properties that need to be passed to the postscript invocation on the command line in the java format.
protected  PegasusProperties mProps
          The object holding all the properties pertaining to Pegasus.
protected  String mSubmitDir
          The submit directory where the submit files are being generated for the workflow.
 
Fields inherited from interface edu.isi.pegasus.planner.code.POSTScript
VERSION
 
Constructor Summary
VDSPOSTScript()
          The default constructor.
 
Method Summary
protected  void appendProperty(StringBuffer sb, String key, String value)
          Appends a property to the StringBuffer, in the java command line format.
 boolean construct(Job job, String key)
          Constructs the postscript that has to be invoked on the submit host after the job has executed on the remote end.
protected abstract  String getDefaultExitCodePath()
          Returns the path to exitcode that is to be used on the kickstart output.
protected  String getPostScriptLogFile(Job job)
          Returns the path to the postscript log file for a job.
protected  String getPostScriptProperties(PegasusProperties properties)
          Returns the properties that need to be passed to the the postscript invocation in the java format.
 void initialize(PegasusProperties properties, String path, String submitDir)
          Initialize the POSTScript implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.isi.pegasus.planner.code.POSTScript
shortDescribe
 

Field Detail

EXITCODE_OUTPUT_SUFFIX

public static final String EXITCODE_OUTPUT_SUFFIX
The suffix for the exitcode output file, that is generated at the submit host.

See Also:
Constant Field Values

mLogger

protected LogManager mLogger
The LogManager object which is used to log all the messages.


mProps

protected PegasusProperties mProps
The object holding all the properties pertaining to Pegasus.


mExitParserPath

protected String mExitParserPath
The path to the exitcode client that parses the exit status of the kickstart. The client is run as a postscript. It also includes the option to the command since at present it is same for all. It is $PEGASUS_HOME/bin/exitcode (no -n)!


mPostScriptDebug

protected boolean mPostScriptDebug
A boolean indicating whether to turn the debug on for the postscript or not.


mPostScriptProperties

protected String mPostScriptProperties
The properties that need to be passed to the postscript invocation on the command line in the java format.


mSubmitDir

protected String mSubmitDir
The submit directory where the submit files are being generated for the workflow.

Constructor Detail

VDSPOSTScript

public VDSPOSTScript()
The default constructor.

Method Detail

getDefaultExitCodePath

protected abstract String getDefaultExitCodePath()
Returns the path to exitcode that is to be used on the kickstart output.

Returns:
the path to the exitcode script to be invoked.

initialize

public void initialize(PegasusProperties properties,
                       String path,
                       String submitDir)
Initialize the POSTScript implementation.

Specified by:
initialize in interface POSTScript
Parameters:
properties - the PegasusProperties object containing all the properties required by Pegasus.
path - the path to the POSTScript on the submit host.
submitDir - the submit directory where the submit file for the job has to be generated.

construct

public boolean construct(Job job,
                         String key)
Constructs the postscript that has to be invoked on the submit host after the job has executed on the remote end. The postscript usually works on the xml output generated by kickstart. The postscript invoked is exitcode that is shipped with VDS, and can usually be found at $PEGASUS_HOME/bin/exitcode.

The postscript is constructed and populated as a profile in the DAGMAN namespace.

Specified by:
construct in interface POSTScript
Parameters:
job - the Job object containing the job description of the job that has to be enabled on the grid.
key - the key for the profile that has to be inserted.
Returns:
boolean true if postscript was generated,else false.

getPostScriptLogFile

protected String getPostScriptLogFile(Job job)
Returns the path to the postscript log file for a job.

Parameters:
job - the Job containing job description

getPostScriptProperties

protected String getPostScriptProperties(PegasusProperties properties)
Returns the properties that need to be passed to the the postscript invocation in the java format. It is of the form "-Dprop1=value1 -Dprop2=value2 .."

Parameters:
properties - the properties object
Returns:
the properties list, else empty string.

appendProperty

protected void appendProperty(StringBuffer sb,
                              String key,
                              String value)
Appends a property to the StringBuffer, in the java command line format.

Parameters:
sb - the StringBuffer to append the property to.
key - the property.
value - the property value.


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