Class PegasusExitCode

  • All Implemented Interfaces:
    POSTScript

    public class PegasusExitCode
    extends java.lang.Object
    implements POSTScript
    The exitcode wrapper, that can parse kickstart output's and put them in the database also.
    Version:
    $Revision$
    Author:
    Karan Vahi vahi@isi.edu
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ERR_SUCCESS_MSG_DELIMITER
      The delimiter used for delimited error and success message internally
      protected java.lang.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 java.lang.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 java.lang.String mSubmitDir
      The submit directory where the submit files are being generated for the workflow.
      static java.lang.String POSTSCRIPT_ARGUMENTS_FOR_ONLY_ROTATING_LOG_FILE
      The arguments for pegasus-exitcode when you only want the log files to be rotated.
      static java.lang.String SHORT_NAME
      The SHORTNAME for this implementation.
    • Constructor Summary

      Constructors 
      Constructor Description
      PegasusExitCode()
      The default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void appendProperty​(java.lang.StringBuffer sb, java.lang.String key, java.lang.String value)
      Appends a property to the StringBuffer, in the java command line format.
      boolean construct​(Job job, java.lang.String key)
      Constructs the postscript that has to be invoked on the submit host after the job has executed on the remote end.
      java.lang.String getDefaultExitCodePath()
      Returns the path to exitcode that is to be used on the kickstart output.
      protected java.lang.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, java.lang.String path, java.lang.String submitDir)
      Initialize the POSTScript implementation.
      java.lang.String shortDescribe()
      Returns a short textual description of the implementing class.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • POSTSCRIPT_ARGUMENTS_FOR_ONLY_ROTATING_LOG_FILE

        public static final java.lang.String POSTSCRIPT_ARGUMENTS_FOR_ONLY_ROTATING_LOG_FILE
        The arguments for pegasus-exitcode when you only want the log files to be rotated.
        See Also:
        Constant Field Values
      • SHORT_NAME

        public static final java.lang.String SHORT_NAME
        The SHORTNAME for this implementation.
        See Also:
        Constant Field Values
      • ERR_SUCCESS_MSG_DELIMITER

        public static final java.lang.String ERR_SUCCESS_MSG_DELIMITER
        The delimiter used for delimited error and success message internally
        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 java.lang.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/pegasus-exitcode
      • mPostScriptProperties

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

        protected java.lang.String mSubmitDir
        The submit directory where the submit files are being generated for the workflow.
    • Constructor Detail

      • PegasusExitCode

        public PegasusExitCode()
        The default constructor.
    • Method Detail

      • initialize

        public void initialize​(PegasusProperties properties,
                               java.lang.String path,
                               java.lang.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,
                                 java.lang.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.
      • getPostScriptProperties

        protected java.lang.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 empty string as pegasus-exitcode does not parse properties currently
      • appendProperty

        protected void appendProperty​(java.lang.StringBuffer sb,
                                      java.lang.String key,
                                      java.lang.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.
      • shortDescribe

        public java.lang.String shortDescribe()
        Returns a short textual description of the implementing class.
        Specified by:
        shortDescribe in interface POSTScript
        Returns:
        short textual description.
      • getDefaultExitCodePath

        public java.lang.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.