public abstract class Executor extends Object
Modifier and Type | Field and Description |
---|---|
protected DatasetDao |
datasetDao |
protected ExecutionDao |
executionDao |
protected FileDescriptorDao |
fileDescriptorDao |
protected FileStorage |
fileStorage |
protected LogFileDao |
logFileDao |
protected com.google.inject.persist.UnitOfWork |
work |
protected WorkflowStepDao |
workflowStepDao |
Constructor and Description |
---|
Executor() |
Modifier and Type | Method and Description |
---|---|
protected void |
flushLog() |
String |
getExecutionId()
Returns the id of the execution associated with this executor.
|
abstract String |
getExecutorName()
Name of the executor.
|
String |
getLog()
Return any log information.
|
Execution.State |
getState()
Return current state of the execution.
|
String |
getStepId()
Returns the id of the step associated with this executor.
|
boolean |
isExecutorReady()
Before a step is executed this will check to see if the executor is ready
to run.
|
protected boolean |
isJobStopped()
Returns true if the job is stopped.
|
boolean |
isStoreLog()
Should the executor store the logfiles generated.
|
protected void |
print(String msg)
Append message to the log.
|
protected void |
print(String format,
Object... args)
Append formatted message to the log.
|
protected void |
println(String msg)
Append message with newline to the log.
|
protected void |
println(String format,
Object... args)
Append formatted message with newline to the log.
|
protected void |
println(String msg,
Throwable thr)
Append message and stacktrace of throwable to the log.
|
void |
setJobInformation(Execution execution,
WorkflowStep step)
Set the job information for this executor.
|
protected void |
setLog(String msg)
Sets the log to the message.
|
void |
setState(Execution.State state)
Sets the state of the job.
|
void |
setStoreLog(boolean storeLog)
Should the logfiles be stored in the database.
|
abstract void |
startJob()
The job is ready to be executed.
|
void |
stopJob()
The job should be stopped.
|
@Inject protected ExecutionDao executionDao
@Inject protected LogFileDao logFileDao
@Inject protected FileDescriptorDao fileDescriptorDao
@Inject protected FileStorage fileStorage
@Inject protected WorkflowStepDao workflowStepDao
@Inject protected DatasetDao datasetDao
@Inject protected com.google.inject.persist.UnitOfWork work
public boolean isStoreLog()
public void setStoreLog(boolean storeLog)
storeLog
- set to true (the default) to store the logfiles in the
database.public abstract String getExecutorName()
public boolean isExecutorReady()
public void setJobInformation(Execution execution, WorkflowStep step)
execution
- the execution to be used for job information.step
- the step that needs to be executed.public abstract void startJob()
public void stopJob()
protected boolean isJobStopped()
public String getStepId()
public String getExecutionId()
public String getLog()
protected void print(String msg)
msg
- the message to be added to the log.protected void print(String format, Object... args)
format
- A format stringargs
- Arguments referenced by the format specifiers in the format
string.protected void println(String msg)
msg
- the message to be added to the log.protected void println(String format, Object... args)
format
- A format stringargs
- Arguments referenced by the format specifiers in the format
string.protected void println(String msg, Throwable thr)
msg
- the messsage to be added to the log.thr
- the throwable to be added to the log.protected void setLog(String msg)
msg
- the new log message.protected void flushLog()
public Execution.State getState()
public void setState(Execution.State state)
Copyright © 2017. All rights reserved.