public class Stampede extends java.lang.Object implements CodeGenerator
the tasks int he abstract workflow the edges in the abstract workflow jobs in the executable workflow the edges in the executable workflow relationship about how the tasks in the abstract workflow map to jobs in the executable workflow.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ARGUMENTS_KEY
The attribute key for task arguments.
|
static java.lang.String |
CHILD_JOB_ID_KEY
The atrribute key for child job id.
|
static java.lang.String |
CHILD_TASK_ID_KEY
The atrribute key for child task id.
|
static java.lang.String |
JOB_CLUSTERED_KEY
The attribute key for whether a job is clustered or not
|
static java.lang.String |
JOB_EDGE_EVENT_NAME
The event name for job edge
|
static java.lang.String |
JOB_EVENT_NAME
The event name for a job
|
static java.lang.String |
JOB_EXECUTABLE_KEY
The attribute key for the executable
|
static java.lang.String |
JOB_ID_KEY
The attribute key for job id
|
static java.lang.String |
JOB_MAX_RETRIES_KEY
The attribute key for how many times a job is retried
|
static java.lang.String |
JOB_SUBMIT_FILE_KEY
Teh attribute key for the submit file
|
static java.lang.String |
JOB_TASK_COUNT_KEY
The attribute key for the number of tasks in the job
|
protected PegasusBag |
mBag
The bag of initialization objects.
|
private LogFormatter |
mLogFormatter
The handle to the netlogger log formatter.
|
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 java.lang.String |
mSubmitFileDir
The directory where all the submit files are to be generated.
|
static java.lang.String |
NETLOGGER_BP_FILE_SUFFIX
The suffix to use while constructing the name of the metrics file
|
static java.lang.String |
NETLOGGER_LOG_FORMATTER_IMPLEMENTOR |
static java.lang.String |
PARENT_JOB_ID_KEY
The atrribute key for parent job id.
|
static java.lang.String |
PARENT_TASK_ID_KEY
The atrribute key for parent task id.
|
static java.lang.String |
TASK_EDGE_EVENT_NAME
The event name for task edge
|
static java.lang.String |
TASK_EVENT_NAME
The event name for task info
|
static java.lang.String |
TASK_ID_KEY
The attribute key for task id
|
static java.lang.String |
TASK_MAP_EVENT_NAME
The event name for task map event
|
static java.lang.String |
TASK_TRANSFORMATION_KEY
The attribute key for transformation
|
static java.lang.String |
TYPE_DESCRIPTION_KEY
The attribute key for type description
|
static java.lang.String |
TYPE_KEY
The attribute key for task type
|
static java.lang.String |
WORKFLOW_ID_KEY
The attribute key for workflow id.
|
VERSION
Constructor and Description |
---|
Stampede() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
booleanToInt(boolean value)
Returns boolean as an integer
|
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.
|
void |
generateCode(ADag dag,
Job job)
Method not implemented.
|
protected void |
generateEventsForDAXTask(java.io.PrintWriter writer,
ADag workflow,
Job job)
Generates stampede events corresponding to jobs/tasks in the DAX
|
protected void |
generateEventsForExecutableJob(java.io.PrintWriter writer,
ADag dag,
Job job)
Generates stampede events corresponding to an executable job
|
protected void |
generateTaskMapEvents(java.io.PrintWriter writer,
ADag dag,
Job job)
Generates the task.map events that link the jobs in the DAX with the
jobs in the executable workflow
|
private int |
getTaskCount(Job job)
Returns the task count for a job.
|
void |
initialize(PegasusBag bag)
Initializes the Code Generator implementation.
|
void |
reset()
Resets the Code Generator implementation.
|
boolean |
startMonitoring()
Starts monitoring of the workflow by invoking a workflow monitor daemon.
|
public static final java.lang.String NETLOGGER_BP_FILE_SUFFIX
public static final java.lang.String NETLOGGER_LOG_FORMATTER_IMPLEMENTOR
public static final java.lang.String WORKFLOW_ID_KEY
public static final java.lang.String TASK_EVENT_NAME
public static final java.lang.String TASK_ID_KEY
public static final java.lang.String TYPE_KEY
public static final java.lang.String TYPE_DESCRIPTION_KEY
public static final java.lang.String TASK_TRANSFORMATION_KEY
public static final java.lang.String ARGUMENTS_KEY
public static final java.lang.String TASK_EDGE_EVENT_NAME
public static final java.lang.String PARENT_TASK_ID_KEY
public static final java.lang.String CHILD_TASK_ID_KEY
public static final java.lang.String JOB_EVENT_NAME
public static final java.lang.String JOB_ID_KEY
public static final java.lang.String JOB_SUBMIT_FILE_KEY
public static final java.lang.String JOB_CLUSTERED_KEY
public static final java.lang.String JOB_MAX_RETRIES_KEY
public static final java.lang.String JOB_TASK_COUNT_KEY
public static final java.lang.String JOB_EXECUTABLE_KEY
public static final java.lang.String JOB_EDGE_EVENT_NAME
public static final java.lang.String PARENT_JOB_ID_KEY
public static final java.lang.String CHILD_JOB_ID_KEY
public static final java.lang.String TASK_MAP_EVENT_NAME
private LogFormatter mLogFormatter
protected PegasusBag mBag
protected java.lang.String mSubmitFileDir
protected PegasusProperties mProps
protected PlannerOptions mPOptions
protected LogManager mLogger
public void initialize(PegasusBag bag) throws CodeGeneratorException
initialize
in interface CodeGenerator
bag
- 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
generateCode
in interface CodeGenerator
dag
- the concrete workflow.File
objects for the files written
out.CodeGeneratorException
- in case of any error occuring code generation.protected void generateEventsForDAXTask(java.io.PrintWriter writer, ADag workflow, Job job) throws CodeGeneratorException
writer
- the writer stream to write the events tooworkflow
- the workflow.job
- the job for which to generate the events.CodeGeneratorException
protected void generateEventsForExecutableJob(java.io.PrintWriter writer, ADag dag, Job job) throws CodeGeneratorException
writer
- the writer stream to write the events tooworkflow
- the workflow.job
- the job for which to generate the events.CodeGeneratorException
protected void generateTaskMapEvents(java.io.PrintWriter writer, ADag dag, Job job)
writer
- the writer stream to write the events tooworkflow
- the workflow.job
- the job for which to generate the events.public void generateCode(ADag dag, Job job) throws CodeGeneratorException
generateCode
in interface CodeGenerator
dag
- the workflowjob
- the job for which the code is to be generated.CodeGeneratorException
private int getTaskCount(Job job)
job
- the executable job.public java.lang.String booleanToInt(boolean value)
value
- the boolean valuepublic boolean startMonitoring()
CodeGenerator
startMonitoring
in interface CodeGenerator
public void reset() throws CodeGeneratorException
CodeGenerator
reset
in interface CodeGenerator
CodeGeneratorException
- in case of any error occuring code generation.