status
stringclasses
1 value
repo_name
stringclasses
31 values
repo_url
stringclasses
31 values
issue_id
int64
1
104k
title
stringlengths
4
233
body
stringlengths
0
186k
issue_url
stringlengths
38
56
pull_url
stringlengths
37
54
before_fix_sha
stringlengths
40
40
after_fix_sha
stringlengths
40
40
report_datetime
timestamp[us, tz=UTC]
language
stringclasses
5 values
commit_datetime
timestamp[us, tz=UTC]
updated_file
stringlengths
7
188
chunk_content
stringlengths
1
1.03M
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
upstreamTaskDefinitionList.stream().map(TaskDefinition::getCode).collect(Collectors.toSet()); Set<Long> diffCode = upstreamTaskCodes.stream().filter(code -> !queryUpStreamTaskCodes.contains(code)) .collect(Collectors.toSet()); if (CollectionUtils.isNotEmpty(diffCode)) { String taskCodes = StringUtils.join(diffCode, Constants.COMMA); logger.error("Some task definitions with parameter upstreamCodes do not exist, taskDefinitionCodes:{}.", taskCodes); putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskCodes); return result; } for (TaskDefinition upstreamTask : upstreamTaskDefinitionList) { ProcessTaskRelationLog processTaskRelationLog = new ProcessTaskRelationLog(); processTaskRelationLog.setPreTaskCode(upstreamTask.getCode()); processTaskRelationLog.setPreTaskVersion(upstreamTask.getVersion()); processTaskRelationLog.setPostTaskCode(taskCode); processTaskRelationLog.setPostTaskVersion(Constants.VERSION_FIRST); processTaskRelationLog.setConditionType(ConditionType.NONE); processTaskRelationLog.setConditionParams("{}"); processTaskRelationLogList.add(processTaskRelationLog); } } else { ProcessTaskRelationLog processTaskRelationLog = new ProcessTaskRelationLog(); processTaskRelationLog.setPreTaskCode(0); processTaskRelationLog.setPreTaskVersion(0); processTaskRelationLog.setPostTaskCode(taskCode); processTaskRelationLog.setPostTaskVersion(Constants.VERSION_FIRST); processTaskRelationLog.setConditionType(ConditionType.NONE); processTaskRelationLog.setConditionParams("{}"); processTaskRelationLogList.add(processTaskRelationLog);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
} int insertResult = processService.saveTaskRelation(loginUser, projectCode, processDefinition.getCode(), processDefinition.getVersion(), processTaskRelationLogList, Lists.newArrayList(), Boolean.TRUE); if (insertResult != Constants.EXIT_CODE_SUCCESS) { logger.error( "Save new version process task relations error, processDefinitionCode:{}, processDefinitionVersion:{}.", processDefinition.getCode(), processDefinition.getVersion()); putMsg(result, Status.CREATE_PROCESS_TASK_RELATION_ERROR); throw new ServiceException(Status.CREATE_PROCESS_TASK_RELATION_ERROR); } else logger.info( "Save new version process task relations complete, processDefinitionCode:{}, processDefinitionVersion:{}.", processDefinition.getCode(), processDefinition.getVersion()); int saveTaskResult = processService.saveTaskDefine(loginUser, projectCode, Lists.newArrayList(taskDefinition), Boolean.TRUE); if (saveTaskResult == Constants.DEFINITION_FAILURE) { logger.error("Save task definition error, projectCode:{}, taskDefinitionCode:{}.", projectCode, taskDefinition.getCode()); putMsg(result, Status.CREATE_TASK_DEFINITION_ERROR); throw new ServiceException(Status.CREATE_TASK_DEFINITION_ERROR); } else logger.info("Save task definition complete, projectCode:{}, taskDefinitionCode:{}.", projectCode, taskDefinition.getCode()); putMsg(result, Status.SUCCESS); result.put(Constants.DATA_LIST, taskDefinition); return result; } /** * query task definition
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
* * @param loginUser login user * @param projectCode project code * @param processCode process code * @param taskName task name */ @Override public Map<String, Object> queryTaskDefinitionByName(User loginUser, long projectCode, long processCode, String taskName) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode, TASK_DEFINITION); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } TaskDefinition taskDefinition = taskDefinitionMapper.queryByName(project.getCode(), processCode, taskName); if (taskDefinition == null) { logger.error("Task definition does not exist, taskName:{}.", taskName); putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskName); } else { result.put(Constants.DATA_LIST, taskDefinition); putMsg(result, Status.SUCCESS); } return result; } /** * Whether task definition can be deleted or not */ private void taskCanDeleteValid(User user, TaskDefinition taskDefinition, User loginUser) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
Project project = projectMapper.queryByCode(taskDefinition.getProjectCode()); projectService.checkProjectAndAuthThrowException(user, project, TASK_DEFINITION_DELETE); Map<String, Object> result = new HashMap<>(); boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result); if (!hasProjectAndWritePerm) { throw new ServiceException(Status.TASK_DEFINE_STATE_ONLINE, taskDefinition.getCode()); } if (processService.isTaskOnline(taskDefinition.getCode()) && taskDefinition.getFlag() == Flag.YES) { throw new ServiceException(Status.TASK_DEFINE_STATE_ONLINE, taskDefinition.getCode()); } List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryDownstreamByTaskCode(taskDefinition.getCode()); if (CollectionUtils.isNotEmpty(processTaskRelationList)) { Set<Long> postTaskCodes = processTaskRelationList .stream() .map(ProcessTaskRelation::getPostTaskCode) .collect(Collectors.toSet()); String postTaskCodesStr = StringUtils.join(postTaskCodes, Constants.COMMA); throw new ServiceException(Status.TASK_HAS_DOWNSTREAM, postTaskCodesStr); } } /** * Delete resource task definition by code * * Only task release state offline and no downstream tasks can be deleted, will also remove the exists * task relation [upstreamTaskCode, taskCode]
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
* * @param loginUser login user * @param taskCode task code */ @Transactional @Override public void deleteTaskDefinitionByCode(User loginUser, long taskCode) { TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode); if (taskDefinition == null) { throw new ServiceException(Status.TASK_DEFINE_NOT_EXIST, taskCode); } this.taskCanDeleteValid(loginUser, taskDefinition, loginUser); int delete = taskDefinitionMapper.deleteByCode(taskCode); if (delete <= 0) { throw new ServiceException(Status.DELETE_TASK_DEFINE_BY_CODE_MSG_ERROR, taskDefinition.getCode()); } List<ProcessTaskRelation> taskRelationList = processTaskRelationMapper.queryUpstreamByCode(taskDefinition.getProjectCode(), taskCode); if (CollectionUtils.isNotEmpty(taskRelationList)) { logger.debug( "Task definition has upstream tasks, start handle them after delete task, taskDefinitionCode:{}.", taskCode); long processDefinitionCode = taskRelationList.get(0).getProcessDefinitionCode(); List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper .queryByProcessCode(taskDefinition.getProjectCode(), processDefinitionCode); List<ProcessTaskRelation> relationList = processTaskRelations.stream() .filter(r -> r.getPostTaskCode() != taskCode).collect(Collectors.toList()); updateDag(loginUser, processDefinitionCode, relationList, Lists.newArrayList()); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
} private void updateDag(User loginUser, long processDefinitionCode, List<ProcessTaskRelation> processTaskRelationList, List<TaskDefinitionLog> taskDefinitionLogs) { ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefinitionCode); if (processDefinition == null) { logger.error("Process definition does not exist, processDefinitionCode:{}.", processDefinitionCode); throw new ServiceException(Status.PROCESS_DEFINE_NOT_EXIST); } int insertVersion = processService.saveProcessDefine(loginUser, processDefinition, Boolean.TRUE, Boolean.TRUE); if (insertVersion <= 0) { logger.error("Update process definition error, projectCode:{}, processDefinitionCode:{}.", processDefinition.getProjectCode(), processDefinitionCode); throw new ServiceException(Status.UPDATE_PROCESS_DEFINITION_ERROR); } else logger.info( "Save new version process definition complete, projectCode:{}, processDefinitionCode:{}, newVersion:{}.", processDefinition.getProjectCode(), processDefinitionCode, insertVersion); List<ProcessTaskRelationLog> relationLogs = processTaskRelationList.stream().map(ProcessTaskRelationLog::new).collect(Collectors.toList()); int insertResult = processService.saveTaskRelation(loginUser, processDefinition.getProjectCode(), processDefinition.getCode(), insertVersion, relationLogs, taskDefinitionLogs, Boolean.TRUE); if (insertResult == Constants.EXIT_CODE_SUCCESS) { logger.info( "Save new version task relations complete, projectCode:{}, processDefinitionCode:{}, newVersion:{}.", processDefinition.getProjectCode(), processDefinitionCode, insertVersion); } else { logger.error("Update task relations error, projectCode:{}, processDefinitionCode:{}.", processDefinition.getProjectCode(), processDefinitionCode);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
throw new ServiceException(Status.UPDATE_PROCESS_DEFINITION_ERROR); } } /** * update task definition * * @param loginUser login user * @param projectCode project code * @param taskCode task code * @param taskDefinitionJsonObj task definition json object */ @Transactional @Override public Map<String, Object> updateTaskDefinition(User loginUser, long projectCode, long taskCode, String taskDefinitionJsonObj) { Map<String, Object> result = new HashMap<>(); TaskDefinitionLog taskDefinitionToUpdate = updateTask(loginUser, projectCode, taskCode, taskDefinitionJsonObj, result); if (taskDefinitionToUpdate == null) { return result; } List<ProcessTaskRelation> taskRelationList = processTaskRelationMapper.queryUpstreamByCode(projectCode, taskCode); if (CollectionUtils.isNotEmpty(taskRelationList)) { logger.info( "Task definition has upstream tasks, start handle them after update task, taskDefinitionCode:{}.", taskCode); long processDefinitionCode = taskRelationList.get(0).getProcessDefinitionCode(); List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
updateDag(loginUser, processDefinitionCode, processTaskRelations, Lists.newArrayList(taskDefinitionToUpdate)); } logger.info("Update task definition complete, projectCode:{}, taskDefinitionCode:{}.", projectCode, taskCode); result.put(Constants.DATA_LIST, taskCode); putMsg(result, Status.SUCCESS); return result; } private void TaskDefinitionUpdateValid(TaskDefinition taskDefinitionOriginal, TaskDefinition taskDefinitionUpdate) { if (processService.isTaskOnline(taskDefinitionOriginal.getCode()) && taskDefinitionOriginal.getFlag() == Flag.YES) { if (taskDefinitionOriginal.getTaskExecuteType() != TaskExecuteType.STREAM) { throw new ServiceException(Status.NOT_SUPPORT_UPDATE_TASK_DEFINITION); } } if (taskDefinitionOriginal.equals(taskDefinitionUpdate)) { throw new ServiceException(Status.TASK_DEFINITION_NOT_CHANGE, taskDefinitionOriginal.getCode()); } Integer version = taskDefinitionLogMapper.queryMaxVersionForDefinition(taskDefinitionOriginal.getCode()); if (version == null || version == 0) { throw new ServiceException(Status.DATA_IS_NOT_VALID, taskDefinitionOriginal.getCode()); } } /** * update task definition *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
* @param loginUser login user * @param taskCode task code * @param taskUpdateRequest task definition json object * @return new TaskDefinition have updated */ @Transactional @Override public TaskDefinition updateTaskDefinitionV2(User loginUser, long taskCode, TaskUpdateRequest taskUpdateRequest) { TaskDefinition taskDefinitionOriginal = taskDefinitionMapper.queryByCode(taskCode); if (taskDefinitionOriginal == null) { throw new ServiceException(Status.TASK_DEFINITION_NOT_EXISTS, taskCode); } TaskDefinition taskDefinitionUpdate; try { taskDefinitionUpdate = taskUpdateRequest.mergeIntoTaskDefinition(taskDefinitionOriginal); } catch (InvocationTargetException | IllegalAccessException | InstantiationException | NoSuchMethodException e) { throw new ServiceException(Status.REQUEST_PARAMS_NOT_VALID_ERROR, taskUpdateRequest.toString()); } this.checkTaskDefinitionValid(loginUser, taskDefinitionUpdate, TASK_DEFINITION_UPDATE); this.TaskDefinitionUpdateValid(taskDefinitionOriginal, taskDefinitionUpdate); int update = taskDefinitionMapper.updateById(taskDefinitionUpdate); if (update <= 0) { throw new ServiceException(Status.UPDATE_TASK_DEFINITION_ERROR); } TaskDefinitionLog taskDefinitionLog = this.persist2TaskDefinitionLog(loginUser, taskDefinitionUpdate); List<ProcessTaskRelation> taskRelationList = processTaskRelationMapper.queryUpstreamByCode(taskDefinitionUpdate.getProjectCode(), taskCode);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
if (CollectionUtils.isNotEmpty(taskRelationList)) { logger.info( "Task definition has upstream tasks, start handle them after update task, taskDefinitionCode:{}.", taskCode); long processDefinitionCode = taskRelationList.get(0).getProcessDefinitionCode(); List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper .queryByProcessCode(taskDefinitionUpdate.getProjectCode(), processDefinitionCode); updateDag(loginUser, processDefinitionCode, processTaskRelations, Lists.newArrayList(taskDefinitionLog)); } this.updateTaskUpstreams(loginUser, taskUpdateRequest.getWorkflowCode(), taskDefinitionUpdate.getCode(), taskUpdateRequest.getUpstreamTasksCodes()); return taskDefinitionUpdate; } /** * Get resource task definition by code * * @param loginUser login user * @param taskCode task code * @return TaskDefinition */ @Override public TaskDefinition getTaskDefinition(User loginUser, long taskCode) { TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode); if (taskDefinition == null) { throw new ServiceException(Status.TASK_DEFINE_NOT_EXIST, taskCode); } Project project = projectMapper.queryByCode(taskDefinition.getProjectCode()); projectService.checkProjectAndAuthThrowException(loginUser, project, TASK_DEFINITION); return taskDefinition;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
} /** * Get resource task definition according to query parameter * * @param loginUser login user * @param taskFilterRequest taskFilterRequest object you want to filter the resource task definitions * @return TaskDefinitions of page */ @Override public PageInfo<TaskDefinition> filterTaskDefinition(User loginUser, TaskFilterRequest taskFilterRequest) { TaskDefinition taskDefinition = taskFilterRequest.convert2TaskDefinition(); if (taskDefinition.getProjectName() != null) { Project project = projectMapper.queryByName(taskDefinition.getProjectName()); projectService.checkProjectAndAuthThrowException(loginUser, project, WORKFLOW_DEFINITION); taskDefinition.setProjectCode(project.getCode()); } Page<TaskDefinition> page = new Page<>(taskFilterRequest.getPageNo(), taskFilterRequest.getPageSize()); IPage<TaskDefinition> taskDefinitionIPage = taskDefinitionMapper.filterTaskDefinition(page, taskDefinition); PageInfo<TaskDefinition> pageInfo = new PageInfo<>(taskFilterRequest.getPageNo(), taskFilterRequest.getPageSize()); pageInfo.setTotal((int) taskDefinitionIPage.getTotal()); pageInfo.setTotalList(taskDefinitionIPage.getRecords()); return pageInfo; } private TaskDefinitionLog updateTask(User loginUser, long projectCode, long taskCode, String taskDefinitionJsonObj, Map<String, Object> result) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
Project project = projectMapper.queryByCode(projectCode); boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result); if (!hasProjectAndWritePerm) { return null; } TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode); if (taskDefinition == null) { logger.error("Task definition does not exist, taskDefinitionCode:{}.", taskCode); putMsg(result, Status.TASK_DEFINE_NOT_EXIST, String.valueOf(taskCode)); return null; } if (processService.isTaskOnline(taskCode) && taskDefinition.getFlag() == Flag.YES) { if (taskDefinition.getTaskExecuteType() != TaskExecuteType.STREAM) { logger.warn("Only {} type task can be updated without online check, taskDefinitionCode:{}.", TaskExecuteType.STREAM, taskCode); putMsg(result, Status.NOT_SUPPORT_UPDATE_TASK_DEFINITION); return null; } } TaskDefinitionLog taskDefinitionToUpdate = JSONUtils.parseObject(taskDefinitionJsonObj, TaskDefinitionLog.class); if (TimeoutFlag.CLOSE == taskDefinition.getTimeoutFlag()) { taskDefinition.setTimeoutNotifyStrategy(null); } if (taskDefinition.equals(taskDefinitionToUpdate)) { logger.warn("Task definition does not need update because no change, taskDefinitionCode:{}.", taskCode); putMsg(result, Status.TASK_DEFINITION_NOT_MODIFY_ERROR, String.valueOf(taskCode)); return null;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
} if (taskDefinitionToUpdate == null) { logger.warn("Parameter taskDefinitionJson is invalid."); putMsg(result, Status.DATA_IS_NOT_VALID, taskDefinitionJsonObj); return null; } if (!taskPluginManager.checkTaskParameters(ParametersNode.builder() .taskType(taskDefinitionToUpdate.getTaskType()) .taskParams(taskDefinitionToUpdate.getTaskParams()) .dependence(taskDefinitionToUpdate.getDependence()) .build())) { logger.warn("Task definition parameters are invalid, taskDefinitionName:{}.", taskDefinitionToUpdate.getName()); putMsg(result, Status.PROCESS_NODE_S_PARAMETER_INVALID, taskDefinitionToUpdate.getName()); return null; } Integer version = taskDefinitionLogMapper.queryMaxVersionForDefinition(taskCode); if (version == null || version == 0) { logger.error("Max version task definitionLog can not be found in database, taskDefinitionCode:{}.", taskCode); putMsg(result, Status.DATA_IS_NOT_VALID, taskCode); return null; } Date now = new Date(); taskDefinitionToUpdate.setCode(taskCode); taskDefinitionToUpdate.setId(taskDefinition.getId()); taskDefinitionToUpdate.setProjectCode(projectCode); taskDefinitionToUpdate.setUserId(taskDefinition.getUserId()); taskDefinitionToUpdate.setVersion(++version); taskDefinitionToUpdate.setTaskType(taskDefinitionToUpdate.getTaskType().toUpperCase());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
taskDefinitionToUpdate.setResourceIds(processService.getResourceIds(taskDefinitionToUpdate)); taskDefinitionToUpdate.setUpdateTime(now); int update = taskDefinitionMapper.updateById(taskDefinitionToUpdate); taskDefinitionToUpdate.setOperator(loginUser.getId()); taskDefinitionToUpdate.setOperateTime(now); taskDefinitionToUpdate.setCreateTime(now); taskDefinitionToUpdate.setId(null); int insert = taskDefinitionLogMapper.insert(taskDefinitionToUpdate); if ((update & insert) != 1) { logger.error("Update task definition or definitionLog error, projectCode:{}, taskDefinitionCode:{}.", projectCode, taskCode); putMsg(result, Status.UPDATE_TASK_DEFINITION_ERROR); throw new ServiceException(Status.UPDATE_TASK_DEFINITION_ERROR); } else logger.info( "Update task definition and definitionLog complete, projectCode:{}, taskDefinitionCode:{}, newTaskVersion:{}.", projectCode, taskCode, taskDefinitionToUpdate.getVersion()); List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper .queryByTaskCode(taskDefinitionToUpdate.getCode()); if (CollectionUtils.isNotEmpty(processTaskRelations)) { for (ProcessTaskRelation processTaskRelation : processTaskRelations) { if (taskCode == processTaskRelation.getPreTaskCode()) { processTaskRelation.setPreTaskVersion(version); } else if (taskCode == processTaskRelation.getPostTaskCode()) { processTaskRelation.setPostTaskVersion(version); } int count = processTaskRelationMapper.updateProcessTaskRelationTaskVersion(processTaskRelation); if (count != 1) { logger.error("batch update process task relation error, projectCode:{}, taskDefinitionCode:{}.",
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
projectCode, taskCode); putMsg(result, Status.PROCESS_TASK_RELATION_BATCH_UPDATE_ERROR); throw new ServiceException(Status.PROCESS_TASK_RELATION_BATCH_UPDATE_ERROR); } } } return taskDefinitionToUpdate; } /** * update task definition and upstream * * @param loginUser login user * @param projectCode project code * @param taskCode task definition code * @param taskDefinitionJsonObj task definition json object * @param upstreamCodes upstream task codes, sep comma * @return update result code */ @Override public Map<String, Object> updateTaskWithUpstream(User loginUser, long projectCode, long taskCode, String taskDefinitionJsonObj, String upstreamCodes) { Map<String, Object> result = new HashMap<>(); TaskDefinitionLog taskDefinitionToUpdate = updateTask(loginUser, projectCode, taskCode, taskDefinitionJsonObj, result); if (result.get(Constants.STATUS) != Status.SUCCESS && taskDefinitionToUpdate == null) { return result; } List<ProcessTaskRelation> upstreamTaskRelations = processTaskRelationMapper.queryUpstreamByCode(projectCode, taskCode); Set<Long> upstreamCodeSet =
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
upstreamTaskRelations.stream().map(ProcessTaskRelation::getPreTaskCode).collect(Collectors.toSet()); Set<Long> upstreamTaskCodes = Collections.emptySet(); if (StringUtils.isNotEmpty(upstreamCodes)) { upstreamTaskCodes = Arrays.stream(upstreamCodes.split(Constants.COMMA)).map(Long::parseLong) .collect(Collectors.toSet()); } if (CollectionUtils.isEqualCollection(upstreamCodeSet, upstreamTaskCodes) && taskDefinitionToUpdate == null) { putMsg(result, Status.SUCCESS); return result; } else { if (taskDefinitionToUpdate == null) { taskDefinitionToUpdate = JSONUtils.parseObject(taskDefinitionJsonObj, TaskDefinitionLog.class); } } Map<Long, TaskDefinition> queryUpStreamTaskCodeMap; if (CollectionUtils.isNotEmpty(upstreamTaskCodes)) { List<TaskDefinition> upstreamTaskDefinitionList = taskDefinitionMapper.queryByCodeList(upstreamTaskCodes); queryUpStreamTaskCodeMap = upstreamTaskDefinitionList.stream() .collect(Collectors.toMap(TaskDefinition::getCode, taskDefinition -> taskDefinition)); upstreamTaskCodes.removeAll(queryUpStreamTaskCodeMap.keySet()); if (CollectionUtils.isNotEmpty(upstreamTaskCodes)) { String notExistTaskCodes = StringUtils.join(upstreamTaskCodes, Constants.COMMA); logger.error("Some task definitions in parameter upstreamTaskCodes do not exist, notExistTaskCodes:{}.", notExistTaskCodes); putMsg(result, Status.TASK_DEFINE_NOT_EXIST, notExistTaskCodes); return result; } } else { queryUpStreamTaskCodeMap = new HashMap<>();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
} if (CollectionUtils.isNotEmpty(upstreamTaskCodes)) { ProcessTaskRelation taskRelation = upstreamTaskRelations.get(0); List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, taskRelation.getProcessDefinitionCode()); List<ProcessTaskRelation> processTaskRelationList = Lists.newArrayList(processTaskRelations); List<ProcessTaskRelation> relationList = Lists.newArrayList(); for (ProcessTaskRelation processTaskRelation : processTaskRelationList) { if (processTaskRelation.getPostTaskCode() == taskCode) { if (queryUpStreamTaskCodeMap.containsKey(processTaskRelation.getPreTaskCode()) && processTaskRelation.getPreTaskCode() != 0L) { queryUpStreamTaskCodeMap.remove(processTaskRelation.getPreTaskCode()); } else { processTaskRelation.setPreTaskCode(0L); processTaskRelation.setPreTaskVersion(0); relationList.add(processTaskRelation); } } } processTaskRelationList.removeAll(relationList); for (Map.Entry<Long, TaskDefinition> queryUpStreamTask : queryUpStreamTaskCodeMap.entrySet()) { taskRelation.setPreTaskCode(queryUpStreamTask.getKey()); taskRelation.setPreTaskVersion(queryUpStreamTask.getValue().getVersion()); processTaskRelationList.add(taskRelation); } if (MapUtils.isEmpty(queryUpStreamTaskCodeMap) && CollectionUtils.isNotEmpty(processTaskRelationList)) { processTaskRelationList.add(processTaskRelationList.get(0)); } updateDag(loginUser, taskRelation.getProcessDefinitionCode(), processTaskRelations, Lists.newArrayList(taskDefinitionToUpdate));
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
} logger.info( "Update task with upstream tasks complete, projectCode:{}, taskDefinitionCode:{}, upstreamTaskCodes:{}.", projectCode, taskCode, upstreamTaskCodes); result.put(Constants.DATA_LIST, taskCode); putMsg(result, Status.SUCCESS); return result; } /** * switch task definition * * @param loginUser login user * @param projectCode project code * @param taskCode task code * @param version the version user want to switch */ @Transactional @Override public Map<String, Object> switchVersion(User loginUser, long projectCode, long taskCode, int version) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode, WORKFLOW_SWITCH_TO_THIS_VERSION); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } if (processService.isTaskOnline(taskCode)) { logger.warn( "Task definition version can not be switched due to process definition is {}, taskDefinitionCode:{}.", ReleaseState.ONLINE.getDescp(), taskCode);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
putMsg(result, Status.PROCESS_DEFINE_STATE_ONLINE); return result; } TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode); if (taskDefinition == null || projectCode != taskDefinition.getProjectCode()) { logger.error("Task definition does not exist, taskDefinitionCode:{}.", taskCode); putMsg(result, Status.TASK_DEFINE_NOT_EXIST, String.valueOf(taskCode)); return result; } TaskDefinitionLog taskDefinitionUpdate = taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(taskCode, version); taskDefinitionUpdate.setUserId(loginUser.getId()); taskDefinitionUpdate.setUpdateTime(new Date()); taskDefinitionUpdate.setId(taskDefinition.getId()); int switchVersion = taskDefinitionMapper.updateById(taskDefinitionUpdate); if (switchVersion > 0) { List<ProcessTaskRelation> taskRelationList = processTaskRelationMapper.queryUpstreamByCode(projectCode, taskCode); if (CollectionUtils.isNotEmpty(taskRelationList)) { logger.info( "Task definition has upstream tasks, start handle them after switch task, taskDefinitionCode:{}.", taskCode); long processDefinitionCode = taskRelationList.get(0).getProcessDefinitionCode(); List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); updateDag(loginUser, processDefinitionCode, processTaskRelations, Lists.newArrayList(taskDefinitionUpdate)); } else { logger.info( "Task definition version switch complete, switch task version to {}, taskDefinitionCode:{}.",
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
version, taskCode); putMsg(result, Status.SUCCESS); } } else { logger.error("Task definition version switch error, taskDefinitionCode:{}.", taskCode); putMsg(result, Status.SWITCH_TASK_DEFINITION_VERSION_ERROR); } return result; } @Override public Result queryTaskDefinitionVersions(User loginUser, long projectCode, long taskCode, int pageNo, int pageSize) { Result result = new Result(); Project project = projectMapper.queryByCode(projectCode); Map<String, Object> checkResult = projectService.checkProjectAndAuth(loginUser, project, projectCode, TASK_VERSION_VIEW); Status resultStatus = (Status) checkResult.get(Constants.STATUS); if (resultStatus != Status.SUCCESS) { putMsg(result, resultStatus); return result; } PageInfo<TaskDefinitionLog> pageInfo = new PageInfo<>(pageNo, pageSize); Page<TaskDefinitionLog> page = new Page<>(pageNo, pageSize); IPage<TaskDefinitionLog> taskDefinitionVersionsPaging = taskDefinitionLogMapper.queryTaskDefinitionVersionsPaging(page, taskCode, projectCode); List<TaskDefinitionLog> taskDefinitionLogs = taskDefinitionVersionsPaging.getRecords();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
pageInfo.setTotalList(taskDefinitionLogs); pageInfo.setTotal((int) taskDefinitionVersionsPaging.getTotal()); result.setData(pageInfo); putMsg(result, Status.SUCCESS); return result; } @Override public Map<String, Object> deleteByCodeAndVersion(User loginUser, long projectCode, long taskCode, int version) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode, TASK_DEFINITION_DELETE); boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result); if (!hasProjectAndWritePerm) { return result; } TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode); if (taskDefinition == null) { logger.error("Task definition does not exist, taskDefinitionCode:{}.", taskCode); putMsg(result, Status.TASK_DEFINE_NOT_EXIST, String.valueOf(taskCode)); } else { if (taskDefinition.getVersion() == version) { logger.warn( "Task definition can not be deleted due to version is being used, projectCode:{}, taskDefinitionCode:{}, version:{}.", projectCode, taskCode, version); putMsg(result, Status.MAIN_TABLE_USING_VERSION); return result; } int delete = taskDefinitionLogMapper.deleteByCodeAndVersion(taskCode, version); if (delete > 0) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
logger.info( "Task definition version delete complete, projectCode:{}, taskDefinitionCode:{}, version:{}.", projectCode, taskCode, version); putMsg(result, Status.SUCCESS); } else { logger.error("Task definition version delete error, projectCode:{}, taskDefinitionCode:{}, version:{}.", projectCode, taskCode, version); putMsg(result, Status.DELETE_TASK_DEFINITION_VERSION_ERROR); } } return result; } @Override public Map<String, Object> queryTaskDefinitionDetail(User loginUser, long projectCode, long taskCode) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode, TASK_DEFINITION); if (result.get(Constants.STATUS) != Status.SUCCESS) { return result; } TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode); if (taskDefinition == null || projectCode != taskDefinition.getProjectCode()) { logger.error("Task definition does not exist, taskDefinitionCode:{}.", taskCode); putMsg(result, Status.TASK_DEFINE_NOT_EXIST, String.valueOf(taskCode)); } else { List<ProcessTaskRelation> taskRelationList = processTaskRelationMapper .queryByCode(projectCode, 0, 0, taskCode); if (CollectionUtils.isNotEmpty(taskRelationList)) { taskRelationList = taskRelationList.stream()
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
.filter(v -> v.getPreTaskCode() != 0).collect(Collectors.toList()); } TaskDefinitionVo taskDefinitionVo = TaskDefinitionVo.fromTaskDefinition(taskDefinition); taskDefinitionVo.setProcessTaskRelationList(taskRelationList); result.put(Constants.DATA_LIST, taskDefinitionVo); putMsg(result, Status.SUCCESS); } return result; } @Override public Result queryTaskDefinitionListPaging(User loginUser, long projectCode, String searchTaskName, String taskType, TaskExecuteType taskExecuteType, Integer pageNo, Integer pageSize) { Result result = new Result(); Project project = projectMapper.queryByCode(projectCode); Map<String, Object> checkResult = projectService.checkProjectAndAuth(loginUser, project, projectCode, TASK_DEFINITION); Status resultStatus = (Status) checkResult.get(Constants.STATUS); if (resultStatus != Status.SUCCESS) { putMsg(result, resultStatus); return result; } taskType = taskType == null ? StringUtils.EMPTY : taskType; Page<TaskMainInfo> page = new Page<>(pageNo, pageSize);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
IPage<TaskMainInfo> taskMainInfoIPage = taskDefinitionMapper.queryDefineListPaging(page, projectCode, searchTaskName, taskType, taskExecuteType); fillRecords(projectCode, taskMainInfoIPage); PageInfo<TaskMainInfo> pageInfo = new PageInfo<>(pageNo, pageSize); pageInfo.setTotal((int) taskMainInfoIPage.getTotal()); pageInfo.setTotalList(taskMainInfoIPage.getRecords()); result.setData(pageInfo); putMsg(result, Status.SUCCESS); return result; } private void fillRecords(long projectCode, IPage<TaskMainInfo> taskMainInfoIPage) { List<TaskMainInfo> records = Collections.emptyList(); if (CollectionUtils.isNotEmpty(taskMainInfoIPage.getRecords())) { records = taskDefinitionMapper.queryDefineListByCodeList(projectCode, taskMainInfoIPage.getRecords().stream().map(TaskMainInfo::getTaskCode) .collect(Collectors.toList())); } taskMainInfoIPage.setRecords(Collections.emptyList()); if (CollectionUtils.isNotEmpty(records)) { Map<Long, TaskMainInfo> taskMainInfoMap = new HashMap<>(); for (TaskMainInfo info : records) { taskMainInfoMap.compute(info.getTaskCode(), (k, v) -> { if (v == null) { Map<Long, String> upstreamTaskMap = new HashMap<>(); if (info.getUpstreamTaskCode() != 0) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
upstreamTaskMap.put(info.getUpstreamTaskCode(), info.getUpstreamTaskName()); info.setUpstreamTaskCode(0L); info.setUpstreamTaskName(StringUtils.EMPTY); } info.setUpstreamTaskMap(upstreamTaskMap); v = info; } if (info.getUpstreamTaskCode() != 0) { v.getUpstreamTaskMap().put(info.getUpstreamTaskCode(), info.getUpstreamTaskName()); } return v; }); } taskMainInfoIPage.setRecords(Lists.newArrayList(taskMainInfoMap.values())); } } private void fillWorkflowInfo(long projectCode, IPage<TaskMainInfo> taskMainInfoIPage) { } @Override public Map<String, Object> genTaskCodeList(Integer genNum) { Map<String, Object> result = new HashMap<>(); if (genNum == null || genNum < 1 || genNum > 100) { logger.warn("Parameter genNum must be great than 1 and less than 100."); putMsg(result, Status.DATA_IS_NOT_VALID, genNum); return result; } List<Long> taskCodes = new ArrayList<>(); try {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
for (int i = 0; i < genNum; i++) { taskCodes.add(CodeGenerateUtils.getInstance().genCode()); } } catch (CodeGenerateException e) { logger.error("Generate task definition code error.", e); putMsg(result, Status.INTERNAL_SERVER_ERROR_ARGS, "Error generating task definition code"); } putMsg(result, Status.SUCCESS); result.put(Constants.DATA_LIST, taskCodes); return result; } /** * release task definition * * @param loginUser login user * @param projectCode project code * @param code task definition code * @param releaseState releaseState * @return update result code */ @Transactional @Override public Map<String, Object> releaseTaskDefinition(User loginUser, long projectCode, long code, ReleaseState releaseState) { Project project = projectMapper.queryByCode(projectCode); Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode, null); Status resultStatus = (Status) result.get(Constants.STATUS); if (resultStatus != Status.SUCCESS) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
return result; } if (null == releaseState) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, RELEASESTATE); return result; } TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(code); if (taskDefinition == null || projectCode != taskDefinition.getProjectCode()) { putMsg(result, Status.TASK_DEFINE_NOT_EXIST, String.valueOf(code)); return result; } TaskDefinitionLog taskDefinitionLog = taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(code, taskDefinition.getVersion()); if (taskDefinitionLog == null) { logger.error("Task definition does not exist, taskDefinitionCode:{}.", code); putMsg(result, Status.TASK_DEFINE_NOT_EXIST, String.valueOf(code)); return result; } switch (releaseState) { case OFFLINE: taskDefinition.setFlag(Flag.NO); taskDefinitionLog.setFlag(Flag.NO); break; case ONLINE: String resourceIds = taskDefinition.getResourceIds(); if (StringUtils.isNotBlank(resourceIds)) { Integer[] resourceIdArray = Arrays.stream(resourceIds.split(",")).map(Integer::parseInt).toArray(Integer[]::new); PermissionCheck<Integer> permissionCheck = new PermissionCheck(AuthorizationType.RESOURCE_FILE_ID, processService, resourceIdArray, loginUser.getId(), logger);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
12,621
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened List task defination and sorted by update time not effect ### What you expected to happen List task defination and sorted by update time ### How to reproduce List task defination and look ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/12621
https://github.com/apache/dolphinscheduler/pull/12622
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
2022-10-31T08:44:47Z
java
2022-12-13T08:35:54Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
try { permissionCheck.checkPermission(); } catch (Exception e) { logger.error("Resources permission check error, resourceIds:{}.", resourceIds, e); putMsg(result, Status.RESOURCE_NOT_EXIST_OR_NO_PERMISSION); return result; } } taskDefinition.setFlag(Flag.YES); taskDefinitionLog.setFlag(Flag.YES); break; default: logger.warn("Parameter releaseState is invalid."); putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, RELEASESTATE); return result; } int update = taskDefinitionMapper.updateById(taskDefinition); int updateLog = taskDefinitionLogMapper.updateById(taskDefinitionLog); if ((update == 0 && updateLog == 1) || (update == 1 && updateLog == 0)) { logger.error("Update taskDefinition state or taskDefinitionLog state error, taskDefinitionCode:{}.", code); putMsg(result, Status.UPDATE_TASK_DEFINITION_ERROR); throw new ServiceException(Status.UPDATE_TASK_DEFINITION_ERROR); } logger.error("Update taskDefinition state or taskDefinitionLog state to complete, taskDefinitionCode:{}.", code); putMsg(result, Status.SUCCESS); return result; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,187
[Bug] [Task] OpenMLDB Task can't work
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened The OpenmldbTask will be failed, throw null exception in any situation. ### What you expected to happen OpenmldbTask extends PythonTask, add a new parameter var `openmldbParameters`, and doesn't init the member `pythonParameters`, but after 6e224d0 PythonTask will use `pythonParameter` in `handle()`. So it'll throw the null exception. We should make `OpenmldbParameters` extends `PythonParameters`, to avoid breaking changes in `PythonTask`. ### How to reproduce Add a openmldb task and run ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13187
https://github.com/apache/dolphinscheduler/pull/13190
84b5d810425f7bb23cc5a179d3dedeb295daa06d
43e6ac32ddc468c57633162a5cd442a70f418c18
2022-12-14T07:06:46Z
java
2022-12-14T12:13:45Z
dolphinscheduler-task-plugin/dolphinscheduler-task-openmldb/src/main/java/org/apache/dolphinscheduler/plugin/task/openmldb/OpenmldbParameters.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.plugin.task.openmldb; import org.apache.dolphinscheduler.plugin.task.api.model.ResourceInfo; import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters; import org.apache.commons.lang3.StringUtils; import java.util.List; public class OpenmldbParameters extends AbstractParameters {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,187
[Bug] [Task] OpenMLDB Task can't work
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened The OpenmldbTask will be failed, throw null exception in any situation. ### What you expected to happen OpenmldbTask extends PythonTask, add a new parameter var `openmldbParameters`, and doesn't init the member `pythonParameters`, but after 6e224d0 PythonTask will use `pythonParameter` in `handle()`. So it'll throw the null exception. We should make `OpenmldbParameters` extends `PythonParameters`, to avoid breaking changes in `PythonTask`. ### How to reproduce Add a openmldb task and run ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13187
https://github.com/apache/dolphinscheduler/pull/13190
84b5d810425f7bb23cc5a179d3dedeb295daa06d
43e6ac32ddc468c57633162a5cd442a70f418c18
2022-12-14T07:06:46Z
java
2022-12-14T12:13:45Z
dolphinscheduler-task-plugin/dolphinscheduler-task-openmldb/src/main/java/org/apache/dolphinscheduler/plugin/task/openmldb/OpenmldbParameters.java
private String zk; private String zkPath; private String executeMode; /** * origin sql script */ private String sql; /** * resource list */ private List<ResourceInfo> resourceList; public String getZk() { return zk; } public void setZk(String zk) { this.zk = zk; } public String getZkPath() { return zkPath; } public void setZkPath(String zkPath) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,187
[Bug] [Task] OpenMLDB Task can't work
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened The OpenmldbTask will be failed, throw null exception in any situation. ### What you expected to happen OpenmldbTask extends PythonTask, add a new parameter var `openmldbParameters`, and doesn't init the member `pythonParameters`, but after 6e224d0 PythonTask will use `pythonParameter` in `handle()`. So it'll throw the null exception. We should make `OpenmldbParameters` extends `PythonParameters`, to avoid breaking changes in `PythonTask`. ### How to reproduce Add a openmldb task and run ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13187
https://github.com/apache/dolphinscheduler/pull/13190
84b5d810425f7bb23cc5a179d3dedeb295daa06d
43e6ac32ddc468c57633162a5cd442a70f418c18
2022-12-14T07:06:46Z
java
2022-12-14T12:13:45Z
dolphinscheduler-task-plugin/dolphinscheduler-task-openmldb/src/main/java/org/apache/dolphinscheduler/plugin/task/openmldb/OpenmldbParameters.java
this.zkPath = zkPath; } public String getExecuteMode() { return executeMode; } public void setExecuteMode(String executeMode) { this.executeMode = executeMode; } public String getSql() { return sql; } public void setSql(String sql) { this.sql = sql; } public List<ResourceInfo> getResourceList() { return resourceList; } public void setResourceList(List<ResourceInfo> resourceList) { this.resourceList = resourceList; } @Override public boolean checkParameters() { return StringUtils.isNotEmpty(zk) && StringUtils.isNotEmpty(zkPath) && StringUtils.isNotEmpty(sql); } @Override public List<ResourceInfo> getResourceFilesList() { return this.resourceList; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,187
[Bug] [Task] OpenMLDB Task can't work
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened The OpenmldbTask will be failed, throw null exception in any situation. ### What you expected to happen OpenmldbTask extends PythonTask, add a new parameter var `openmldbParameters`, and doesn't init the member `pythonParameters`, but after 6e224d0 PythonTask will use `pythonParameter` in `handle()`. So it'll throw the null exception. We should make `OpenmldbParameters` extends `PythonParameters`, to avoid breaking changes in `PythonTask`. ### How to reproduce Add a openmldb task and run ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13187
https://github.com/apache/dolphinscheduler/pull/13190
84b5d810425f7bb23cc5a179d3dedeb295daa06d
43e6ac32ddc468c57633162a5cd442a70f418c18
2022-12-14T07:06:46Z
java
2022-12-14T12:13:45Z
dolphinscheduler-task-plugin/dolphinscheduler-task-openmldb/src/main/java/org/apache/dolphinscheduler/plugin/task/openmldb/OpenmldbTask.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,187
[Bug] [Task] OpenMLDB Task can't work
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened The OpenmldbTask will be failed, throw null exception in any situation. ### What you expected to happen OpenmldbTask extends PythonTask, add a new parameter var `openmldbParameters`, and doesn't init the member `pythonParameters`, but after 6e224d0 PythonTask will use `pythonParameter` in `handle()`. So it'll throw the null exception. We should make `OpenmldbParameters` extends `PythonParameters`, to avoid breaking changes in `PythonTask`. ### How to reproduce Add a openmldb task and run ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13187
https://github.com/apache/dolphinscheduler/pull/13190
84b5d810425f7bb23cc5a179d3dedeb295daa06d
43e6ac32ddc468c57633162a5cd442a70f418c18
2022-12-14T07:06:46Z
java
2022-12-14T12:13:45Z
dolphinscheduler-task-plugin/dolphinscheduler-task-openmldb/src/main/java/org/apache/dolphinscheduler/plugin/task/openmldb/OpenmldbTask.java
* the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.plugin.task.openmldb; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.plugin.task.api.TaskException; import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext; import org.apache.dolphinscheduler.plugin.task.api.model.Property; import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters; import org.apache.dolphinscheduler.plugin.task.api.parser.ParamUtils; import org.apache.dolphinscheduler.plugin.task.api.parser.ParameterUtils; import org.apache.dolphinscheduler.plugin.task.python.PythonTask; import org.apache.commons.lang3.StringUtils; import java.nio.file.Paths; import java.util.Locale; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import com.google.common.base.Preconditions; /** * openmldb task */ public class OpenmldbTask extends PythonTask {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,187
[Bug] [Task] OpenMLDB Task can't work
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened The OpenmldbTask will be failed, throw null exception in any situation. ### What you expected to happen OpenmldbTask extends PythonTask, add a new parameter var `openmldbParameters`, and doesn't init the member `pythonParameters`, but after 6e224d0 PythonTask will use `pythonParameter` in `handle()`. So it'll throw the null exception. We should make `OpenmldbParameters` extends `PythonParameters`, to avoid breaking changes in `PythonTask`. ### How to reproduce Add a openmldb task and run ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13187
https://github.com/apache/dolphinscheduler/pull/13190
84b5d810425f7bb23cc5a179d3dedeb295daa06d
43e6ac32ddc468c57633162a5cd442a70f418c18
2022-12-14T07:06:46Z
java
2022-12-14T12:13:45Z
dolphinscheduler-task-plugin/dolphinscheduler-task-openmldb/src/main/java/org/apache/dolphinscheduler/plugin/task/openmldb/OpenmldbTask.java
/** * openmldb parameters */ private OpenmldbParameters openmldbParameters; /** * python process(openmldb only supports version 3 by default) */ private static final String OPENMLDB_PYTHON = "python3"; private static final Pattern PYTHON_PATH_PATTERN = Pattern.compile("/bin/python[\\d.]*$"); /** * constructor * * @param taskRequest taskRequest */ public OpenmldbTask(TaskExecutionContext taskRequest) { super(taskRequest); } @Override public void init() { openmldbParameters = JSONUtils.parseObject(taskRequest.getTaskParams(), OpenmldbParameters.class); logger.info("Initialize openmldb task params {}", JSONUtils.toPrettyJsonString(openmldbParameters)); if (openmldbParameters == null || !openmldbParameters.checkParameters()) { throw new TaskException("openmldb task params is not valid"); } } @Override @Deprecated
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,187
[Bug] [Task] OpenMLDB Task can't work
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened The OpenmldbTask will be failed, throw null exception in any situation. ### What you expected to happen OpenmldbTask extends PythonTask, add a new parameter var `openmldbParameters`, and doesn't init the member `pythonParameters`, but after 6e224d0 PythonTask will use `pythonParameter` in `handle()`. So it'll throw the null exception. We should make `OpenmldbParameters` extends `PythonParameters`, to avoid breaking changes in `PythonTask`. ### How to reproduce Add a openmldb task and run ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13187
https://github.com/apache/dolphinscheduler/pull/13190
84b5d810425f7bb23cc5a179d3dedeb295daa06d
43e6ac32ddc468c57633162a5cd442a70f418c18
2022-12-14T07:06:46Z
java
2022-12-14T12:13:45Z
dolphinscheduler-task-plugin/dolphinscheduler-task-openmldb/src/main/java/org/apache/dolphinscheduler/plugin/task/openmldb/OpenmldbTask.java
public String getPreScript() { return ""; } @Override public AbstractParameters getParameters() { return openmldbParameters; } /** * build python command file path * * @return python command file path */ @Override protected String buildPythonCommandFilePath() { return String.format("%s/openmldb_%s.py", taskRequest.getExecutePath(), taskRequest.getTaskAppId()); } /** * build python script content from sql * * @return raw python script */ @Override protected String buildPythonScriptContent() { logger.info("raw sql script : {}", openmldbParameters.getSql()); String rawSQLScript = openmldbParameters.getSql().replaceAll("[\\r]?\\n", "\n"); Map<String, Property> paramsMap = mergeParamsWithContext(openmldbParameters); rawSQLScript = ParameterUtils.convertParameterPlaceholders(rawSQLScript, ParamUtils.convert(paramsMap)); String pythonScript = buildPythonScriptsFromSql(rawSQLScript); logger.info("rendered python script : {}", pythonScript);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,187
[Bug] [Task] OpenMLDB Task can't work
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened The OpenmldbTask will be failed, throw null exception in any situation. ### What you expected to happen OpenmldbTask extends PythonTask, add a new parameter var `openmldbParameters`, and doesn't init the member `pythonParameters`, but after 6e224d0 PythonTask will use `pythonParameter` in `handle()`. So it'll throw the null exception. We should make `OpenmldbParameters` extends `PythonParameters`, to avoid breaking changes in `PythonTask`. ### How to reproduce Add a openmldb task and run ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13187
https://github.com/apache/dolphinscheduler/pull/13190
84b5d810425f7bb23cc5a179d3dedeb295daa06d
43e6ac32ddc468c57633162a5cd442a70f418c18
2022-12-14T07:06:46Z
java
2022-12-14T12:13:45Z
dolphinscheduler-task-plugin/dolphinscheduler-task-openmldb/src/main/java/org/apache/dolphinscheduler/plugin/task/openmldb/OpenmldbTask.java
return pythonScript; } private String buildPythonScriptsFromSql(String rawSqlScript) { StringBuilder builder = new StringBuilder("import openmldb\nimport sqlalchemy as db\n"); builder.append(String.format("engine = db.create_engine('openmldb:///?zk=%s&zkPath=%s')\n", openmldbParameters.getZk(), openmldbParameters.getZkPath())); builder.append("con = engine.connect()\n"); String executeMode = openmldbParameters.getExecuteMode().toLowerCase(Locale.ROOT); builder.append("con.execute(\"set @@execute_mode='").append(executeMode).append("';\")\n"); if (executeMode.equals("offline")) { builder.append("con.execute(\"set @@sync_job=true\")\n"); builder.append("con.execute(\"set @@job_timeout=1800000\")\n"); } Pattern pattern = Pattern.compile("\\S"); for (String sql : rawSqlScript.split(";")) { if (pattern.matcher(sql).find()) { sql = sql.replaceAll("\\n", "\\\\n"); builder.append("con.execute(\"").append(sql).append("\")\n"); } } return builder.toString(); } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,187
[Bug] [Task] OpenMLDB Task can't work
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened The OpenmldbTask will be failed, throw null exception in any situation. ### What you expected to happen OpenmldbTask extends PythonTask, add a new parameter var `openmldbParameters`, and doesn't init the member `pythonParameters`, but after 6e224d0 PythonTask will use `pythonParameter` in `handle()`. So it'll throw the null exception. We should make `OpenmldbParameters` extends `PythonParameters`, to avoid breaking changes in `PythonTask`. ### How to reproduce Add a openmldb task and run ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13187
https://github.com/apache/dolphinscheduler/pull/13190
84b5d810425f7bb23cc5a179d3dedeb295daa06d
43e6ac32ddc468c57633162a5cd442a70f418c18
2022-12-14T07:06:46Z
java
2022-12-14T12:13:45Z
dolphinscheduler-task-plugin/dolphinscheduler-task-openmldb/src/main/java/org/apache/dolphinscheduler/plugin/task/openmldb/OpenmldbTask.java
* Build the python task command. * If user have set the 'PYTHON_HOME' environment, we will use the 'PYTHON_HOME', * if not, we will default use python. * * @param pythonFile Python file, cannot be empty. * @return Python execute command, e.g. 'python test.py'. */ @Override protected String buildPythonExecuteCommand(String pythonFile) { Preconditions.checkNotNull(pythonFile, "Python file cannot be null"); return getPythonCommand() + " " + pythonFile; } private String getPythonCommand() { String pythonHome = System.getenv(PYTHON_HOME); return getPythonCommand(pythonHome); } private String getPythonCommand(String pythonHome) { if (StringUtils.isEmpty(pythonHome)) { return OPENMLDB_PYTHON; } String pythonBinPath = "/bin/" + OPENMLDB_PYTHON; Matcher matcher = PYTHON_PATH_PATTERN.matcher(pythonHome); if (matcher.find()) { return matcher.replaceAll(pythonBinPath); } return Paths.get(pythonHome, pythonBinPath).toString(); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,197
[Bug] [ProceducerTask] Remove datasource in procedure task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened Right now, we use datasource in procedure task, this will cause we cannot use TEMPORARY TABLE in procedure, since the temporary table will be release after the connection session close. But in datasource the session will not be closed, so the temporary will be share in different task. ### What you expected to happen xx ### How to reproduce In different task call the procedure. ``` CREATE PROCEDURE `temporary_table`() BEGIN CREATE TEMPORARY TABLE str_spilt_result ( id BIGINT(20) NOT NULL ); SELECT * from str_spilt_result; END; ``` ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13197
https://github.com/apache/dolphinscheduler/pull/13198
5cd8a02f873c11939288aeae717e04a05732d159
b2336b0ce9e3ebbe57a92969c57a613964e5ccf2
2022-12-15T06:24:58Z
java
2022-12-19T09:14:59Z
dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/plugin/DataSourceProcessorProvider.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.plugin.datasource.api.plugin; import org.apache.dolphinscheduler.plugin.datasource.api.datasource.DataSourceProcessor; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class DataSourceProcessorProvider {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,197
[Bug] [ProceducerTask] Remove datasource in procedure task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened Right now, we use datasource in procedure task, this will cause we cannot use TEMPORARY TABLE in procedure, since the temporary table will be release after the connection session close. But in datasource the session will not be closed, so the temporary will be share in different task. ### What you expected to happen xx ### How to reproduce In different task call the procedure. ``` CREATE PROCEDURE `temporary_table`() BEGIN CREATE TEMPORARY TABLE str_spilt_result ( id BIGINT(20) NOT NULL ); SELECT * from str_spilt_result; END; ``` ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13197
https://github.com/apache/dolphinscheduler/pull/13198
5cd8a02f873c11939288aeae717e04a05732d159
b2336b0ce9e3ebbe57a92969c57a613964e5ccf2
2022-12-15T06:24:58Z
java
2022-12-19T09:14:59Z
dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/plugin/DataSourceProcessorProvider.java
private static final Logger logger = LoggerFactory.getLogger(DataSourceProcessorProvider.class); private DataSourceProcessorManager dataSourcePluginManager; private DataSourceProcessorProvider() { initDataSourceProcessorPlugin(); } private static class DataSourceClientProviderHolder { private static final DataSourceProcessorProvider INSTANCE = new DataSourceProcessorProvider(); } public static DataSourceProcessorProvider getInstance() { return DataSourceClientProviderHolder.INSTANCE; } public Map<String, DataSourceProcessor> getDataSourceProcessorMap() { return dataSourcePluginManager.getDataSourceProcessorMap(); } private void initDataSourceProcessorPlugin() { dataSourcePluginManager = new DataSourceProcessorManager(); dataSourcePluginManager.installProcessor(); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,197
[Bug] [ProceducerTask] Remove datasource in procedure task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened Right now, we use datasource in procedure task, this will cause we cannot use TEMPORARY TABLE in procedure, since the temporary table will be release after the connection session close. But in datasource the session will not be closed, so the temporary will be share in different task. ### What you expected to happen xx ### How to reproduce In different task call the procedure. ``` CREATE PROCEDURE `temporary_table`() BEGIN CREATE TEMPORARY TABLE str_spilt_result ( id BIGINT(20) NOT NULL ); SELECT * from str_spilt_result; END; ``` ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13197
https://github.com/apache/dolphinscheduler/pull/13198
5cd8a02f873c11939288aeae717e04a05732d159
b2336b0ce9e3ebbe57a92969c57a613964e5ccf2
2022-12-15T06:24:58Z
java
2022-12-19T09:14:59Z
dolphinscheduler-task-plugin/dolphinscheduler-task-procedure/src/main/java/org/apache/dolphinscheduler/plugin/task/procedure/ProcedureTask.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.plugin.task.procedure;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,197
[Bug] [ProceducerTask] Remove datasource in procedure task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened Right now, we use datasource in procedure task, this will cause we cannot use TEMPORARY TABLE in procedure, since the temporary table will be release after the connection session close. But in datasource the session will not be closed, so the temporary will be share in different task. ### What you expected to happen xx ### How to reproduce In different task call the procedure. ``` CREATE PROCEDURE `temporary_table`() BEGIN CREATE TEMPORARY TABLE str_spilt_result ( id BIGINT(20) NOT NULL ); SELECT * from str_spilt_result; END; ``` ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13197
https://github.com/apache/dolphinscheduler/pull/13198
5cd8a02f873c11939288aeae717e04a05732d159
b2336b0ce9e3ebbe57a92969c57a613964e5ccf2
2022-12-15T06:24:58Z
java
2022-12-19T09:14:59Z
dolphinscheduler-task-plugin/dolphinscheduler-task-procedure/src/main/java/org/apache/dolphinscheduler/plugin/task/procedure/ProcedureTask.java
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.EXIT_CODE_FAILURE; import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.EXIT_CODE_SUCCESS; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.plugin.datasource.api.plugin.DataSourceClientProvider; import org.apache.dolphinscheduler.plugin.datasource.api.utils.DataSourceUtils; import org.apache.dolphinscheduler.plugin.task.api.AbstractTask; import org.apache.dolphinscheduler.plugin.task.api.TaskCallBack; import org.apache.dolphinscheduler.plugin.task.api.TaskException; import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext; import org.apache.dolphinscheduler.plugin.task.api.enums.DataType; import org.apache.dolphinscheduler.plugin.task.api.enums.Direct; import org.apache.dolphinscheduler.plugin.task.api.enums.TaskTimeoutStrategy; import org.apache.dolphinscheduler.plugin.task.api.model.Property; import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters; import org.apache.dolphinscheduler.plugin.task.api.parser.ParameterUtils; import org.apache.dolphinscheduler.spi.datasource.ConnectionParam; import org.apache.dolphinscheduler.spi.enums.DbType; import org.apache.commons.lang3.StringUtils; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Types; import java.util.HashMap; import java.util.Map; import com.google.common.collect.Maps; /** * procedure task */ public class ProcedureTask extends AbstractTask {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,197
[Bug] [ProceducerTask] Remove datasource in procedure task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened Right now, we use datasource in procedure task, this will cause we cannot use TEMPORARY TABLE in procedure, since the temporary table will be release after the connection session close. But in datasource the session will not be closed, so the temporary will be share in different task. ### What you expected to happen xx ### How to reproduce In different task call the procedure. ``` CREATE PROCEDURE `temporary_table`() BEGIN CREATE TEMPORARY TABLE str_spilt_result ( id BIGINT(20) NOT NULL ); SELECT * from str_spilt_result; END; ``` ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13197
https://github.com/apache/dolphinscheduler/pull/13198
5cd8a02f873c11939288aeae717e04a05732d159
b2336b0ce9e3ebbe57a92969c57a613964e5ccf2
2022-12-15T06:24:58Z
java
2022-12-19T09:14:59Z
dolphinscheduler-task-plugin/dolphinscheduler-task-procedure/src/main/java/org/apache/dolphinscheduler/plugin/task/procedure/ProcedureTask.java
/** * procedure parameters */ private ProcedureParameters procedureParameters; /** * taskExecutionContext */ private TaskExecutionContext taskExecutionContext; private ProcedureTaskExecutionContext procedureTaskExecutionContext; /** * constructor * * @param taskExecutionContext taskExecutionContext */ public ProcedureTask(TaskExecutionContext taskExecutionContext) { super(taskExecutionContext); this.taskExecutionContext = taskExecutionContext; this.procedureParameters = JSONUtils.parseObject(taskExecutionContext.getTaskParams(), ProcedureParameters.class); logger.info("Initialize procedure task params {}", JSONUtils.toPrettyJsonString(procedureParameters)); if (procedureParameters == null || !procedureParameters.checkParameters()) { throw new TaskException("procedure task params is not valid"); } procedureTaskExecutionContext = procedureParameters.generateExtendedContext(taskExecutionContext.getResourceParametersHelper()); } @Override public void handle(TaskCallBack taskCallBack) throws TaskException {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,197
[Bug] [ProceducerTask] Remove datasource in procedure task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened Right now, we use datasource in procedure task, this will cause we cannot use TEMPORARY TABLE in procedure, since the temporary table will be release after the connection session close. But in datasource the session will not be closed, so the temporary will be share in different task. ### What you expected to happen xx ### How to reproduce In different task call the procedure. ``` CREATE PROCEDURE `temporary_table`() BEGIN CREATE TEMPORARY TABLE str_spilt_result ( id BIGINT(20) NOT NULL ); SELECT * from str_spilt_result; END; ``` ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13197
https://github.com/apache/dolphinscheduler/pull/13198
5cd8a02f873c11939288aeae717e04a05732d159
b2336b0ce9e3ebbe57a92969c57a613964e5ccf2
2022-12-15T06:24:58Z
java
2022-12-19T09:14:59Z
dolphinscheduler-task-plugin/dolphinscheduler-task-procedure/src/main/java/org/apache/dolphinscheduler/plugin/task/procedure/ProcedureTask.java
logger.info("procedure type : {}, datasource : {}, method : {} , localParams : {}", procedureParameters.getType(), procedureParameters.getDatasource(), procedureParameters.getMethod(), procedureParameters.getLocalParams()); Connection connection = null; CallableStatement stmt = null; try { DbType dbType = DbType.valueOf(procedureParameters.getType()); ConnectionParam connectionParam = DataSourceUtils.buildConnectionParams(DbType.valueOf(procedureParameters.getType()), procedureTaskExecutionContext.getConnectionParams()); connection = DataSourceClientProvider.getInstance().getConnection(dbType, connectionParam); Map<Integer, Property> sqlParamsMap = new HashMap<>(); Map<String, Property> paramsMap = taskExecutionContext.getPrepareParamsMap() == null ? Maps.newHashMap() : taskExecutionContext.getPrepareParamsMap(); if (procedureParameters.getOutProperty() != null) { paramsMap.putAll(procedureParameters.getOutProperty()); } String proceduerSql = formatSql(sqlParamsMap, paramsMap); stmt = connection.prepareCall(proceduerSql); setTimeout(stmt);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,197
[Bug] [ProceducerTask] Remove datasource in procedure task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened Right now, we use datasource in procedure task, this will cause we cannot use TEMPORARY TABLE in procedure, since the temporary table will be release after the connection session close. But in datasource the session will not be closed, so the temporary will be share in different task. ### What you expected to happen xx ### How to reproduce In different task call the procedure. ``` CREATE PROCEDURE `temporary_table`() BEGIN CREATE TEMPORARY TABLE str_spilt_result ( id BIGINT(20) NOT NULL ); SELECT * from str_spilt_result; END; ``` ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13197
https://github.com/apache/dolphinscheduler/pull/13198
5cd8a02f873c11939288aeae717e04a05732d159
b2336b0ce9e3ebbe57a92969c57a613964e5ccf2
2022-12-15T06:24:58Z
java
2022-12-19T09:14:59Z
dolphinscheduler-task-plugin/dolphinscheduler-task-procedure/src/main/java/org/apache/dolphinscheduler/plugin/task/procedure/ProcedureTask.java
Map<Integer, Property> outParameterMap = getOutParameterMap(stmt, sqlParamsMap, paramsMap); stmt.executeUpdate(); printOutParameter(stmt, outParameterMap); setExitStatusCode(EXIT_CODE_SUCCESS); } catch (Exception e) { setExitStatusCode(EXIT_CODE_FAILURE); logger.error("procedure task error", e); throw new TaskException("Execute procedure task failed", e); } finally { close(stmt, connection); } } @Override public void cancel() throws TaskException { } private String formatSql(Map<Integer, Property> sqlParamsMap, Map<String, Property> paramsMap) { setSqlParamsMap(procedureParameters.getMethod(), rgex, sqlParamsMap, paramsMap, taskExecutionContext.getTaskInstanceId()); return procedureParameters.getMethod().replaceAll(rgex, "?"); } /** * print outParameter * * @param stmt CallableStatement * @param outParameterMap outParameterMap * @throws SQLException SQLException */ private void printOutParameter(CallableStatement stmt,
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,197
[Bug] [ProceducerTask] Remove datasource in procedure task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened Right now, we use datasource in procedure task, this will cause we cannot use TEMPORARY TABLE in procedure, since the temporary table will be release after the connection session close. But in datasource the session will not be closed, so the temporary will be share in different task. ### What you expected to happen xx ### How to reproduce In different task call the procedure. ``` CREATE PROCEDURE `temporary_table`() BEGIN CREATE TEMPORARY TABLE str_spilt_result ( id BIGINT(20) NOT NULL ); SELECT * from str_spilt_result; END; ``` ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13197
https://github.com/apache/dolphinscheduler/pull/13198
5cd8a02f873c11939288aeae717e04a05732d159
b2336b0ce9e3ebbe57a92969c57a613964e5ccf2
2022-12-15T06:24:58Z
java
2022-12-19T09:14:59Z
dolphinscheduler-task-plugin/dolphinscheduler-task-procedure/src/main/java/org/apache/dolphinscheduler/plugin/task/procedure/ProcedureTask.java
Map<Integer, Property> outParameterMap) throws SQLException { for (Map.Entry<Integer, Property> en : outParameterMap.entrySet()) { int index = en.getKey(); Property property = en.getValue(); String prop = property.getProp(); DataType dataType = property.getType(); procedureParameters.dealOutParam4Procedure(getOutputParameter(stmt, index, prop, dataType), prop); } } /** * get output parameter * * @param stmt CallableStatement * @param paramsMap paramsMap * @return outParameterMap * @throws Exception Exception */ private Map<Integer, Property> getOutParameterMap(CallableStatement stmt, Map<Integer, Property> paramsMap, Map<String, Property> totalParamsMap) throws Exception { Map<Integer, Property> outParameterMap = new HashMap<>(); if (procedureParameters.getLocalParametersMap() == null) { return outParameterMap; } int index = 1; if (paramsMap != null) { for (Map.Entry<Integer, Property> entry : paramsMap.entrySet()) { Property property = entry.getValue(); if (property.getDirect().equals(Direct.IN)) { ParameterUtils.setInParameter(index, stmt, property.getType(),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,197
[Bug] [ProceducerTask] Remove datasource in procedure task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened Right now, we use datasource in procedure task, this will cause we cannot use TEMPORARY TABLE in procedure, since the temporary table will be release after the connection session close. But in datasource the session will not be closed, so the temporary will be share in different task. ### What you expected to happen xx ### How to reproduce In different task call the procedure. ``` CREATE PROCEDURE `temporary_table`() BEGIN CREATE TEMPORARY TABLE str_spilt_result ( id BIGINT(20) NOT NULL ); SELECT * from str_spilt_result; END; ``` ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13197
https://github.com/apache/dolphinscheduler/pull/13198
5cd8a02f873c11939288aeae717e04a05732d159
b2336b0ce9e3ebbe57a92969c57a613964e5ccf2
2022-12-15T06:24:58Z
java
2022-12-19T09:14:59Z
dolphinscheduler-task-plugin/dolphinscheduler-task-procedure/src/main/java/org/apache/dolphinscheduler/plugin/task/procedure/ProcedureTask.java
totalParamsMap.get(property.getProp()).getValue()); } else if (property.getDirect().equals(Direct.OUT)) { setOutParameter(index, stmt, property.getType(), totalParamsMap.get(property.getProp()).getValue()); outParameterMap.put(index, property); } index++; } } return outParameterMap; } /** * set timeout * * @param stmt CallableStatement */ private void setTimeout(CallableStatement stmt) throws SQLException { Boolean failed = taskExecutionContext.getTaskTimeoutStrategy() == TaskTimeoutStrategy.FAILED; Boolean warnFailed = taskExecutionContext.getTaskTimeoutStrategy() == TaskTimeoutStrategy.WARNFAILED; if (failed || warnFailed) { stmt.setQueryTimeout(taskExecutionContext.getTaskTimeout()); } } /** * close jdbc resource * * @param stmt stmt * @param connection connection */ private void close(PreparedStatement stmt, Connection connection) { if (stmt != null) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,197
[Bug] [ProceducerTask] Remove datasource in procedure task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened Right now, we use datasource in procedure task, this will cause we cannot use TEMPORARY TABLE in procedure, since the temporary table will be release after the connection session close. But in datasource the session will not be closed, so the temporary will be share in different task. ### What you expected to happen xx ### How to reproduce In different task call the procedure. ``` CREATE PROCEDURE `temporary_table`() BEGIN CREATE TEMPORARY TABLE str_spilt_result ( id BIGINT(20) NOT NULL ); SELECT * from str_spilt_result; END; ``` ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13197
https://github.com/apache/dolphinscheduler/pull/13198
5cd8a02f873c11939288aeae717e04a05732d159
b2336b0ce9e3ebbe57a92969c57a613964e5ccf2
2022-12-15T06:24:58Z
java
2022-12-19T09:14:59Z
dolphinscheduler-task-plugin/dolphinscheduler-task-procedure/src/main/java/org/apache/dolphinscheduler/plugin/task/procedure/ProcedureTask.java
try { stmt.close(); } catch (SQLException e) { logger.error("close prepared statement error : {}", e.getMessage(), e); } } if (connection != null) { try { connection.close(); } catch (SQLException e) { logger.error("close connection error : {}", e.getMessage(), e); } } } /** * get output parameter * * @param stmt stmt * @param index index * @param prop prop * @param dataType dataType * @throws SQLException SQLException */ private Object getOutputParameter(CallableStatement stmt, int index, String prop, DataType dataType) throws SQLException { Object value = null; switch (dataType) { case VARCHAR: logger.info("out prameter varchar key : {} , value : {}", prop, stmt.getString(index)); value = stmt.getString(index);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,197
[Bug] [ProceducerTask] Remove datasource in procedure task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened Right now, we use datasource in procedure task, this will cause we cannot use TEMPORARY TABLE in procedure, since the temporary table will be release after the connection session close. But in datasource the session will not be closed, so the temporary will be share in different task. ### What you expected to happen xx ### How to reproduce In different task call the procedure. ``` CREATE PROCEDURE `temporary_table`() BEGIN CREATE TEMPORARY TABLE str_spilt_result ( id BIGINT(20) NOT NULL ); SELECT * from str_spilt_result; END; ``` ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13197
https://github.com/apache/dolphinscheduler/pull/13198
5cd8a02f873c11939288aeae717e04a05732d159
b2336b0ce9e3ebbe57a92969c57a613964e5ccf2
2022-12-15T06:24:58Z
java
2022-12-19T09:14:59Z
dolphinscheduler-task-plugin/dolphinscheduler-task-procedure/src/main/java/org/apache/dolphinscheduler/plugin/task/procedure/ProcedureTask.java
break; case INTEGER: logger.info("out prameter integer key : {} , value : {}", prop, stmt.getInt(index)); value = stmt.getInt(index); break; case LONG: logger.info("out prameter long key : {} , value : {}", prop, stmt.getLong(index)); value = stmt.getLong(index); break; case FLOAT: logger.info("out prameter float key : {} , value : {}", prop, stmt.getFloat(index)); value = stmt.getFloat(index); break; case DOUBLE: logger.info("out prameter double key : {} , value : {}", prop, stmt.getDouble(index)); value = stmt.getDouble(index); break; case DATE: logger.info("out prameter date key : {} , value : {}", prop, stmt.getDate(index)); value = stmt.getDate(index); break; case TIME: logger.info("out prameter time key : {} , value : {}", prop, stmt.getTime(index)); value = stmt.getTime(index); break; case TIMESTAMP: logger.info("out prameter timestamp key : {} , value : {}", prop, stmt.getTimestamp(index)); value = stmt.getTimestamp(index); break; case BOOLEAN:
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,197
[Bug] [ProceducerTask] Remove datasource in procedure task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened Right now, we use datasource in procedure task, this will cause we cannot use TEMPORARY TABLE in procedure, since the temporary table will be release after the connection session close. But in datasource the session will not be closed, so the temporary will be share in different task. ### What you expected to happen xx ### How to reproduce In different task call the procedure. ``` CREATE PROCEDURE `temporary_table`() BEGIN CREATE TEMPORARY TABLE str_spilt_result ( id BIGINT(20) NOT NULL ); SELECT * from str_spilt_result; END; ``` ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13197
https://github.com/apache/dolphinscheduler/pull/13198
5cd8a02f873c11939288aeae717e04a05732d159
b2336b0ce9e3ebbe57a92969c57a613964e5ccf2
2022-12-15T06:24:58Z
java
2022-12-19T09:14:59Z
dolphinscheduler-task-plugin/dolphinscheduler-task-procedure/src/main/java/org/apache/dolphinscheduler/plugin/task/procedure/ProcedureTask.java
logger.info("out prameter boolean key : {} , value : {}", prop, stmt.getBoolean(index)); value = stmt.getBoolean(index); break; default: break; } return value; } @Override public AbstractParameters getParameters() { return procedureParameters; } /** * set out parameter * * @param index index * @param stmt stmt * @param dataType dataType * @param value value * @throws Exception exception */ private void setOutParameter(int index, CallableStatement stmt, DataType dataType, String value) throws Exception { int sqlType; switch (dataType) { case VARCHAR: sqlType = Types.VARCHAR; break; case INTEGER: case LONG: sqlType = Types.INTEGER;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,197
[Bug] [ProceducerTask] Remove datasource in procedure task
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened Right now, we use datasource in procedure task, this will cause we cannot use TEMPORARY TABLE in procedure, since the temporary table will be release after the connection session close. But in datasource the session will not be closed, so the temporary will be share in different task. ### What you expected to happen xx ### How to reproduce In different task call the procedure. ``` CREATE PROCEDURE `temporary_table`() BEGIN CREATE TEMPORARY TABLE str_spilt_result ( id BIGINT(20) NOT NULL ); SELECT * from str_spilt_result; END; ``` ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13197
https://github.com/apache/dolphinscheduler/pull/13198
5cd8a02f873c11939288aeae717e04a05732d159
b2336b0ce9e3ebbe57a92969c57a613964e5ccf2
2022-12-15T06:24:58Z
java
2022-12-19T09:14:59Z
dolphinscheduler-task-plugin/dolphinscheduler-task-procedure/src/main/java/org/apache/dolphinscheduler/plugin/task/procedure/ProcedureTask.java
break; case FLOAT: sqlType = Types.FLOAT; break; case DOUBLE: sqlType = Types.DOUBLE; break; case DATE: sqlType = Types.DATE; break; case TIME: sqlType = Types.TIME; break; case TIMESTAMP: sqlType = Types.TIMESTAMP; break; case BOOLEAN: sqlType = Types.BOOLEAN; break; default: throw new IllegalStateException("Unexpected value: " + dataType); } if (StringUtils.isEmpty(value)) { stmt.registerOutParameter(index, sqlType); } else { stmt.registerOutParameter(index, sqlType, value); } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/event/WorkflowStartEventHandler.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.server.master.event; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.server.master.cache.ProcessInstanceExecCacheManager; import org.apache.dolphinscheduler.server.master.metrics.ProcessInstanceMetrics; import org.apache.dolphinscheduler.server.master.runner.StateWheelExecuteThread; import org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable; import org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThreadPool; import org.apache.dolphinscheduler.server.master.runner.WorkflowSubmitStatue; import java.util.concurrent.CompletableFuture; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/event/WorkflowStartEventHandler.java
public class WorkflowStartEventHandler implements WorkflowEventHandler { private final Logger logger = LoggerFactory.getLogger(WorkflowStartEventHandler.class); @Autowired private ProcessInstanceExecCacheManager processInstanceExecCacheManager; @Autowired private StateWheelExecuteThread stateWheelExecuteThread; @Autowired private WorkflowExecuteThreadPool workflowExecuteThreadPool; @Autowired private WorkflowEventQueue workflowEventQueue; @Override public void handleWorkflowEvent(final WorkflowEvent workflowEvent) throws WorkflowEventHandleError {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/event/WorkflowStartEventHandler.java
logger.info("Handle workflow start event, begin to start a workflow, event: {}", workflowEvent); WorkflowExecuteRunnable workflowExecuteRunnable = processInstanceExecCacheManager.getByProcessInstanceId( workflowEvent.getWorkflowInstanceId()); if (workflowExecuteRunnable == null) { throw new WorkflowEventHandleError( "The workflow start event is invalid, cannot find the workflow instance from cache"); } ProcessInstanceMetrics.incProcessInstanceByState("submit"); ProcessInstance processInstance = workflowExecuteRunnable.getProcessInstance(); CompletableFuture.supplyAsync(workflowExecuteRunnable::call, workflowExecuteThreadPool) .thenAccept(workflowSubmitStatue -> { if (WorkflowSubmitStatue.SUCCESS == workflowSubmitStatue) { logger.info("Success submit the workflow instance"); if (processInstance.getTimeout() > 0) { stateWheelExecuteThread.addProcess4TimeoutCheck(processInstance); } } else { logger.error("Failed to submit the workflow instance, will resend the workflow start event: {}", workflowEvent); workflowEventQueue.addEvent(workflowEvent); } }); } @Override public WorkflowEventType getHandleWorkflowEventType() { return WorkflowEventType.START_WORKFLOW; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
/* * Lcensed to the Apache Software Foundaton (ASF) under one or more
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
* contrbutor lcense agreements. See the NOTICE fle dstrbuted wth * ths work for addtonal nformaton regardng copyrght ownershp. * The ASF lcenses ths fle to You under the Apache Lcense, Verson 2.0 * (the "Lcense"); you may not use ths fle except n complance wth * the Lcense. You may obtan a copy of the Lcense at * * http://www.apache.org/lcenses/LICENSE-2.0 * * Unless requred by applcable law or agreed to n wrtng, software * dstrbuted under the Lcense s dstrbuted on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, ether express or mpled. * See the Lcense for the specfc language governng permssons and * lmtatons under the Lcense. */ package org.apache.dolphnscheduler.server.master.runner; mport statc org.apache.dolphnscheduler.common.constants.CommandKeyConstants.CMD_PARAM_COMPLEMENT_DATA_END_DATE; mport statc org.apache.dolphnscheduler.common.constants.CommandKeyConstants.CMD_PARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST; mport statc org.apache.dolphnscheduler.common.constants.CommandKeyConstants.CMD_PARAM_COMPLEMENT_DATA_START_DATE; mport statc org.apache.dolphnscheduler.common.constants.CommandKeyConstants.CMD_PARAM_FATHER_PARAMS; mport statc org.apache.dolphnscheduler.common.constants.CommandKeyConstants.CMD_PARAM_RECOVERY_START_NODE_STRING; mport statc org.apache.dolphnscheduler.common.constants.CommandKeyConstants.CMD_PARAM_RECOVER_PROCESS_ID_STRING; mport statc org.apache.dolphnscheduler.common.constants.CommandKeyConstants.CMD_PARAM_START_NODES; mport statc org.apache.dolphnscheduler.common.constants.CommandKeyConstants.CMD_PARAM_START_PARAMS; mport statc org.apache.dolphnscheduler.common.constants.Constants.COMMA; mport statc org.apache.dolphnscheduler.common.constants.Constants.DEFAULT_WORKER_GROUP; mport statc org.apache.dolphnscheduler.common.constants.DateConstants.YYYY_MM_DD_HH_MM_SS; mport statc org.apache.dolphnscheduler.plugn.task.ap.TaskConstants.TASK_TYPE_BLOCKING; mport statc org.apache.dolphnscheduler.plugn.task.ap.enums.DataType.VARCHAR; mport statc org.apache.dolphnscheduler.plugn.task.ap.enums.Drect.IN; mport org.apache.dolphnscheduler.common.constants.Constants;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
mport org.apache.dolphnscheduler.common.enums.CommandType; mport org.apache.dolphnscheduler.common.enums.FalureStrategy; mport org.apache.dolphnscheduler.common.enums.Flag; mport org.apache.dolphnscheduler.common.enums.Prorty; mport org.apache.dolphnscheduler.common.enums.StateEventType; mport org.apache.dolphnscheduler.common.enums.TaskDependType; mport org.apache.dolphnscheduler.common.enums.TaskGroupQueueStatus; mport org.apache.dolphnscheduler.common.enums.WorkflowExecutonStatus; mport org.apache.dolphnscheduler.common.graph.DAG; mport org.apache.dolphnscheduler.common.model.TaskNodeRelaton; mport org.apache.dolphnscheduler.common.thread.ThreadUtls; mport org.apache.dolphnscheduler.common.utls.DateUtls; mport org.apache.dolphnscheduler.common.utls.JSONUtls; mport org.apache.dolphnscheduler.common.utls.NetUtls; mport org.apache.dolphnscheduler.dao.entty.Command; mport org.apache.dolphnscheduler.dao.entty.Envronment; mport org.apache.dolphnscheduler.dao.entty.ProcessDefnton; mport org.apache.dolphnscheduler.dao.entty.ProcessInstance; mport org.apache.dolphnscheduler.dao.entty.ProcessTaskRelaton; mport org.apache.dolphnscheduler.dao.entty.ProjectUser; mport org.apache.dolphnscheduler.dao.entty.Schedule; mport org.apache.dolphnscheduler.dao.entty.TaskDefntonLog; mport org.apache.dolphnscheduler.dao.entty.TaskGroupQueue; mport org.apache.dolphnscheduler.dao.entty.TaskInstance; mport org.apache.dolphnscheduler.dao.repostory.ProcessInstanceDao; mport org.apache.dolphnscheduler.dao.repostory.TaskDefntonLogDao; mport org.apache.dolphnscheduler.dao.repostory.TaskInstanceDao; mport org.apache.dolphnscheduler.dao.utls.TaskCacheUtls; mport org.apache.dolphnscheduler.plugn.task.ap.enums.DependResult; mport org.apache.dolphnscheduler.plugn.task.ap.enums.Drect;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
mport org.apache.dolphnscheduler.plugn.task.ap.enums.TaskExecutonStatus; mport org.apache.dolphnscheduler.plugn.task.ap.model.Property; mport org.apache.dolphnscheduler.remote.command.HostUpdateCommand; mport org.apache.dolphnscheduler.remote.utls.Host; mport org.apache.dolphnscheduler.server.master.confg.MasterConfg; mport org.apache.dolphnscheduler.server.master.dspatch.executor.NettyExecutorManager; mport org.apache.dolphnscheduler.server.master.event.StateEvent; mport org.apache.dolphnscheduler.server.master.event.StateEventHandleError; mport org.apache.dolphnscheduler.server.master.event.StateEventHandleExcepton; mport org.apache.dolphnscheduler.server.master.event.StateEventHandleFalure; mport org.apache.dolphnscheduler.server.master.event.StateEventHandler; mport org.apache.dolphnscheduler.server.master.event.StateEventHandlerManager; mport org.apache.dolphnscheduler.server.master.event.TaskStateEvent; mport org.apache.dolphnscheduler.server.master.event.WorkflowStateEvent; mport org.apache.dolphnscheduler.server.master.metrcs.TaskMetrcs; mport org.apache.dolphnscheduler.server.master.runner.task.ITaskProcessor; mport org.apache.dolphnscheduler.server.master.runner.task.TaskActon; mport org.apache.dolphnscheduler.server.master.runner.task.TaskProcessorFactory; mport org.apache.dolphnscheduler.servce.alert.ProcessAlertManager; mport org.apache.dolphnscheduler.servce.command.CommandServce; mport org.apache.dolphnscheduler.servce.cron.CronUtls; mport org.apache.dolphnscheduler.servce.exceptons.CronParseExcepton; mport org.apache.dolphnscheduler.servce.expand.CurngParamsServce; mport org.apache.dolphnscheduler.servce.model.TaskNode; mport org.apache.dolphnscheduler.servce.process.ProcessDag; mport org.apache.dolphnscheduler.servce.process.ProcessServce; mport org.apache.dolphnscheduler.servce.queue.PeerTaskInstancePrortyQueue; mport org.apache.dolphnscheduler.servce.utls.DagHelper; mport org.apache.dolphnscheduler.servce.utls.LoggerUtls; mport org.apache.commons.collectons4.CollectonUtls;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
mport org.apache.commons.lang3.StrngUtls; mport org.apache.commons.lang3.math.NumberUtls; mport org.apache.commons.lang3.tuple.Par; mport java.utl.ArrayLst; mport java.utl.Arrays; mport java.utl.Collecton; mport java.utl.Collectons; mport java.utl.Date; mport java.utl.HashMap; mport java.utl.HashSet; mport java.utl.Iterator; mport java.utl.Lst; mport java.utl.Map; mport java.utl.Objects; mport java.utl.Optonal; mport java.utl.Set; mport java.utl.concurrent.Callable; mport java.utl.concurrent.ConcurrentHashMap; mport java.utl.concurrent.ConcurrentLnkedQueue; mport java.utl.concurrent.atomc.AtomcBoolean; mport java.utl.stream.Collectors; mport lombok.NonNull; mport org.slf4j.Logger; mport org.slf4j.LoggerFactory; mport org.sprngframework.beans.BeanUtls; mport com.google.common.collect.Lsts; mport com.google.common.collect.Sets; /** * Workflow execute task, used to execute a workflow nstance. */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
publc class WorkflowExecuteRunnable mplements Callable<WorkflowSubmtStatue> { prvate statc fnal Logger logger = LoggerFactory.getLogger(WorkflowExecuteRunnable.class); prvate fnal ProcessServce processServce; prvate fnal CommandServce commandServce; prvate ProcessInstanceDao processInstanceDao; prvate TaskInstanceDao taskInstanceDao; prvate TaskDefntonLogDao taskDefntonLogDao; prvate fnal ProcessAlertManager processAlertManager; prvate fnal NettyExecutorManager nettyExecutorManager; prvate fnal ProcessInstance processInstance; prvate ProcessDefnton processDefnton; prvate DAG<Strng, TaskNode, TaskNodeRelaton> dag; /** * unque key of workflow */ prvate Strng key; prvate WorkflowRunnableStatus workflowRunnableStatus = WorkflowRunnableStatus.CREATED; /** * submt falure nodes */ prvate boolean taskFaledSubmt = false; /** * task nstance hash map, taskId as key */ prvate fnal Map<Integer, TaskInstance> taskInstanceMap = new ConcurrentHashMap<>(); /** * runnng taskProcessor, taskCode as key, taskProcessor as value * only on taskProcessor per taskCode */ prvate fnal Map<Long, ITaskProcessor> actveTaskProcessorMaps = new ConcurrentHashMap<>();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
/** * vald task map, taskCode as key, taskId as value * n a DAG, only one taskInstance per taskCode s vald */ prvate fnal Map<Long, Integer> valdTaskMap = new ConcurrentHashMap<>(); /** * error task map, taskCode as key, taskInstanceId as value * n a DAG, only one taskInstance per taskCode s vald */ prvate fnal Map<Long, Integer> errorTaskMap = new ConcurrentHashMap<>(); /** * complete task map, taskCode as key, taskInstanceId as value * n a DAG, only one taskInstance per taskCode s vald */ prvate fnal Map<Long, Integer> completeTaskMap = new ConcurrentHashMap<>(); /** * depend faled task set */ prvate fnal Set<Long> dependFaledTaskSet = Sets.newConcurrentHashSet(); /** * forbdden task map, code as key */ prvate fnal Map<Long, TaskNode> forbddenTaskMap = new ConcurrentHashMap<>(); /** * skp task map, code as key */ prvate fnal Map<Strng, TaskNode> skpTaskNodeMap = new ConcurrentHashMap<>(); /** * complement date lst */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
prvate Lst<Date> complementLstDate = Lsts.newLnkedLst(); /** * state event queue */ prvate fnal ConcurrentLnkedQueue<StateEvent> stateEvents = new ConcurrentLnkedQueue<>(); /** * The StandBy task lst, wll be executed, need to know, the taskInstance n ths queue may doesn't have d. */ prvate fnal PeerTaskInstancePrortyQueue readyToSubmtTaskQueue = new PeerTaskInstancePrortyQueue(); /** * wat to retry taskInstance map, taskCode as key, taskInstance as value * before retry, the taskInstance d s 0 */ prvate fnal Map<Long, TaskInstance> watToRetryTaskInstanceMap = new ConcurrentHashMap<>(); prvate fnal StateWheelExecuteThread stateWheelExecuteThread; prvate fnal CurngParamsServce curngParamsServce; prvate fnal Strng masterAddress; /** * @param processInstance processInstance * @param processServce processServce * @param processInstanceDao processInstanceDao * @param nettyExecutorManager nettyExecutorManager * @param processAlertManager processAlertManager * @param masterConfg masterConfg * @param stateWheelExecuteThread stateWheelExecuteThread */ publc WorkflowExecuteRunnable( @NonNull ProcessInstance processInstance, @NonNull CommandServce commandServce, @NonNull ProcessServce processServce,
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
@NonNull ProcessInstanceDao processInstanceDao, @NonNull NettyExecutorManager nettyExecutorManager, @NonNull ProcessAlertManager processAlertManager, @NonNull MasterConfg masterConfg, @NonNull StateWheelExecuteThread stateWheelExecuteThread, @NonNull CurngParamsServce curngParamsServce, @NonNull TaskInstanceDao taskInstanceDao, @NonNull TaskDefntonLogDao taskDefntonLogDao) { ths.processServce = processServce; ths.commandServce = commandServce; ths.processInstanceDao = processInstanceDao; ths.processInstance = processInstance; ths.nettyExecutorManager = nettyExecutorManager; ths.processAlertManager = processAlertManager; ths.stateWheelExecuteThread = stateWheelExecuteThread; ths.curngParamsServce = curngParamsServce; ths.taskInstanceDao = taskInstanceDao; ths.taskDefntonLogDao = taskDefntonLogDao; ths.masterAddress = NetUtls.getAddr(masterConfg.getLstenPort()); TaskMetrcs.regsterTaskPrepared(readyToSubmtTaskQueue::sze); } /** * the process start nodes are submtted completely. */ publc boolean sStart() { return WorkflowRunnableStatus.STARTED == workflowRunnableStatus; } /** * handle event */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
publc vod handleEvents() { f (!sStart()) { logger.nfo( "The workflow nstance s not started, wll not handle ts state event, current state event sze: {}", stateEvents); return; } nt loopTmes = stateEvents.sze() * 2; for (nt = 0; < loopTmes; ++) { fnal StateEvent stateEvent = ths.stateEvents.peek(); try { f (stateEvent == null) { return; } LoggerUtls.setWorkflowAndTaskInstanceIDMDC(stateEvent.getProcessInstanceId(), stateEvent.getTaskInstanceId()); checkProcessInstance(stateEvent); StateEventHandler stateEventHandler = StateEventHandlerManager.getStateEventHandler(stateEvent.getType()) .orElseThrow(() -> new StateEventHandleError( "Cannot fnd handler for the gven state event")); logger.nfo("Begn to handle state event, {}", stateEvent); f (stateEventHandler.handleStateEvent(ths, stateEvent)) { ths.stateEvents.remove(stateEvent); } } catch (StateEventHandleError stateEventHandleError) { logger.error("State event handle error, wll remove ths event: {}", stateEvent, stateEventHandleError); ths.stateEvents.remove(stateEvent);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
ThreadUtls.sleep(Constants.SLEEP_TIME_MILLIS); } catch (StateEventHandleExcepton stateEventHandleExcepton) { logger.error("State event handle error, wll retry ths event: {}", stateEvent, stateEventHandleExcepton); ThreadUtls.sleep(Constants.SLEEP_TIME_MILLIS); } catch (StateEventHandleFalure stateEventHandleFalure) { logger.error("State event handle faled, wll move event to the tal: {}", stateEvent, stateEventHandleFalure); ths.stateEvents.remove(stateEvent); ths.stateEvents.offer(stateEvent); ThreadUtls.sleep(Constants.SLEEP_TIME_MILLIS); } catch (Excepton e) { logger.error("State event handle error, get a unknown excepton, wll retry ths event: {}", stateEvent, e); ThreadUtls.sleep(Constants.SLEEP_TIME_MILLIS); } fnally { LoggerUtls.removeWorkflowAndTaskInstanceIdMDC(); } } } publc Strng getKey() { f (StrngUtls.sNotEmpty(key) || ths.processDefnton == null) { return key; } key = Strng.format("%d_%d_%d",
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
ths.processDefnton.getCode(), ths.processDefnton.getVerson(), ths.processInstance.getId()); return key; } publc boolean addStateEvent(StateEvent stateEvent) { f (processInstance.getId() != stateEvent.getProcessInstanceId()) { logger.nfo("state event would be abounded :{}", stateEvent); return false; } ths.stateEvents.add(stateEvent); return true; } publc nt eventSze() { return ths.stateEvents.sze(); } publc ProcessInstance getProcessInstance() { return ths.processInstance; } publc boolean checkForceStartAndWakeUp(StateEvent stateEvent) { TaskGroupQueue taskGroupQueue = ths.processServce.loadTaskGroupQueue(stateEvent.getTaskInstanceId()); f (taskGroupQueue.getForceStart() == Flag.YES.getCode()) { TaskInstance taskInstance = ths.taskInstanceDao.fndTaskInstanceById(stateEvent.getTaskInstanceId()); ITaskProcessor taskProcessor = actveTaskProcessorMaps.get(taskInstance.getTaskCode()); taskProcessor.acton(TaskActon.DISPATCH); ths.processServce.updateTaskGroupQueueStatus(taskGroupQueue.getTaskId(), TaskGroupQueueStatus.ACQUIRE_SUCCESS.getCode()); return true; } f (taskGroupQueue.getInQueue() == Flag.YES.getCode()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
boolean acqureTaskGroup = processServce.robTaskGroupResource(taskGroupQueue); f (acqureTaskGroup) { TaskInstance taskInstance = ths.taskInstanceDao.fndTaskInstanceById(stateEvent.getTaskInstanceId()); ITaskProcessor taskProcessor = actveTaskProcessorMaps.get(taskInstance.getTaskCode()); taskProcessor.acton(TaskActon.DISPATCH); return true; } } return false; } publc vod processTmeout() { ProjectUser projectUser = processServce.queryProjectWthUserByProcessInstanceId(processInstance.getId()); ths.processAlertManager.sendProcessTmeoutAlert(ths.processInstance, projectUser); } publc vod taskTmeout(TaskInstance taskInstance) { ProjectUser projectUser = processServce.queryProjectWthUserByProcessInstanceId(processInstance.getId()); processAlertManager.sendTaskTmeoutAlert(processInstance, taskInstance, projectUser); } publc vod taskFnshed(TaskInstance taskInstance) throws StateEventHandleExcepton { logger.nfo("TaskInstance fnshed task code:{} state:{}", taskInstance.getTaskCode(), taskInstance.getState()); try { actveTaskProcessorMaps.remove(taskInstance.getTaskCode()); stateWheelExecuteThread.removeTask4TmeoutCheck(processInstance, taskInstance); stateWheelExecuteThread.removeTask4RetryCheck(processInstance, taskInstance); stateWheelExecuteThread.removeTask4StateCheck(processInstance, taskInstance); f (taskInstance.getState().sSuccess()) { completeTaskMap.put(taskInstance.getTaskCode(), taskInstance.getId()); processInstance.setVarPool(taskInstance.getVarPool()); processInstanceDao.upsertProcessInstance(processInstance);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
f (taskInstance.getIsCache().equals(Flag.YES)) { saveCacheTaskInstance(taskInstance); } f (!processInstance.sBlocked()) { submtPostNode(Long.toStrng(taskInstance.getTaskCode())); } } else f (taskInstance.taskCanRetry() && !processInstance.getState().sReadyStop()) { logger.nfo("Retry taskInstance taskInstance state: {}", taskInstance.getState()); retryTaskInstance(taskInstance); } else f (taskInstance.getState().sFalure()) { completeTaskMap.put(taskInstance.getTaskCode(), taskInstance.getId()); errorTaskMap.put(taskInstance.getTaskCode(), taskInstance.getId()); f (processInstance.getFalureStrategy() == FalureStrategy.CONTINUE && DagHelper.haveAllNodeAfterNode( Long.toStrng(taskInstance.getTaskCode()), dag)) { submtPostNode(Long.toStrng(taskInstance.getTaskCode())); } else { f (processInstance.getFalureStrategy() == FalureStrategy.END) { kllAllTasks(); } } } else f (taskInstance.getState().sFnshed()) { completeTaskMap.put(taskInstance.getTaskCode(), taskInstance.getId()); } logger.nfo("TaskInstance fnshed wll try to update the workflow nstance state, task code:{} state:{}", taskInstance.getTaskCode(),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
taskInstance.getState()); ths.updateProcessInstanceState(); } catch (Excepton ex) { logger.error("Task fnsh faled, get a excepton, wll remove ths taskInstance from completeTaskMap", ex); completeTaskMap.remove(taskInstance.getTaskCode()); throw ex; } } /** * release task group * */ publc vod releaseTaskGroup(TaskInstance taskInstance) { logger.nfo("Release task group"); f (taskInstance.getTaskGroupId() > 0) { TaskInstance nextTaskInstance = ths.processServce.releaseTaskGroup(taskInstance); f (nextTaskInstance != null) { f (nextTaskInstance.getProcessInstanceId() == taskInstance.getProcessInstanceId()) { TaskStateEvent nextEvent = TaskStateEvent.bulder() .processInstanceId(processInstance.getId()) .taskInstanceId(nextTaskInstance.getId()) .type(StateEventType.WAIT_TASK_GROUP) .buld(); ths.stateEvents.add(nextEvent); } else { ProcessInstance processInstance = ths.processServce.fndProcessInstanceById(nextTaskInstance.getProcessInstanceId()); ths.processServce.sendStartTask2Master(processInstance, nextTaskInstance.getId(), org.apache.dolphnscheduler.remote.command.CommandType.TASK_WAKEUP_EVENT_REQUEST);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
} } } } /** * crate new task nstance to retry, dfferent objects from the orgnal * */ prvate vod retryTaskInstance(TaskInstance taskInstance) throws StateEventHandleExcepton { f (!taskInstance.taskCanRetry()) { return; } TaskInstance newTaskInstance = cloneRetryTaskInstance(taskInstance); f (newTaskInstance == null) { logger.error("Retry task fal because new taskInstance s null, task code:{}, task d:{}", taskInstance.getTaskCode(), taskInstance.getId()); return; } watToRetryTaskInstanceMap.put(newTaskInstance.getTaskCode(), newTaskInstance); f (!taskInstance.retryTaskIntervalOverTme()) { logger.nfo( "Falure task wll be submtted, process d: {}, task nstance code: {}, state: {}, retry tmes: {} / {}, nterval: {}", processInstance.getId(), newTaskInstance.getTaskCode(), newTaskInstance.getState(), newTaskInstance.getRetryTmes(), newTaskInstance.getMaxRetryTmes(), newTaskInstance.getRetryInterval()); stateWheelExecuteThread.addTask4TmeoutCheck(processInstance, newTaskInstance); stateWheelExecuteThread.addTask4RetryCheck(processInstance, newTaskInstance); } else { addTaskToStandByLst(newTaskInstance);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
submtStandByTask(); watToRetryTaskInstanceMap.remove(newTaskInstance.getTaskCode()); } } /** * update process nstance */ publc vod refreshProcessInstance(nt processInstanceId) { logger.nfo("process nstance update: {}", processInstanceId); ProcessInstance newProcessInstance = processServce.fndProcessInstanceById(processInstanceId); BeanUtls.copyPropertes(newProcessInstance, processInstance); processDefnton = processServce.fndProcessDefnton(processInstance.getProcessDefntonCode(), processInstance.getProcessDefntonVerson()); processInstance.setProcessDefnton(processDefnton); } /** * update task nstance */ publc vod refreshTaskInstance(nt taskInstanceId) { logger.nfo("task nstance update: {} ", taskInstanceId); TaskInstance taskInstance = taskInstanceDao.fndTaskInstanceById(taskInstanceId); f (taskInstance == null) { logger.error("can not fnd task nstance, d:{}", taskInstanceId); return; } processServce.packageTaskInstance(taskInstance, processInstance); taskInstanceMap.put(taskInstance.getId(), taskInstance); valdTaskMap.remove(taskInstance.getTaskCode()); f (Flag.YES == taskInstance.getFlag()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
valdTaskMap.put(taskInstance.getTaskCode(), taskInstance.getId()); } } /** * check process nstance by state event */ publc vod checkProcessInstance(StateEvent stateEvent) throws StateEventHandleError { f (ths.processInstance.getId() != stateEvent.getProcessInstanceId()) { throw new StateEventHandleError("The event doesn't contans process nstance d"); } } /** * check f task nstance exst by state event */ publc vod checkTaskInstanceByStateEvent(TaskStateEvent stateEvent) throws StateEventHandleError { f (stateEvent.getTaskInstanceId() == null || stateEvent.getTaskInstanceId() == 0) { throw new StateEventHandleError("The taskInstanceId s 0"); } f (!taskInstanceMap.contansKey(stateEvent.getTaskInstanceId())) { throw new StateEventHandleError("Cannot fnd the taskInstance from taskInstanceMap"); } } /** * check f task nstance exst by d */ publc boolean checkTaskInstanceById(nt taskInstanceId) { f (taskInstanceMap.sEmpty()) { return false; } return taskInstanceMap.contansKey(taskInstanceId);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
} /** * get task nstance from memory */ publc Optonal<TaskInstance> getTaskInstance(nt taskInstanceId) { return Optonal.ofNullable(taskInstanceMap.get(taskInstanceId)); } publc Optonal<TaskInstance> getTaskInstance(long taskCode) { f (taskInstanceMap.sEmpty()) { return Optonal.empty(); } for (TaskInstance taskInstance : taskInstanceMap.values()) { f (taskInstance.getTaskCode() == taskCode) { return Optonal.of(taskInstance); } } return Optonal.empty(); } publc Optonal<TaskInstance> getActveTaskInstanceByTaskCode(long taskCode) { Integer taskInstanceId = valdTaskMap.get(taskCode); f (taskInstanceId != null) { return Optonal.ofNullable(taskInstanceMap.get(taskInstanceId)); } return Optonal.empty(); } publc Optonal<TaskInstance> getRetryTaskInstanceByTaskCode(long taskCode) { f (watToRetryTaskInstanceMap.contansKey(taskCode)) { return Optonal.ofNullable(watToRetryTaskInstanceMap.get(taskCode)); } return Optonal.empty();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
} publc vod processBlock() { ProjectUser projectUser = processServce.queryProjectWthUserByProcessInstanceId(processInstance.getId()); processAlertManager.sendProcessBlockngAlert(processInstance, projectUser); logger.nfo("processInstance {} block alert send successful!", processInstance.getId()); } publc boolean processComplementData() { f (!needComplementProcess()) { return false; } f (processInstance.getState().sReadyStop() || !processInstance.getState().sFnshed()) { return false; } Date scheduleDate = processInstance.getScheduleTme(); f (scheduleDate == null) { scheduleDate = complementLstDate.get(0); } else f (processInstance.getState().sFnshed()) { endProcess(); f (complementLstDate.sEmpty()) { logger.nfo("process complement end. process d:{}", processInstance.getId()); return true; } nt ndex = complementLstDate.ndexOf(scheduleDate); f (ndex >= complementLstDate.sze() - 1 || !processInstance.getState().sSuccess()) { logger.nfo("process complement end. process d:{}", processInstance.getId()); return true; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
logger.nfo("process complement contnue. process d:{}, schedule tme:{} complementLstDate:{}", processInstance.getId(), processInstance.getScheduleTme(), complementLstDate); scheduleDate = complementLstDate.get(ndex + 1); } nt create = ths.createComplementDataCommand(scheduleDate); f (create > 0) { logger.nfo("create complement data command successfully."); } return true; } prvate nt createComplementDataCommand(Date scheduleDate) { Command command = new Command(); command.setScheduleTme(scheduleDate); command.setCommandType(CommandType.COMPLEMENT_DATA); command.setProcessDefntonCode(processInstance.getProcessDefntonCode()); Map<Strng, Strng> cmdParam = JSONUtls.toMap(processInstance.getCommandParam()); f (cmdParam.contansKey(CMD_PARAM_RECOVERY_START_NODE_STRING)) { cmdParam.remove(CMD_PARAM_RECOVERY_START_NODE_STRING); } f (cmdParam.contansKey(CMD_PARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST)) { cmdParam.replace(CMD_PARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST, cmdParam.get(CMD_PARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST) .substrng(cmdParam.get(CMD_PARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST).ndexOf(COMMA) + 1)); } f (cmdParam.contansKey(CMD_PARAM_COMPLEMENT_DATA_START_DATE)) { cmdParam.replace(CMD_PARAM_COMPLEMENT_DATA_START_DATE, DateUtls.format(scheduleDate, YYYY_MM_DD_HH_MM_SS, null)); } command.setCommandParam(JSONUtls.toJsonStrng(cmdParam));
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
command.setTaskDependType(processInstance.getTaskDependType()); command.setFalureStrategy(processInstance.getFalureStrategy()); command.setWarnngType(processInstance.getWarnngType()); command.setWarnngGroupId(processInstance.getWarnngGroupId()); command.setStartTme(new Date()); command.setExecutorId(processInstance.getExecutorId()); command.setUpdateTme(new Date()); command.setProcessInstanceProrty(processInstance.getProcessInstanceProrty()); command.setWorkerGroup(processInstance.getWorkerGroup()); command.setEnvronmentCode(processInstance.getEnvronmentCode()); command.setDryRun(processInstance.getDryRun()); command.setProcessInstanceId(0); command.setProcessDefntonVerson(processInstance.getProcessDefntonVerson()); command.setTestFlag(processInstance.getTestFlag()); return commandServce.createCommand(command); } prvate boolean needComplementProcess() { return processInstance.sComplementData() && Flag.NO == processInstance.getIsSubProcess(); } /** * ProcessInstance start entrypont. */ @Overrde publc WorkflowSubmtStatue call() { f (sStart()) { logger.warn("[WorkflowInstance-{}] The workflow has already been started", processInstance.getId()); return WorkflowSubmtStatue.DUPLICATED_SUBMITTED; } try {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
LoggerUtls.setWorkflowInstanceIdMDC(processInstance.getId()); f (workflowRunnableStatus == WorkflowRunnableStatus.CREATED) { buldFlowDag(); workflowRunnableStatus = WorkflowRunnableStatus.INITIALIZE_DAG; logger.nfo("workflowStatue changed to :{}", workflowRunnableStatus); } f (workflowRunnableStatus == WorkflowRunnableStatus.INITIALIZE_DAG) { ntTaskQueue(); workflowRunnableStatus = WorkflowRunnableStatus.INITIALIZE_QUEUE; logger.nfo("workflowStatue changed to :{}", workflowRunnableStatus); } f (workflowRunnableStatus == WorkflowRunnableStatus.INITIALIZE_QUEUE) { submtPostNode(null); workflowRunnableStatus = WorkflowRunnableStatus.STARTED; logger.nfo("workflowStatue changed to :{}", workflowRunnableStatus); } return WorkflowSubmtStatue.SUCCESS; } catch (Excepton e) { logger.error("Start workflow error", e); return WorkflowSubmtStatue.FAILED; } fnally { LoggerUtls.removeWorkflowInstanceIdMDC(); } } /** * process end handle */ publc vod endProcess() { ths.stateEvents.clear(); f (processDefnton.getExecutonType().typeIsSeralWat() || processDefnton.getExecutonType()
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
.typeIsSeralProrty()) { checkSeralProcess(processDefnton); } ProjectUser projectUser = processServce.queryProjectWthUserByProcessInstanceId(processInstance.getId()); processAlertManager.sendAlertProcessInstance(processInstance, getValdTaskLst(), projectUser); f (processInstance.getState().sSuccess()) { processAlertManager.closeAlert(processInstance); } f (checkTaskQueue()) { processServce.releaseAllTaskGroup(processInstance.getId()); } } publc vod checkSeralProcess(ProcessDefnton processDefnton) { nt nextInstanceId = processInstance.getNextProcessInstanceId(); f (nextInstanceId == 0) { ProcessInstance nextProcessInstance = ths.processServce.loadNextProcess4Seral(processInstance.getProcessDefnton().getCode(), WorkflowExecutonStatus.SERIAL_WAIT.getCode(), processInstance.getId()); f (nextProcessInstance == null) { return; } ProcessInstance nextReadyStopProcessInstance = ths.processServce.loadNextProcess4Seral(processInstance.getProcessDefnton().getCode(), WorkflowExecutonStatus.READY_STOP.getCode(), processInstance.getId()); f (processDefnton.getExecutonType().typeIsSeralProrty() && nextReadyStopProcessInstance != null) { return; } nextInstanceId = nextProcessInstance.getId(); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
ProcessInstance nextProcessInstance = ths.processServce.fndProcessInstanceById(nextInstanceId); f (nextProcessInstance.getState().sFnshed() || nextProcessInstance.getState().sRunnng()) { return; } Map<Strng, Object> cmdParam = new HashMap<>(); cmdParam.put(CMD_PARAM_RECOVER_PROCESS_ID_STRING, nextInstanceId); Command command = new Command(); command.setCommandType(CommandType.RECOVER_SERIAL_WAIT); command.setProcessInstanceId(nextProcessInstance.getId()); command.setProcessDefntonCode(processDefnton.getCode()); command.setProcessDefntonVerson(processDefnton.getVerson()); command.setCommandParam(JSONUtls.toJsonStrng(cmdParam)); commandServce.createCommand(command); } /** * Generate process dag * * @throws Excepton excepton */ prvate vod buldFlowDag() throws Excepton { processDefnton = processServce.fndProcessDefnton(processInstance.getProcessDefntonCode(), processInstance.getProcessDefntonVerson()); processInstance.setProcessDefnton(processDefnton); Lst<TaskInstance> recoverNodeLst = getRecoverTaskInstanceLst(processInstance.getCommandParam()); Lst<ProcessTaskRelaton> processTaskRelatons = processServce.fndRelatonByCode(processDefnton.getCode(), processDefnton.getVerson()); Lst<TaskDefntonLog> taskDefntonLogs = taskDefntonLogDao.getTaskDefneLogLstByRelaton(processTaskRelatons); Lst<TaskNode> taskNodeLst = processServce.transformTask(processTaskRelatons, taskDefntonLogs); forbddenTaskMap.clear();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
taskNodeLst.forEach(taskNode -> { f (taskNode.sForbdden()) { forbddenTaskMap.put(taskNode.getCode(), taskNode); } }); Lst<Strng> recoveryNodeCodeLst = getRecoveryNodeCodeLst(recoverNodeLst); Lst<Strng> startNodeNameLst = parseStartNodeName(processInstance.getCommandParam()); ProcessDag processDag = generateFlowDag(taskNodeLst, startNodeNameLst, recoveryNodeCodeLst, processInstance.getTaskDependType()); f (processDag == null) { logger.error("ProcessDag s null"); return; } dag = DagHelper.buldDagGraph(processDag); logger.nfo("Buld dag success, dag: {}", dag); } /** * nt task queue */ prvate vod ntTaskQueue() throws StateEventHandleExcepton, CronParseExcepton { taskFaledSubmt = false; actveTaskProcessorMaps.clear(); dependFaledTaskSet.clear(); completeTaskMap.clear(); errorTaskMap.clear(); f (!sNewProcessInstance()) { logger.nfo("The workflowInstance s not a newly runnng nstance, runtmes: {}, recover flag: {}", processInstance.getRunTmes(),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
processInstance.getRecovery()); Lst<TaskInstance> valdTaskInstanceLst = taskInstanceDao.fndValdTaskLstByProcessId(processInstance.getId(), processInstance.getTestFlag()); for (TaskInstance task : valdTaskInstanceLst) { try { LoggerUtls.setWorkflowAndTaskInstanceIDMDC(task.getProcessInstanceId(), task.getId()); logger.nfo( "Check the taskInstance from a exst workflowInstance, exstTaskInstanceCode: {}, taskInstanceStatus: {}", task.getTaskCode(), task.getState()); f (valdTaskMap.contansKey(task.getTaskCode())) { logger.warn( "Have same taskCode taskInstance when nt task queue, need to check taskExecutonStatus, taskCode:{}", task.getTaskCode()); nt oldTaskInstanceId = valdTaskMap.get(task.getTaskCode()); TaskInstance oldTaskInstance = taskInstanceMap.get(oldTaskInstanceId); f (!oldTaskInstance.getState().sFnshed() && task.getState().sFnshed()) { task.setFlag(Flag.NO); taskInstanceDao.updateTaskInstance(task); contnue; } } valdTaskMap.put(task.getTaskCode(), task.getId()); taskInstanceMap.put(task.getId(), task); f (task.sTaskComplete()) { logger.nfo("TaskInstance s already complete."); completeTaskMap.put(task.getTaskCode(), task.getId()); contnue; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
f (task.sCondtonsTask() || DagHelper.haveCondtonsAfterNode(Long.toStrng(task.getTaskCode()), dag)) { contnue; } f (task.taskCanRetry()) { f (task.getState().sNeedFaultTolerance()) { logger.nfo("TaskInstance needs fault tolerance, wll be added to standby lst."); task.setFlag(Flag.NO); taskInstanceDao.updateTaskInstance(task); TaskInstance tolerantTaskInstance = cloneTolerantTaskInstance(task); addTaskToStandByLst(tolerantTaskInstance); } else { logger.nfo("Retry taskInstance, taskState: {}", task.getState()); retryTaskInstance(task); } contnue; } f (task.getState().sFalure()) { errorTaskMap.put(task.getTaskCode(), task.getId()); } } fnally { LoggerUtls.removeWorkflowAndTaskInstanceIdMDC(); } } clearDataIfExecuteTask(); } else { logger.nfo("The current workflowInstance s a newly runnng workflowInstance"); } f (processInstance.sComplementData() && complementLstDate.sEmpty()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
Map<Strng, Strng> cmdParam = JSONUtls.toMap(processInstance.getCommandParam()); f (cmdParam != null) { setGlobalParamIfCommanded(processDefnton, cmdParam); Date start = null; Date end = null; f (cmdParam.contansKey(CMD_PARAM_COMPLEMENT_DATA_START_DATE) && cmdParam.contansKey(CMD_PARAM_COMPLEMENT_DATA_END_DATE)) { start = DateUtls.strngToDate(cmdParam.get(CMD_PARAM_COMPLEMENT_DATA_START_DATE)); end = DateUtls.strngToDate(cmdParam.get(CMD_PARAM_COMPLEMENT_DATA_END_DATE)); } f (complementLstDate.sEmpty() && needComplementProcess()) { f (start != null && end != null) { Lst<Schedule> schedules = processServce.queryReleaseSchedulerLstByProcessDefntonCode( processInstance.getProcessDefntonCode()); complementLstDate = CronUtls.getSelfFreDateLst(start, end, schedules); } f (cmdParam.contansKey(CMD_PARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST)) { complementLstDate = CronUtls.getSelfScheduleDateLst(cmdParam); } logger.nfo(" process defnton code:{} complement data: {}", processInstance.getProcessDefntonCode(), complementLstDate); f (!complementLstDate.sEmpty() && Flag.NO == processInstance.getIsSubProcess()) { processInstance.setScheduleTme(complementLstDate.get(0)); Strng globalParams = curngParamsServce.curngGlobalParams(processInstance.getId(), processDefnton.getGlobalParamMap(), processDefnton.getGlobalParamLst(), CommandType.COMPLEMENT_DATA, processInstance.getScheduleTme(), cmdParam.get(Constants.SCHEDULE_TIMEZONE));
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
processInstance.setGlobalParams(globalParams); processInstanceDao.updateProcessInstance(processInstance); } } } } logger.nfo("Intalze task queue, dependFaledTaskSet: {}, completeTaskMap: {}, errorTaskMap: {}", dependFaledTaskSet, completeTaskMap, errorTaskMap); } /** * submt task to execute * * @param taskInstance task nstance * @return TaskInstance */ prvate Optonal<TaskInstance> submtTaskExec(TaskInstance taskInstance) { try { processServce.packageTaskInstance(taskInstance, processInstance); ITaskProcessor taskProcessor = TaskProcessorFactory.getTaskProcessor(taskInstance.getTaskType()); taskProcessor.nt(taskInstance, processInstance); f (taskInstance.getState().sRunnng() && taskProcessor.getType().equalsIgnoreCase(Constants.COMMON_TASK_TYPE)) { notfyProcessHostUpdate(taskInstance); } boolean submt = taskProcessor.acton(TaskActon.SUBMIT); f (!submt) { logger.error("Submt standby task faled!, taskCode: {}, taskName: {}",
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
taskInstance.getTaskCode(), taskInstance.getName()); return Optonal.empty(); } LoggerUtls.setWorkflowAndTaskInstanceIDMDC(taskInstance.getProcessInstanceId(), taskInstance.getId()); f (valdTaskMap.contansKey(taskInstance.getTaskCode())) { nt oldTaskInstanceId = valdTaskMap.get(taskInstance.getTaskCode()); f (taskInstance.getId() != oldTaskInstanceId) { TaskInstance oldTaskInstance = taskInstanceMap.get(oldTaskInstanceId); oldTaskInstance.setFlag(Flag.NO); taskInstanceDao.updateTaskInstance(oldTaskInstance); valdTaskMap.remove(taskInstance.getTaskCode()); actveTaskProcessorMaps.remove(taskInstance.getTaskCode()); } } valdTaskMap.put(taskInstance.getTaskCode(), taskInstance.getId()); taskInstanceMap.put(taskInstance.getId(), taskInstance); actveTaskProcessorMaps.put(taskInstance.getTaskCode(), taskProcessor); nt taskGroupId = taskInstance.getTaskGroupId(); f (taskGroupId > 0) { boolean acqureTaskGroup = processServce.acqureTaskGroup(taskInstance.getId(), taskInstance.getName(), taskGroupId, taskInstance.getProcessInstanceId(), taskInstance.getTaskGroupProrty()); f (!acqureTaskGroup) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
logger.nfo( "Submtted task wll not be dspatch rght now because the frst tme to try to acqure" + " task group faled, taskInstanceName: {}, taskGroupId: {}", taskInstance.getName(), taskGroupId); return Optonal.of(taskInstance); } } boolean dspatchSuccess = taskProcessor.acton(TaskActon.DISPATCH); f (!dspatchSuccess) { logger.error("Dspatch standby process {} task {} faled", processInstance.getName(), taskInstance.getName()); return Optonal.empty(); } taskProcessor.acton(TaskActon.RUN); stateWheelExecuteThread.addTask4TmeoutCheck(processInstance, taskInstance); stateWheelExecuteThread.addTask4StateCheck(processInstance, taskInstance); f (taskProcessor.taskInstance().getState().sFnshed()) { f (processInstance.sBlocked()) { TaskStateEvent processBlockEvent = TaskStateEvent.bulder() .processInstanceId(processInstance.getId()) .taskInstanceId(taskInstance.getId()) .status(taskProcessor.taskInstance().getState()) .type(StateEventType.PROCESS_BLOCKED) .buld(); ths.stateEvents.add(processBlockEvent); } TaskStateEvent taskStateChangeEvent = TaskStateEvent.bulder() .processInstanceId(processInstance.getId()) .taskInstanceId(taskInstance.getId()) .status(taskProcessor.taskInstance().getState())
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
.type(StateEventType.TASK_STATE_CHANGE) .buld(); ths.stateEvents.add(taskStateChangeEvent); } return Optonal.of(taskInstance); } catch (Excepton e) { logger.error("Submt standby task {} error, taskCode: {}", taskInstance.getName(), taskInstance.getTaskCode(), e); return Optonal.empty(); } fnally { LoggerUtls.removeWorkflowAndTaskInstanceIdMDC(); } } prvate vod notfyProcessHostUpdate(TaskInstance taskInstance) { f (StrngUtls.sEmpty(taskInstance.getHost())) { return; } try { HostUpdateCommand hostUpdateCommand = new HostUpdateCommand(); hostUpdateCommand.setProcessHost(masterAddress); hostUpdateCommand.setTaskInstanceId(taskInstance.getId()); Host host = new Host(taskInstance.getHost()); nettyExecutorManager.doExecute(host, hostUpdateCommand.convert2Command()); } catch (Excepton e) { logger.error("notfy process host update", e); } } /** * fnd task nstance n db.
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
* n case submt more than one same name task n the same tme. * * @param taskCode task code * @param taskVerson task verson * @return TaskInstance */ prvate TaskInstance fndTaskIfExsts(Long taskCode, nt taskVerson) { Lst<TaskInstance> valdTaskInstanceLst = getValdTaskLst(); for (TaskInstance taskInstance : valdTaskInstanceLst) { f (taskInstance.getTaskCode() == taskCode && taskInstance.getTaskDefntonVerson() == taskVerson) { return taskInstance; } } return null; } /** * encapsulaton task, ths method wll only create a new task nstance, the return task nstance wll not contan d. * * @param processInstance process nstance * @param taskNode taskNode * @return TaskInstance */ prvate TaskInstance createTaskInstance(ProcessInstance processInstance, TaskNode taskNode) { TaskInstance taskInstance = fndTaskIfExsts(taskNode.getCode(), taskNode.getVerson()); f (taskInstance != null) { return taskInstance; } return newTaskInstance(processInstance, taskNode); } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
* clone a new taskInstance for retry and reset some logc felds * * @return taskInstance */ publc TaskInstance cloneRetryTaskInstance(TaskInstance taskInstance) { TaskNode taskNode = dag.getNode(Long.toStrng(taskInstance.getTaskCode())); f (taskNode == null) { logger.error("Clone retry taskInstance error because taskNode s null, taskCode:{}", taskInstance.getTaskCode()); return null; } TaskInstance newTaskInstance = newTaskInstance(processInstance, taskNode); newTaskInstance.setTaskDefne(taskInstance.getTaskDefne()); newTaskInstance.setProcessDefne(taskInstance.getProcessDefne()); newTaskInstance.setProcessInstance(processInstance); newTaskInstance.setRetryTmes(taskInstance.getRetryTmes() + 1); newTaskInstance.setState(taskInstance.getState()); newTaskInstance.setEndTme(taskInstance.getEndTme()); f (taskInstance.getState() == TaskExecutonStatus.NEED_FAULT_TOLERANCE) { newTaskInstance.setAppLnk(taskInstance.getAppLnk()); } return newTaskInstance; } /** * clone a new taskInstance for tolerant and reset some logc felds * * @return taskInstance */ publc TaskInstance cloneTolerantTaskInstance(TaskInstance taskInstance) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
TaskNode taskNode = dag.getNode(Long.toStrng(taskInstance.getTaskCode())); f (taskNode == null) { logger.error("Clone tolerant taskInstance error because taskNode s null, taskCode:{}", taskInstance.getTaskCode()); return null; } TaskInstance newTaskInstance = newTaskInstance(processInstance, taskNode); newTaskInstance.setTaskDefne(taskInstance.getTaskDefne()); newTaskInstance.setProcessDefne(taskInstance.getProcessDefne()); newTaskInstance.setProcessInstance(processInstance); newTaskInstance.setRetryTmes(taskInstance.getRetryTmes()); newTaskInstance.setState(taskInstance.getState()); newTaskInstance.setAppLnk(taskInstance.getAppLnk()); return newTaskInstance; } /** * new a taskInstance * * @param processInstance process nstance * @param taskNode task node * @return task nstance */ publc TaskInstance newTaskInstance(ProcessInstance processInstance, TaskNode taskNode) { TaskInstance taskInstance = new TaskInstance(); taskInstance.setTaskCode(taskNode.getCode()); taskInstance.setTaskDefntonVerson(taskNode.getVerson()); taskInstance.setName(taskNode.getName()); taskInstance.setState(TaskExecutonStatus.SUBMITTED_SUCCESS);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
taskInstance.setProcessInstanceId(processInstance.getId()); taskInstance.setTaskType(taskNode.getType().toUpperCase()); taskInstance.setAlertFlag(Flag.NO); taskInstance.setStartTme(null); taskInstance.setTestFlag(processInstance.getTestFlag()); taskInstance.setFlag(Flag.YES); taskInstance.setDryRun(processInstance.getDryRun()); taskInstance.setRetryTmes(0); taskInstance.setMaxRetryTmes(taskNode.getMaxRetryTmes()); taskInstance.setRetryInterval(taskNode.getRetryInterval()); taskInstance.setTaskParams(taskNode.getTaskParams()); taskInstance.setTaskGroupId(taskNode.getTaskGroupId()); taskInstance.setTaskGroupProrty(taskNode.getTaskGroupProrty()); taskInstance.setCpuQuota(taskNode.getCpuQuota()); taskInstance.setMemoryMax(taskNode.getMemoryMax()); taskInstance.setIsCache(taskNode.getIsCache() == Flag.YES.getCode() ? Flag.YES : Flag.NO);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
f (taskNode.getTaskInstanceProrty() == null) { taskInstance.setTaskInstanceProrty(Prorty.MEDIUM); } else { taskInstance.setTaskInstanceProrty(taskNode.getTaskInstanceProrty()); } Strng processWorkerGroup = processInstance.getWorkerGroup(); processWorkerGroup = StrngUtls.sBlank(processWorkerGroup) ? DEFAULT_WORKER_GROUP : processWorkerGroup; Strng taskWorkerGroup = StrngUtls.sBlank(taskNode.getWorkerGroup()) ? processWorkerGroup : taskNode.getWorkerGroup(); Long processEnvronmentCode = Objects.sNull(processInstance.getEnvronmentCode()) ? -1 : processInstance.getEnvronmentCode(); Long taskEnvronmentCode = Objects.sNull(taskNode.getEnvronmentCode()) ? processEnvronmentCode : taskNode.getEnvronmentCode(); f (!processWorkerGroup.equals(DEFAULT_WORKER_GROUP) && taskWorkerGroup.equals(DEFAULT_WORKER_GROUP)) { taskInstance.setWorkerGroup(processWorkerGroup); taskInstance.setEnvronmentCode(processEnvronmentCode); } else { taskInstance.setWorkerGroup(taskWorkerGroup); taskInstance.setEnvronmentCode(taskEnvronmentCode); } f (!taskInstance.getEnvronmentCode().equals(-1L)) { Envronment envronment = processServce.fndEnvronmentByCode(taskInstance.getEnvronmentCode()); f (Objects.nonNull(envronment) && StrngUtls.sNotEmpty(envronment.getConfg())) { taskInstance.setEnvronmentConfg(envronment.getConfg()); } } taskInstance.setDelayTme(taskNode.getDelayTme()); taskInstance.setTaskExecuteType(taskNode.getTaskExecuteType()); return taskInstance;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
} publc vod getPreVarPool(TaskInstance taskInstance, Set<Strng> preTask) { Map<Strng, Property> allProperty = new HashMap<>(); Map<Strng, TaskInstance> allTaskInstance = new HashMap<>(); f (CollectonUtls.sNotEmpty(preTask)) { for (Strng preTaskCode : preTask) { Integer taskId = completeTaskMap.get(Long.parseLong(preTaskCode)); f (taskId == null) { contnue; } TaskInstance preTaskInstance = taskInstanceMap.get(taskId); f (preTaskInstance == null) { contnue; } Strng preVarPool = preTaskInstance.getVarPool(); f (StrngUtls.sNotEmpty(preVarPool)) { Lst<Property> propertes = JSONUtls.toLst(preVarPool, Property.class); for (Property nfo : propertes) { setVarPoolValue(allProperty, allTaskInstance, preTaskInstance, nfo); } } } f (allProperty.sze() > 0) { taskInstance.setVarPool(JSONUtls.toJsonStrng(allProperty.values())); } } else { f (StrngUtls.sNotEmpty(processInstance.getVarPool())) { taskInstance.setVarPool(processInstance.getVarPool()); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
} publc Collecton<TaskInstance> getAllTaskInstances() { return taskInstanceMap.values(); } prvate vod setVarPoolValue(Map<Strng, Property> allProperty, Map<Strng, TaskInstance> allTaskInstance, TaskInstance preTaskInstance, Property thsProperty) { thsProperty.setDrect(Drect.IN); Strng proName = thsProperty.getProp(); f (allProperty.contansKey(proName)) { Property otherPro = allProperty.get(proName); f (StrngUtls.sEmpty(thsProperty.getValue())) { allProperty.put(proName, otherPro); } else f (StrngUtls.sNotEmpty(otherPro.getValue())) { TaskInstance otherTask = allTaskInstance.get(proName); f (otherTask.getEndTme().getTme() > preTaskInstance.getEndTme().getTme()) { allProperty.put(proName, thsProperty); allTaskInstance.put(proName, preTaskInstance); } else { allProperty.put(proName, otherPro); } } else { allProperty.put(proName, thsProperty); allTaskInstance.put(proName, preTaskInstance); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
} else { allProperty.put(proName, thsProperty); allTaskInstance.put(proName, preTaskInstance); } } /** * get complete task nstance map, taskCode as key */ prvate Map<Strng, TaskInstance> getCompleteTaskInstanceMap() { Map<Strng, TaskInstance> completeTaskInstanceMap = new HashMap<>(); for (Map.Entry<Long, Integer> entry : completeTaskMap.entrySet()) { Long taskConde = entry.getKey(); Integer taskInstanceId = entry.getValue(); TaskInstance taskInstance = taskInstanceMap.get(taskInstanceId); f (taskInstance == null) { logger.warn("Cannot fnd the taskInstance from taskInstanceMap, taskInstanceId: {}, taskConde: {}", taskInstanceId, taskConde); contnue; } completeTaskInstanceMap.put(Long.toStrng(taskInstance.getTaskCode()), taskInstance); } return completeTaskInstanceMap; } /** * get vald task lst */ prvate Lst<TaskInstance> getValdTaskLst() { Lst<TaskInstance> valdTaskInstanceLst = new ArrayLst<>();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
for (Integer taskInstanceId : valdTaskMap.values()) { valdTaskInstanceLst.add(taskInstanceMap.get(taskInstanceId)); } return valdTaskInstanceLst; } prvate vod submtPostNode(Strng parentNodeCode) throws StateEventHandleExcepton { Set<Strng> submtTaskNodeLst = DagHelper.parsePostNodes(parentNodeCode, skpTaskNodeMap, dag, getCompleteTaskInstanceMap()); Lst<TaskInstance> taskInstances = new ArrayLst<>(); for (Strng taskNode : submtTaskNodeLst) { TaskNode taskNodeObject = dag.getNode(taskNode); Optonal<TaskInstance> exstTaskInstanceOptonal = getTaskInstance(taskNodeObject.getCode()); f (exstTaskInstanceOptonal.sPresent()) { taskInstances.add(exstTaskInstanceOptonal.get()); contnue; } TaskInstance task = createTaskInstance(processInstance, taskNodeObject); taskInstances.add(task); } f (StrngUtls.sNotEmpty(parentNodeCode) && dag.getEndNode().contans(parentNodeCode)) { TaskInstance endTaskInstance = taskInstanceMap.get(completeTaskMap.get(NumberUtls.toLong(parentNodeCode))); Strng taskInstanceVarPool = endTaskInstance.getVarPool(); f (StrngUtls.sNotEmpty(taskInstanceVarPool)) { Set<Property> taskPropertes = new HashSet<>(JSONUtls.toLst(taskInstanceVarPool, Property.class)); Strng processInstanceVarPool = processInstance.getVarPool(); f (StrngUtls.sNotEmpty(processInstanceVarPool)) { Set<Property> propertes = new HashSet<>(JSONUtls.toLst(processInstanceVarPool, Property.class)); propertes.addAll(taskPropertes); processInstance.setVarPool(JSONUtls.toJsonStrng(propertes));
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
} else { processInstance.setVarPool(JSONUtls.toJsonStrng(taskPropertes)); } } } for (TaskInstance task : taskInstances) { f (readyToSubmtTaskQueue.contans(task)) { logger.warn("Task s already at submt queue, taskInstanceId: {}", task.getId()); contnue; } f (task.getId() != null && completeTaskMap.contansKey(task.getTaskCode())) { logger.nfo("Task has already run success, taskName: {}", task.getName()); contnue; } f (task.getState().sKll()) { logger.nfo("Task s be stopped, the state s {}, taskInstanceId: {}", task.getState(), task.getId()); contnue; } addTaskToStandByLst(task); } submtStandByTask(); updateProcessInstanceState(); } /** * determne whether the dependences of the task node are complete * * @return DependResult */ prvate DependResult sTaskDepsComplete(Strng taskCode) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
Collecton<Strng> startNodes = dag.getBegnNode(); f (startNodes.contans(taskCode)) { return DependResult.SUCCESS; } TaskNode taskNode = dag.getNode(taskCode); Lst<Strng> ndrectDepCodeLst = new ArrayLst<>(); setIndrectDepLst(taskCode, ndrectDepCodeLst); for (Strng depsNode : ndrectDepCodeLst) { f (dag.contansNode(depsNode) && !skpTaskNodeMap.contansKey(depsNode)) { Long despNodeTaskCode = Long.parseLong(depsNode); f (!completeTaskMap.contansKey(despNodeTaskCode)) { return DependResult.WAITING; } Integer depsTaskId = completeTaskMap.get(despNodeTaskCode); TaskExecutonStatus depTaskState = taskInstanceMap.get(depsTaskId).getState(); f (depTaskState.sKll()) { return DependResult.NON_EXEC; } f (taskNode.sBlockngTask()) { contnue; } f (taskNode.sCondtonsTask()) { contnue; } f (!dependTaskSuccess(depsNode, taskCode)) { return DependResult.FAILED;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
} } } logger.nfo("The dependTasks of task all success, currentTaskCode: {}, dependTaskCodes: {}", taskCode, Arrays.toStrng(completeTaskMap.keySet().toArray())); return DependResult.SUCCESS; } /** * Ths functon s specally used to handle the dependency stuaton where the parent node s a prohbted node. * When the parent node s a forbdden node, the dependency relatonshp should contnue to be traced * * @param taskCode taskCode * @param ndrectDepCodeLst All ndrectly dependent nodes */ prvate vod setIndrectDepLst(Strng taskCode, Lst<Strng> ndrectDepCodeLst) { TaskNode taskNode = dag.getNode(taskCode); Lst<Strng> depCodeLst = taskNode.getDepLst(); for (Strng depsNode : depCodeLst) { f (forbddenTaskMap.contansKey(Long.parseLong(depsNode))) { setIndrectDepLst(depsNode, ndrectDepCodeLst); } else { ndrectDepCodeLst.add(depsNode); } } } /** * depend node s completed, but here need check the condton task branch s the next node */ prvate boolean dependTaskSuccess(Strng dependNodeName, Strng nextNodeName) { f (dag.getNode(dependNodeName).sCondtonsTask()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
Lst<Strng> nextTaskLst = DagHelper.parseCondtonTask(dependNodeName, skpTaskNodeMap, dag, getCompleteTaskInstanceMap()); f (!nextTaskLst.contans(nextNodeName)) { logger.nfo( "DependTask s a condton task, and ts next condton branch does not hava current task, " + "dependTaskCode: {}, currentTaskCode: {}", dependNodeName, nextNodeName); return false; } } else { long taskCode = Long.parseLong(dependNodeName); Integer taskInstanceId = completeTaskMap.get(taskCode); TaskExecutonStatus depTaskState = taskInstanceMap.get(taskInstanceId).getState(); return !depTaskState.sFalure(); } return true; } /** * query task nstance by complete state * * @param state state * @return task nstance lst */ prvate Lst<TaskInstance> getCompleteTaskByState(TaskExecutonStatus state) { Lst<TaskInstance> resultLst = new ArrayLst<>(); for (Integer taskInstanceId : completeTaskMap.values()) { TaskInstance taskInstance = taskInstanceMap.get(taskInstanceId); f (taskInstance != null && taskInstance.getState() == state) { resultLst.add(taskInstance);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
13,232
[Improvement][Master] Find a word spell error and a comment location error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description I find a word spell error in WorkflowExecuteRunnable.java when i read the source code. the 'weakup' may be a incorrect word, it may mislead people <img width="974" alt="截屏2022-12-20 18 40 57" src="https://user-images.githubusercontent.com/15382560/208647796-3e37daa3-7ddf-4844-853c-9d74086aee9b.png"> and a comment in follow picture is not express the code block, I think it must move to the 'else' block, it describe the else block's logic <img width="1071" alt="截屏2022-12-20 18 47 01" src="https://user-images.githubusercontent.com/15382560/208649155-0d2041b9-0176-4158-be55-aff6d7cd3e94.png"> ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/13232
https://github.com/apache/dolphinscheduler/pull/13233
d795a7a0a33399426fedc8f91098467e4050b68e
d13cd55281e1758613fccb5199334e5415bdf0db
2022-12-20T10:48:18Z
java
2022-12-21T08:22:03Z
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java
} } return resultLst; } /** * where there are ongong tasks * * @param state state * @return ExecutonStatus */ prvate WorkflowExecutonStatus runnngState(WorkflowExecutonStatus state) { f (state == WorkflowExecutonStatus.READY_STOP || state == WorkflowExecutonStatus.READY_PAUSE || state == WorkflowExecutonStatus.READY_BLOCK || state == WorkflowExecutonStatus.DELAY_EXECUTION) { return state; } else { return WorkflowExecutonStatus.RUNNING_EXECUTION; } } /** * exsts falure task,contans submt falure、dependency falure,execute falure(retry after) * * @return Boolean whether has faled task */ prvate boolean hasFaledTask() { f (ths.taskFaledSubmt) { return true; } f (ths.errorTaskMap.sze() > 0) {