You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/12/21 15:53:39 UTC
[GitHub] [dolphinscheduler] calvinjiang commented on a change in pull request #7491: [Feature-#6422] [api-server] task group queue
calvinjiang commented on a change in pull request #7491:
URL: https://github.com/apache/dolphinscheduler/pull/7491#discussion_r773197574
##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskGroupController.java
##########
@@ -247,20 +253,43 @@ public Result startTaskGroup(@ApiIgnore @RequestAttribute(value = Constants.SESS
* force start task without task group
*
* @param loginUser login user
- * @param taskId task id
+ * @param queueId task group queue id
+ * @return result
+ */
+ @ApiOperation(value = "forceStart", notes = "WAKE_TASK_COMPULSIVELY_NOTES")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "queueId", value = "TASK_GROUP_QUEUEID", required = true, dataType = "Int")
+ })
+ @PostMapping(value = "/forceStart")
+ @ResponseStatus(HttpStatus.CREATED)
+ @ApiException(START_TASK_GROUP_ERROR)
+ @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
+ public Result forceStart(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
+ @RequestParam(value = "queueId") Integer queueId) {
+ Map<String, Object> result = taskGroupService.wakeTaskcompulsively(loginUser, queueId);
Review comment:
wakeTaskcompulsively -> wakeTaskCompulsively
##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java
##########
@@ -82,14 +82,13 @@
if (groupSize <= 0) {
putMsg(result, Status.TASK_GROUP_SIZE_ERROR);
return result;
-
}
TaskGroup taskGroup1 = taskGroupMapper.queryByName(loginUser.getId(), name);
if (taskGroup1 != null) {
putMsg(result, Status.TASK_GROUP_NAME_EXSIT);
return result;
}
- TaskGroup taskGroup = new TaskGroup(name, description,
+ TaskGroup taskGroup = new TaskGroup(name, projectcode,description,
groupSize, loginUser.getId(),Flag.YES.getCode());
int insert = taskGroupMapper.insert(taskGroup);
Review comment:
Please add a judgement to the variable of 'insert'. Seems like 'if(taskGroupMapper.insert(taskGroup) >0){...} else {...}'. You can refer to a few counterparts in other service implements.
##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskGroupService.java
##########
@@ -137,4 +137,6 @@
* @return result
*/
Map<String, Object> wakeTaskcompulsively(User loginUser, int taskId);
Review comment:
wakeTaskcompulsively - > wakeTaskCompulsively
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org