edu.isi.pegasus.planner.code.generator
Class Braindump

java.lang.Object
  extended by edu.isi.pegasus.planner.code.generator.Braindump

public class Braindump
extends Object

Braindump file code generator that generates a Braindump file for the executable workflow in the submit directory. The following keys are generated in the braindump file.

 wf_uuid
 submit_hostname
 planner_arguments
 user
 grid_dn
 dax_label
 timestamp
 submit_dir
 planner_version
 type
 properties
 
Additionally, the following duplicate keys exist till pegasus-run is modified.
 old keyname -> new keyname
 =============================
 label --> dax_label
 pegasus_wf_time --> timestamp
 run --> submit_dir
 pegasus_version --> planner_version
 

Version:
$Revision: 4507 $
Author:
Karan Vahi

Field Summary
static String BRAINDUMP_FILE
          The basename of the braindump file.
static String BUILD_KEY
          The Key for the pegasus build.
static String DAX_INDEX_KEY
          The dax index
static String DAX_LABEL_KEY
          The DAX label.
static String DAX_VERRSION_KEY
          The DAX version.
static String GENERATOR_TYPE_KEY
          The Key designating type of Pegasus Code Generator.
static String GRID_DN_KEY
          The Grid DN of the user.
protected  PegasusBag mBag
          The bag of initialization objects.
protected  LogManager mLogger
          The handle to the logging object.
protected  PlannerOptions mPOptions
          The object containing the command line options specified to the planner at runtime.
protected  PegasusProperties mProps
          The object holding all the properties pertaining to Pegasus.
protected  String mSubmitFileDir
          The directory where all the submit files are to be generated.
static String PLANNER_ARGUMENTS_KEY
          The arguments passed to the planner.
static String PLANNER_VERSION_KEY
          The Key for the planner version
static String PROPERTIES_KEY
          The path to the pegasus properties file
static String ROOT_UUID_KEY
          The key for UUID of the workflow.
static String SUBMIT_DIR_KEY
          The submit directory for the workflow.
static String SUBMIT_HOSTNAME_KEY
          The key for the submit hostname.
static String TIMESTAMP_KEY
          The workflow timestamp.
static String USER_KEY
          The user who submitted the workflow.
static String UUID_KEY
          The key for UUID of the workflow.
static String VERSION_KEY
          The Key for the version id.
static String WF_NAME_KEY
          The Key for the flow id.
static String WF_TIME_KEY
          The Key for the timestamp.
static String WF_TIMESTAMP_KEY
          The Key for the timestamp.
 
Constructor Summary
Braindump()
           
 
Method Summary
 Map<String,String> defaultBrainDumpEntries(ADag workflow)
          Returns default braindump entries.
 Collection<File> generateCode(ADag dag)
          Generates the code for the executable workflow in terms of a braindump file that contains workflow metadata useful for monitoring daemons etc.
 void generateCode(ADag dag, Job job)
          Method not implemented.
 Collection<File> generateCode(ADag dag, Map<String,String> additionalEntries)
          Generates the code for the executable workflow in terms of a braindump file that contains workflow metadata useful for monitoring daemons etc.
protected  String getGridDN()
          Returns the distinguished name from the proxy
protected  String getSubmitHostname()
          Returns the submit hostname
 void initialize(PegasusBag bag)
          Initializes the Code Generator implementation.
protected  File writeOutBraindumpFile(Map<String,String> entries)
          Writes out the braindump.txt file for a workflow in the submit directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BRAINDUMP_FILE

public static final String BRAINDUMP_FILE
The basename of the braindump file.

See Also:
Constant Field Values

GENERATOR_TYPE_KEY

public static final String GENERATOR_TYPE_KEY
The Key designating type of Pegasus Code Generator.

See Also:
Constant Field Values

USER_KEY

public static final String USER_KEY
The user who submitted the workflow.

See Also:
Constant Field Values

GRID_DN_KEY

public static final String GRID_DN_KEY
The Grid DN of the user.

See Also:
Constant Field Values

PROPERTIES_KEY

public static final String PROPERTIES_KEY
The path to the pegasus properties file

See Also:
Constant Field Values

SUBMIT_HOSTNAME_KEY

public static final String SUBMIT_HOSTNAME_KEY
The key for the submit hostname.

See Also:
Constant Field Values

PLANNER_ARGUMENTS_KEY

public static final String PLANNER_ARGUMENTS_KEY
The arguments passed to the planner.

See Also:
Constant Field Values

ROOT_UUID_KEY

public static final String ROOT_UUID_KEY
The key for UUID of the workflow.

See Also:
Constant Field Values

