mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-02 04:08:31 +08:00
parent
9be7f7931d
commit
be158328fb
@ -29,6 +29,7 @@ import org.apache.dolphinscheduler.common.utils.CommonUtils;
|
|||||||
import org.apache.dolphinscheduler.common.utils.DateUtils;
|
import org.apache.dolphinscheduler.common.utils.DateUtils;
|
||||||
import org.apache.dolphinscheduler.common.utils.HadoopUtils;
|
import org.apache.dolphinscheduler.common.utils.HadoopUtils;
|
||||||
import org.apache.dolphinscheduler.common.utils.JSONUtils;
|
import org.apache.dolphinscheduler.common.utils.JSONUtils;
|
||||||
|
import org.apache.dolphinscheduler.common.utils.LoggerUtils;
|
||||||
import org.apache.dolphinscheduler.common.utils.OSUtils;
|
import org.apache.dolphinscheduler.common.utils.OSUtils;
|
||||||
import org.apache.dolphinscheduler.common.utils.RetryerUtils;
|
import org.apache.dolphinscheduler.common.utils.RetryerUtils;
|
||||||
import org.apache.dolphinscheduler.dao.entity.TaskInstance;
|
import org.apache.dolphinscheduler.dao.entity.TaskInstance;
|
||||||
@ -185,6 +186,12 @@ public class TaskExecuteThread implements Runnable, Delayed {
|
|||||||
throw new PluginNotFoundException(String.format("%s Task Plugin Not Found,Please Check Config File.", taskExecutionContext.getTaskType()));
|
throw new PluginNotFoundException(String.format("%s Task Plugin Not Found,Please Check Config File.", taskExecutionContext.getTaskType()));
|
||||||
}
|
}
|
||||||
TaskRequest taskRequest = JSONUtils.parseObject(JSONUtils.toJsonString(taskExecutionContext), TaskRequest.class);
|
TaskRequest taskRequest = JSONUtils.parseObject(JSONUtils.toJsonString(taskExecutionContext), TaskRequest.class);
|
||||||
|
String taskLogName = LoggerUtils.buildTaskId(LoggerUtils.TASK_LOGGER_INFO_PREFIX,
|
||||||
|
taskExecutionContext.getProcessDefineCode(),
|
||||||
|
taskExecutionContext.getProcessDefineVersion(),
|
||||||
|
taskExecutionContext.getProcessInstanceId(),
|
||||||
|
taskExecutionContext.getTaskInstanceId());
|
||||||
|
taskRequest.setTaskLogName(taskLogName);
|
||||||
|
|
||||||
task = taskChannel.createTask(taskRequest);
|
task = taskChannel.createTask(taskRequest);
|
||||||
// task init
|
// task init
|
||||||
|
@ -178,7 +178,18 @@ public class TaskRequest {
|
|||||||
*/
|
*/
|
||||||
private int delayTime;
|
private int delayTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Task Logger name should be like: Task-{processDefinitionId}-{processInstanceId}-{taskInstanceId}
|
||||||
|
*/
|
||||||
|
private String taskLogName;
|
||||||
|
|
||||||
|
public String getTaskLogName() {
|
||||||
|
return taskLogName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskLogName(String taskLogName) {
|
||||||
|
this.taskLogName = taskLogName;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* resources full name and tenant code
|
* resources full name and tenant code
|
||||||
|
@ -41,7 +41,7 @@ public abstract class AbstractTaskExecutor extends AbstractTask {
|
|||||||
*/
|
*/
|
||||||
protected AbstractTaskExecutor(TaskRequest taskRequest) {
|
protected AbstractTaskExecutor(TaskRequest taskRequest) {
|
||||||
super(taskRequest);
|
super(taskRequest);
|
||||||
logger = LoggerFactory.getLogger(taskRequest.getLogPath());
|
logger = LoggerFactory.getLogger(taskRequest.getTaskLogName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user