public abstract class BaseTaskProcessor extends Object implements ITaskProcessor
| Modifier and Type | Field and Description |
|---|---|
protected int |
commitInterval |
protected DataSource |
defaultDataSource |
protected boolean |
killed |
protected org.slf4j.Logger |
logger |
protected MasterConfig |
masterConfig |
protected int |
maxRetryTimes |
protected boolean |
paused |
protected org.apache.dolphinscheduler.dao.entity.ProcessInstance |
processInstance |
protected ProcessService |
processService |
protected org.apache.dolphinscheduler.dao.entity.TaskInstance |
taskInstance |
protected TaskPluginManager |
taskPluginManager |
protected String |
threadLoggerInfoName |
protected boolean |
timeout |
| Constructor and Description |
|---|
BaseTaskProcessor() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
action(TaskAction taskAction) |
protected boolean |
dispatch() |
protected abstract boolean |
dispatchTask()
dispatch task
|
org.apache.dolphinscheduler.dao.entity.DataSource |
getDefaultDataSource()
The default datasource is used to get the dolphinscheduler datasource info,
and the info will be used in StatisticsValueConfig and WriterConfig
|
protected Map<String,String> |
getResourceFullNames(org.apache.dolphinscheduler.dao.entity.TaskInstance taskInstance)
get resource map key is full name and value is tenantCode
|
protected org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext |
getTaskExecutionContext(org.apache.dolphinscheduler.dao.entity.TaskInstance taskInstance)
get TaskExecutionContext
|
String |
getType() |
void |
init(org.apache.dolphinscheduler.dao.entity.TaskInstance taskInstance,
org.apache.dolphinscheduler.dao.entity.ProcessInstance processInstance) |
protected abstract boolean |
killTask()
kill task, all tasks need to realize this function
|
protected boolean |
pause() |
protected abstract boolean |
pauseTask()
pause task, common tasks donot need this.
|
protected boolean |
run() |
protected abstract boolean |
runTask()
run task
|
void |
setTaskExecutionLogger()
set master task running logger.
|
protected boolean |
stop() |
protected boolean |
submit() |
protected abstract boolean |
submitTask()
submit task
|
org.apache.dolphinscheduler.dao.entity.TaskInstance |
taskInstance() |
protected abstract boolean |
taskTimeout()
task timeout process
|
protected boolean |
timeout() |
protected boolean |
verifyTenantIsNull(org.apache.dolphinscheduler.dao.entity.Tenant tenant,
org.apache.dolphinscheduler.dao.entity.TaskInstance taskInstance)
whehter tenant is null
|
protected final org.slf4j.Logger logger
protected boolean killed
protected boolean paused
protected boolean timeout
protected org.apache.dolphinscheduler.dao.entity.TaskInstance taskInstance
protected org.apache.dolphinscheduler.dao.entity.ProcessInstance processInstance
protected int maxRetryTimes
protected int commitInterval
protected ProcessService processService
protected MasterConfig masterConfig
protected TaskPluginManager taskPluginManager
protected String threadLoggerInfoName
protected DataSource defaultDataSource
public void init(org.apache.dolphinscheduler.dao.entity.TaskInstance taskInstance,
org.apache.dolphinscheduler.dao.entity.ProcessInstance processInstance)
init in interface ITaskProcessorprotected abstract boolean pauseTask()
protected abstract boolean killTask()
protected abstract boolean taskTimeout()
protected abstract boolean submitTask()
protected abstract boolean runTask()
protected abstract boolean dispatchTask()
public boolean action(TaskAction taskAction)
action in interface ITaskProcessorprotected boolean submit()
protected boolean run()
protected boolean dispatch()
protected boolean timeout()
protected boolean pause()
protected boolean stop()
public String getType()
getType in interface ITaskProcessorpublic org.apache.dolphinscheduler.dao.entity.TaskInstance taskInstance()
taskInstance in interface ITaskProcessorpublic void setTaskExecutionLogger()
protected org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext getTaskExecutionContext(org.apache.dolphinscheduler.dao.entity.TaskInstance taskInstance)
taskInstance - taskInstancepublic org.apache.dolphinscheduler.dao.entity.DataSource getDefaultDataSource()
protected boolean verifyTenantIsNull(org.apache.dolphinscheduler.dao.entity.Tenant tenant,
org.apache.dolphinscheduler.dao.entity.TaskInstance taskInstance)
tenant - tenanttaskInstance - taskInstanceCopyright © 2022 The Apache Software Foundation. All rights reserved.