Class Braindump
- java.lang.Object
-
- edu.isi.pegasus.planner.code.generator.Braindump
-
public class Braindump extends java.lang.ObjectBraindump 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$
- Author:
- Karan Vahi
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBRAINDUMP_FILEThe basename of the braindump file.static java.lang.StringBUILD_KEYThe Key for the pegasus build.static java.lang.StringDAX_INDEX_KEYThe dax indexstatic java.lang.StringDAX_LABEL_KEYThe DAX label.static java.lang.StringDAX_VERRSION_KEYThe DAX version.static java.lang.StringGENERATOR_TYPE_KEYThe Key designating type of Pegasus Code Generator.static java.lang.StringGRID_DN_KEYThe Grid DN of the user.protected PegasusBagmBagThe bag of initialization objects.protected LogManagermLoggerThe handle to the logging object.protected PlannerOptionsmPOptionsThe object containing the command line options specified to the planner at runtime.protected PegasusPropertiesmPropsThe object holding all the properties pertaining to Pegasus.protected java.lang.StringmSubmitFileDirThe directory where all the submit files are to be generated.static java.lang.StringPLANNER_ARGUMENTS_KEYThe arguments passed to the planner.static java.lang.StringPLANNER_VERSION_KEYThe Key for the planner versionstatic java.lang.StringPROPERTIES_KEYThe path to the pegasus properties filestatic java.lang.StringROOT_UUID_KEYThe key for UUID of the workflow.static java.lang.StringSUBMIT_DIR_KEYThe submit directory for the workflow.static java.lang.StringSUBMIT_HOSTNAME_KEYThe key for the submit hostname.static java.lang.StringTIMESTAMP_KEYThe workflow timestamp.static java.lang.StringUSER_KEYThe user who submitted the workflow.static java.lang.StringUUID_KEYThe key for UUID of the workflow.static java.lang.StringVERSION_KEYThe Key for the version id.static java.lang.StringWF_NAME_KEYThe Key for the flow id.static java.lang.StringWF_TIME_KEYThe Key for the timestamp.static java.lang.StringWF_TIMESTAMP_KEYThe Key for the timestamp.
-
Constructor Summary
Constructors Constructor Description Braindump()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>defaultBrainDumpEntries(ADag workflow)Returns default braindump entries.java.util.Collection<java.io.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.voidgenerateCode(ADag dag, Job job)Method not implemented.java.util.Collection<java.io.File>generateCode(ADag dag, java.util.Map<java.lang.String,java.lang.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 java.lang.StringgetGridDN()Returns the distinguished name from the proxyprotected java.lang.StringgetSubmitHostname()Returns the submit hostnamevoidinitialize(PegasusBag bag)Initializes the Code Generator implementation.protected java.io.FilewriteOutBraindumpFile(java.util.Map<java.lang.String,java.lang.String> entries)Writes out the braindump.txt file for a workflow in the submit directory.
-
-
-
Field Detail
-
BRAINDUMP_FILE
public static final java.lang.String BRAINDUMP_FILE
The basename of the braindump file.- See Also:
- Constant Field Values
-
GENERATOR_TYPE_KEY
public static final java.lang.String GENERATOR_TYPE_KEY
The Key designating type of Pegasus Code Generator.- See Also:
- Constant Field Values
-
USER_KEY
public static final java.lang.String USER_KEY
The user who submitted the workflow.- See Also:
- Constant Field Values
-
GRID_DN_KEY
public static final java.lang.String GRID_DN_KEY
The Grid DN of the user.- See Also:
- Constant Field Values
-
PROPERTIES_KEY
public static final java.lang.String PROPERTIES_KEY
The path to the pegasus properties file- See Also:
- Constant Field Values
-
SUBMIT_HOSTNAME_KEY
public static final java.lang.String SUBMIT_HOSTNAME_KEY
The key for the submit hostname.- See Also:
- Constant Field Values
-
PLANNER_ARGUMENTS_KEY
public static final java.lang.String PLANNER_ARGUMENTS_KEY
The arguments passed to the planner.- See Also:
- Constant Field Values
-
ROOT_UUID_KEY
public static final java.lang.String ROOT_UUID_KEY
The key for UUID of the workflow.- See Also:
- Constant Field Values
-
UUID_KEY
public static final java.lang.String UUID_KEY
The key for UUID of the workflow.- See Also:
- Constant Field Values
-
DAX_LABEL_KEY
public static final java.lang.String DAX_LABEL_KEY
The DAX label.- See Also:
- Constant Field Values
-
DAX_INDEX_KEY
public static final java.lang.String DAX_INDEX_KEY
The dax index- See Also:
- Constant Field Values
-
DAX_VERRSION_KEY
public static final java.lang.String DAX_VERRSION_KEY
The DAX version.- See Also:
- Constant Field Values
-
TIMESTAMP_KEY
public static final java.lang.String TIMESTAMP_KEY
The workflow timestamp.- See Also:
- Constant Field Values
-
SUBMIT_DIR_KEY
public static final java.lang.String SUBMIT_DIR_KEY
The submit directory for the workflow.- See Also:
- Constant Field Values
-
VERSION_KEY
public static final java.lang.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 java.lang.String PLANNER_VERSION_KEY
The Key for the planner version- See Also:
- Constant Field Values
-
BUILD_KEY
public static final java.lang.String BUILD_KEY
The Key for the pegasus build.- See Also:
- Constant Field Values
-
WF_NAME_KEY
public static final java.lang.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 java.lang.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 java.lang.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 java.lang.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.
-
-
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 java.util.Map<java.lang.String,java.lang.String> defaultBrainDumpEntries(ADag workflow) throws CodeGeneratorException
Returns default braindump entries.- Returns:
- default entries
- Throws:
CodeGeneratorException
-
generateCode
public java.util.Collection<java.io.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
Fileobjects for the files written out. - Throws:
CodeGeneratorException- in case of any error occuring code generation.
-
generateCode
public java.util.Collection<java.io.File> generateCode(ADag dag, java.util.Map<java.lang.String,java.lang.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
Fileobjects 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 workflowjob- the job for which the code is to be generated.- Throws:
CodeGeneratorException
-
writeOutBraindumpFile
protected java.io.File writeOutBraindumpFile(java.util.Map<java.lang.String,java.lang.String> entries) throws java.io.IOExceptionWrites 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:
java.io.IOException- in case of error while writing out file.
-
getSubmitHostname
protected java.lang.String getSubmitHostname() throws CodeGeneratorExceptionReturns the submit hostname- Returns:
- hostname
- Throws:
CodeGeneratorException
-
getGridDN
protected java.lang.String getGridDN()
Returns the distinguished name from the proxy- Returns:
- the DN else null if proxy file not found.
-
-