public class Stampede extends 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 String |
ARGUMENTS_KEY
The attribute key for task arguments.
|
static String |
CHILD_JOB_ID_KEY
The atrribute key for child job id.
|
static String |
CHILD_TASK_ID_KEY
The atrribute key for child task id.
|
static String |
JOB_CLUSTERED_KEY
The attribute key for whether a job is clustered or not
|
static String |
JOB_EDGE_EVENT_NAME
The event name for job edge
|
static String |
JOB_EVENT_NAME
The event name for a job
|
static String |
JOB_EXECUTABLE_KEY
The attribute key for the executable
|
static String |
JOB_ID_KEY
The attribute key for job id
|
static String |
JOB_MAX_RETRIES_KEY
The attribute key for how many times a job is retried
|
static String |
JOB_SUBMIT_FILE_KEY
Teh attribute key for the submit file
|
static 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 String |
mSubmitFileDir
The directory where all the submit files are to be generated.
|
static String |
NETLOGGER_BP_FILE_SUFFIX
The suffix to use while constructing the name of the metrics file
|
static String |
NETLOGGER_LOG_FORMATTER_IMPLEMENTOR |
static String |
PARENT_JOB_ID_KEY
The atrribute key for parent job id.
|
static String |
PARENT_TASK_ID_KEY
The atrribute key for parent task id.
|
static String |
TASK_EDGE_EVENT_NAME
The event name for task edge
|
static String |
TASK_EVENT_NAME
The event name for task info
|
static String |
TASK_ID_KEY
The attribute key for task id
|
static String |
TASK_MAP_EVENT_NAME
The event name for task map event
|
static String |
TASK_TRANSFORMATION_KEY
The attribute key for transformation
|
static String |
TYPE_DESCRIPTION_KEY
The attribute key for type description
|
static String |
TYPE_KEY
The attribute key for task type
|
static String |
WORKFLOW_ID_KEY
The attribute key for workflow id.
|
VERSION
Constructor and Description |
---|
Stampede() |
Modifier and Type | Method and Description |
---|---|
String |
booleanToInt(boolean value)
Returns boolean as an integer
|
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.
|
protected void |
generateEventsForDAXTask(PrintWriter writer,
ADag workflow,
Job job)
Generates stampede events corresponding to jobs/tasks in the DAX
|
protected void |
generateEventsForExecutableJob(PrintWriter writer,
ADag dag,
Job job)
Generates stampede events corresponding to an executable job
|
protected void |
generateTaskMapEvents(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 String NETLOGGER_BP_FILE_SUFFIX
public static final String NETLOGGER_LOG_FORMATTER_IMPLEMENTOR
public static final String WORKFLOW_ID_KEY
public static final String TASK_EVENT_NAME
public static final String TASK_ID_KEY
public static final String TYPE_KEY
public static final String TYPE_DESCRIPTION_KEY
public static final String TASK_TRANSFORMATION_KEY
public static final String ARGUMENTS_KEY
public static final String TASK_EDGE_EVENT_NAME
public static final String PARENT_TASK_ID_KEY
public static final String CHILD_TASK_ID_KEY
public static final String JOB_EVENT_NAME
public static final String JOB_ID_KEY
public static final String JOB_SUBMIT_FILE_KEY
public static final String JOB_CLUSTERED_KEY
public static final String JOB_MAX_RETRIES_KEY
public static final String JOB_TASK_COUNT_KEY
public static final String JOB_EXECUTABLE_KEY
public static final String JOB_EDGE_EVENT_NAME
public static final String PARENT_JOB_ID_KEY
public static final String CHILD_JOB_ID_KEY
public static final String TASK_MAP_EVENT_NAME
private LogFormatter mLogFormatter
protected PegasusBag mBag
protected 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 Collection<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(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(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(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 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.Copyright © 2011 The University of Southern California. All Rights Reserved.