UUID_KEY

public static final String UUID_KEY
The key for UUID of the workflow.

See Also:
Constant Field Values

DAX_LABEL_KEY

public static final String DAX_LABEL_KEY
The DAX label.

See Also:
Constant Field Values

DAX_INDEX_KEY

public static final String DAX_INDEX_KEY
The dax index

See Also:
Constant Field Values

DAX_VERRSION_KEY

public static final String DAX_VERRSION_KEY
The DAX version.

See Also:
Constant Field Values

TIMESTAMP_KEY

public static final String TIMESTAMP_KEY
The workflow timestamp.

See Also:
Constant Field Values

SUBMIT_DIR_KEY

public static final String SUBMIT_DIR_KEY
The submit directory for the workflow.

See Also:
Constant Field Values

VERSION_KEY

public static final String VERSION_KEY
The Key for the version id.

See Also:
org.griphyn.cPlanner.classes.DagInfo#releaseVersion, Constant Field Values

PLANNER_VERSION_KEY

public static final String PLANNER_VERSION_KEY
The Key for the planner version

See Also:
Constant Field Values

BUILD_KEY

public static final String BUILD_KEY
The Key for the pegasus build.

See Also:
Constant Field Values

WF_NAME_KEY

public static final String WF_NAME_KEY
The Key for the flow id.

See Also:
org.griphyn.cPlanner.classes.DagInfo#flowIDName, Constant Field Values

WF_TIME_KEY

public static final String WF_TIME_KEY
The Key for the timestamp.

See Also:
org.griphyn.cPlanner.classes.DagInfo#mFlowTimestamp, Constant Field Values

WF_TIMESTAMP_KEY

public static final String WF_TIMESTAMP_KEY
The Key for the timestamp.

See Also:
org.griphyn.cPlanner.classes.DagInfo#mFlowTimestamp, Constant Field Values

mBag

protected PegasusBag mBag
The bag of initialization objects.


mSubmitFileDir

protected String mSubmitFileDir
The directory where all the submit files are to be generated.


mProps

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


mPOptions

protected PlannerOptions mPOptions
The object containing the command line options specified to the planner at runtime.


mLogger

protected LogManager mLogger
The handle to the logging object.

Constructor Detail

Braindump

public Braindump()
Method Detail

initialize

public void initialize(PegasusBag bag)
                throws CodeGeneratorException
Initializes the Code Generator implementation.

Parameters:
bag - the bag of initialization objects.
Throws:
CodeGeneratorException - in case of any error occuring code generation.

defaultBrainDumpEntries

public Map<String,String> defaultBrainDumpEntries(ADag workflow)
                                           throws CodeGeneratorException
Returns default braindump entries.

Returns:
default entries
Throws:
CodeGeneratorException

generateCode

public Collection<File> generateCode(ADag dag)
                              throws CodeGeneratorException
Generates the code for the executable workflow in terms of a braindump file that contains workflow metadata useful for monitoring daemons etc.

Parameters:
dag - the concrete workflow.
Returns:
the Collection of File objects for the files written out.
Throws:
CodeGeneratorException - in case of any error occuring code generation.

generateCode

public Collection<File> generateCode(ADag dag,
                                     Map<String,String> additionalEntries)
                              throws CodeGeneratorException
Generates the code for the executable workflow in terms of a braindump file that contains workflow metadata useful for monitoring daemons etc.

Parameters:
dag - the concrete workflow.
additionalEntries - additional entries to go in the braindump file, overwriting the default entries.
Returns:
the Collection of File objects for the files written out.
Throws:
CodeGeneratorException - in case of any error occuring code generation.

generateCode

public void generateCode(ADag dag,
                         Job job)
                  throws CodeGeneratorException
Method not implemented. Throws an exception.

Parameters:
dag - the workflow
job - the job for which the code is to be generated.
Throws:
CodeGeneratorException

writeOutBraindumpFile

protected File writeOutBraindumpFile(Map<String,String> entries)
                              throws IOException
Writes out the braindump.txt file for a workflow in the submit directory. The braindump.txt file is used for passing to the tailstatd daemon that monitors the state of execution of the workflow.

Parameters:
entries - the Map containing the entries going into the braindump file.
Returns:
the absolute path to the braindump file.txt written in the directory.
Throws:
IOException - in case of error while writing out file.

getSubmitHostname

protected String getSubmitHostname()
                            throws CodeGeneratorException
Returns the submit hostname

Returns:
hostname
Throws:
CodeGeneratorException

getGridDN

protected String getGridDN()
Returns the distinguished name from the proxy

Returns:
the DN else null if proxy file not found.


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