refactor-worker merge to dev bug fix

This commit is contained in:
qiaozhanwei 2020-04-07 14:28:05 +08:00
parent 433b41dd7f
commit b5546ddb68
3 changed files with 6 additions and 25 deletions

View File

@ -378,7 +378,7 @@ public class TaskInstance implements Serializable {
public boolean isSubProcess(){
return TaskType.SUB_PROCESS.getDescp().equals(this.taskType);
return TaskType.SUB_PROCESS.equals(TaskType.valueOf(this.taskType));
}
public String getDependency(){

View File

@ -28,10 +28,7 @@ import org.apache.dolphinscheduler.common.task.datax.DataxParameters;
import org.apache.dolphinscheduler.common.task.procedure.ProcedureParameters;
import org.apache.dolphinscheduler.common.task.sql.SqlParameters;
import org.apache.dolphinscheduler.common.thread.Stopper;
import org.apache.dolphinscheduler.common.utils.EnumUtils;
import org.apache.dolphinscheduler.common.utils.FileUtils;
import org.apache.dolphinscheduler.common.utils.StringUtils;
import org.apache.dolphinscheduler.common.utils.TaskParametersUtils;
import org.apache.dolphinscheduler.common.utils.*;
import org.apache.dolphinscheduler.dao.entity.*;
import org.apache.dolphinscheduler.server.builder.TaskExecutionContextBuilder;
import org.apache.dolphinscheduler.server.entity.*;
@ -299,6 +296,10 @@ public class TaskPriorityQueueConsumer extends Thread{
}
}
if (CollectionUtils.isEmpty(resourceIdsSet)){
return null;
}
Integer[] resourceIds = resourceIdsSet.toArray(new Integer[resourceIdsSet.size()]);
List<Resource> resources = processService.listResourceByIds(resourceIds);

View File

@ -202,26 +202,6 @@ public class TaskExecuteThread implements Runnable {
}
/**
* create project resource files
*/
private List<String> createProjectResFiles(TaskNode taskNode) throws Exception{
Set<String> projectFiles = new HashSet<>();
AbstractParameters baseParam = TaskParametersUtils.getParameters(taskNode.getType(), taskNode.getParams());
if (baseParam != null) {
List<ResourceInfo> projectResourceFiles = baseParam.getResourceFilesList();
if (projectResourceFiles != null) {
Stream<String> resourceInfotream = projectResourceFiles.stream().map(resourceInfo -> resourceInfo.getRes());
projectFiles.addAll(resourceInfotream.collect(Collectors.toList()));
}
}
return new ArrayList<>(projectFiles);
}
/**
* download resource file
*