Loading README.md +1 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ Easy Scheduler ### 近期研发计划 EasyScheduler的工作计划:<a href="https://github.com/analysys/EasyScheduler/projects/1" target="_blank">研发计划</a> ,其中 In Develop卡片下是1.0.2版本的功能,TODO卡片是待做事项(包括 feature ideas) EasyScheduler的工作计划:<a href="https://github.com/analysys/EasyScheduler/projects/1" target="_blank">研发计划</a> ,其中 In Develop卡片下是1.1.0版本的功能,TODO卡片是待做事项(包括 feature ideas) ### 贡献代码 Loading escheduler-api/src/main/java/cn/escheduler/api/controller/ExecutorController.java +42 −9 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ import cn.escheduler.api.utils.Constants; import cn.escheduler.api.utils.Result; import cn.escheduler.common.enums.*; import cn.escheduler.dao.model.User; import io.swagger.annotations.Api; import io.swagger.annotations.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; Loading @@ -38,9 +38,9 @@ import static cn.escheduler.api.enums.Status.*; /** * execute task controller * execute process controller */ @ApiIgnore @Api(tags = "PROCESS_INSTANCE_EXECUTOR_TAG", position = 1) @RestController @RequestMapping("projects/{projectName}/executors") public class ExecutorController extends BaseController { Loading @@ -53,10 +53,27 @@ public class ExecutorController extends BaseController { /** * execute process instance */ @ApiOperation(value = "startProcessInstance", notes= "RUN_PROCESS_INSTANCE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "processDefinitionId", value = "PROCESS_DEFINITION_ID", required = true, dataType = "Int", example = "100"), @ApiImplicitParam(name = "scheduleTime", value = "SCHEDULE_TIME", required = true, dataType = "String"), @ApiImplicitParam(name = "failureStrategy", value = "FAILURE_STRATEGY", required = true, dataType ="FailureStrategy"), @ApiImplicitParam(name = "startNodeList", value = "START_NODE_LIST", dataType ="String"), @ApiImplicitParam(name = "taskDependType", value = "TASK_DEPEND_TYPE", dataType ="TaskDependType"), @ApiImplicitParam(name = "execType", value = "COMMAND_TYPE", dataType ="CommandType"), @ApiImplicitParam(name = "warningType", value = "WARNING_TYPE",required = true, dataType ="WarningType"), @ApiImplicitParam(name = "warningGroupId", value = "WARNING_GROUP_ID",required = true, dataType ="Int", example = "100"), @ApiImplicitParam(name = "receivers", value = "RECEIVERS",dataType ="String" ), @ApiImplicitParam(name = "receiversCc", value = "RECEIVERS_CC",dataType ="String" ), @ApiImplicitParam(name = "runMode", value = "RUN_MODE",dataType ="RunMode" ), @ApiImplicitParam(name = "processInstancePriority", value = "PROCESS_INSTANCE_PRIORITY", required = true, dataType = "Priority" ), @ApiImplicitParam(name = "workerGroupId", value = "WORKER_GROUP_ID", dataType = "Int",example = "100"), @ApiImplicitParam(name = "timeout", value = "TIMEOUT", dataType = "Int",example = "100"), }) @PostMapping(value = "start-process-instance") @ResponseStatus(HttpStatus.OK) public Result startProcessInstance(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable String projectName, public Result startProcessInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam(value = "processDefinitionId") int processDefinitionId, @RequestParam(value = "scheduleTime", required = false) String scheduleTime, @RequestParam(value = "failureStrategy", required = true) FailureStrategy failureStrategy, Loading Loading @@ -102,10 +119,15 @@ public class ExecutorController extends BaseController { * @param processInstanceId * @return */ @ApiOperation(value = "execute", notes= "EXECUTE_ACTION_TO_PROCESS_INSTANCE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "processInstanceId", value = "PROCESS_INSTANCE_ID", required = true, dataType = "Int", example = "100"), @ApiImplicitParam(name = "executeType", value = "EXECUTE_TYPE", required = true, dataType = "ExecuteType") }) @PostMapping(value = "/execute") @ResponseStatus(HttpStatus.OK) public Result execute(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable String projectName, public Result execute(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam("processInstanceId") Integer processInstanceId, @RequestParam("executeType") ExecuteType executeType ) { Loading @@ -127,9 +149,13 @@ public class ExecutorController extends BaseController { * @param processDefinitionId * @return */ @ApiOperation(value = "startCheckProcessDefinition", notes= "START_CHECK_PROCESS_DEFINITION_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "processDefinitionId", value = "PROCESS_DEFINITION_ID", required = true, dataType = "Int", example = "100") }) @PostMapping(value = "/start-check") @ResponseStatus(HttpStatus.OK) public Result startCheckProcessDefinition(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result startCheckProcessDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "processDefinitionId") int processDefinitionId) { logger.info("login user {}, check process definition", loginUser.getUserName(), processDefinitionId); try { Loading @@ -149,9 +175,16 @@ public class ExecutorController extends BaseController { * @param processDefinitionId * @return */ @ApiIgnore @ApiOperation(value = "getReceiverCc", notes= "GET_RECEIVER_CC_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "processDefinitionId", value = "PROCESS_DEFINITION_ID", required = true, dataType = "Int", example = "100"), @ApiImplicitParam(name = "processInstanceId", value = "PROCESS_INSTANCE_ID", required = true, dataType = "Int", example = "100") }) @GetMapping(value = "/get-receiver-cc") @ResponseStatus(HttpStatus.OK) public Result getReceiverCc(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result getReceiverCc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "processDefinitionId",required = false) Integer processDefinitionId, @RequestParam(value = "processInstanceId",required = false) Integer processInstanceId) { logger.info("login user {}, get process definition receiver and cc", loginUser.getUserName()); Loading escheduler-common/src/main/java/cn/escheduler/common/Constants.java +10 −0 Original line number Diff line number Diff line Loading @@ -219,6 +219,11 @@ public final class Constants { */ public static final String SEMICOLON = ";"; /** * DOT . */ public static final String DOT = "."; /** * ZOOKEEPER_SESSION_TIMEOUT */ Loading Loading @@ -883,6 +888,11 @@ public final class Constants { */ public static final String LOGIN_USER_KEY_TAB_USERNAME = "login.user.keytab.username"; /** * default worker group id */ public static final int DEFAULT_WORKER_ID = -1; /** * loginUserFromKeytab path */ Loading escheduler-common/src/main/java/cn/escheduler/common/queue/ITaskQueue.java +3 −6 Original line number Diff line number Diff line Loading @@ -24,20 +24,17 @@ public interface ITaskQueue { /** * take out all the elements * * this method has deprecated * use checkTaskExists instead * * @param key * @return */ @Deprecated List<String> getAllTasks(String key); /** * check task exists in the task queue or not * * @param key queue name * @param task ${priority}_${processInstanceId}_${taskId} * @param task ${processInstancePriority}_${processInstanceId}_${taskInstancePriority}_${taskId} * @return true if exists in the queue */ boolean checkTaskExists(String key, String task); Loading @@ -54,10 +51,10 @@ public interface ITaskQueue { * an element pops out of the queue * * @param key queue name * @param remove whether remove the element * @param n how many elements to poll * @return */ String poll(String key, boolean remove); List<String> poll(String key, int n); /** * remove a element from queue Loading escheduler-common/src/main/java/cn/escheduler/common/queue/TaskQueueFactory.java +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ public class TaskQueueFactory { public static ITaskQueue getTaskQueueInstance() { String queueImplValue = CommonUtils.getQueueImplValue(); if (StringUtils.isNotBlank(queueImplValue)) { // queueImplValue = StringUtils.trim(queueImplValue); // queueImplValue = IpUtils.trim(queueImplValue); // if (SCHEDULER_QUEUE_REDIS_IMPL.equals(queueImplValue)) { // logger.info("task queue impl use reids "); Loading Loading
README.md +1 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ Easy Scheduler ### 近期研发计划 EasyScheduler的工作计划:<a href="https://github.com/analysys/EasyScheduler/projects/1" target="_blank">研发计划</a> ,其中 In Develop卡片下是1.0.2版本的功能,TODO卡片是待做事项(包括 feature ideas) EasyScheduler的工作计划:<a href="https://github.com/analysys/EasyScheduler/projects/1" target="_blank">研发计划</a> ,其中 In Develop卡片下是1.1.0版本的功能,TODO卡片是待做事项(包括 feature ideas) ### 贡献代码 Loading
escheduler-api/src/main/java/cn/escheduler/api/controller/ExecutorController.java +42 −9 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ import cn.escheduler.api.utils.Constants; import cn.escheduler.api.utils.Result; import cn.escheduler.common.enums.*; import cn.escheduler.dao.model.User; import io.swagger.annotations.Api; import io.swagger.annotations.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; Loading @@ -38,9 +38,9 @@ import static cn.escheduler.api.enums.Status.*; /** * execute task controller * execute process controller */ @ApiIgnore @Api(tags = "PROCESS_INSTANCE_EXECUTOR_TAG", position = 1) @RestController @RequestMapping("projects/{projectName}/executors") public class ExecutorController extends BaseController { Loading @@ -53,10 +53,27 @@ public class ExecutorController extends BaseController { /** * execute process instance */ @ApiOperation(value = "startProcessInstance", notes= "RUN_PROCESS_INSTANCE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "processDefinitionId", value = "PROCESS_DEFINITION_ID", required = true, dataType = "Int", example = "100"), @ApiImplicitParam(name = "scheduleTime", value = "SCHEDULE_TIME", required = true, dataType = "String"), @ApiImplicitParam(name = "failureStrategy", value = "FAILURE_STRATEGY", required = true, dataType ="FailureStrategy"), @ApiImplicitParam(name = "startNodeList", value = "START_NODE_LIST", dataType ="String"), @ApiImplicitParam(name = "taskDependType", value = "TASK_DEPEND_TYPE", dataType ="TaskDependType"), @ApiImplicitParam(name = "execType", value = "COMMAND_TYPE", dataType ="CommandType"), @ApiImplicitParam(name = "warningType", value = "WARNING_TYPE",required = true, dataType ="WarningType"), @ApiImplicitParam(name = "warningGroupId", value = "WARNING_GROUP_ID",required = true, dataType ="Int", example = "100"), @ApiImplicitParam(name = "receivers", value = "RECEIVERS",dataType ="String" ), @ApiImplicitParam(name = "receiversCc", value = "RECEIVERS_CC",dataType ="String" ), @ApiImplicitParam(name = "runMode", value = "RUN_MODE",dataType ="RunMode" ), @ApiImplicitParam(name = "processInstancePriority", value = "PROCESS_INSTANCE_PRIORITY", required = true, dataType = "Priority" ), @ApiImplicitParam(name = "workerGroupId", value = "WORKER_GROUP_ID", dataType = "Int",example = "100"), @ApiImplicitParam(name = "timeout", value = "TIMEOUT", dataType = "Int",example = "100"), }) @PostMapping(value = "start-process-instance") @ResponseStatus(HttpStatus.OK) public Result startProcessInstance(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable String projectName, public Result startProcessInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam(value = "processDefinitionId") int processDefinitionId, @RequestParam(value = "scheduleTime", required = false) String scheduleTime, @RequestParam(value = "failureStrategy", required = true) FailureStrategy failureStrategy, Loading Loading @@ -102,10 +119,15 @@ public class ExecutorController extends BaseController { * @param processInstanceId * @return */ @ApiOperation(value = "execute", notes= "EXECUTE_ACTION_TO_PROCESS_INSTANCE_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "processInstanceId", value = "PROCESS_INSTANCE_ID", required = true, dataType = "Int", example = "100"), @ApiImplicitParam(name = "executeType", value = "EXECUTE_TYPE", required = true, dataType = "ExecuteType") }) @PostMapping(value = "/execute") @ResponseStatus(HttpStatus.OK) public Result execute(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable String projectName, public Result execute(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam("processInstanceId") Integer processInstanceId, @RequestParam("executeType") ExecuteType executeType ) { Loading @@ -127,9 +149,13 @@ public class ExecutorController extends BaseController { * @param processDefinitionId * @return */ @ApiOperation(value = "startCheckProcessDefinition", notes= "START_CHECK_PROCESS_DEFINITION_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "processDefinitionId", value = "PROCESS_DEFINITION_ID", required = true, dataType = "Int", example = "100") }) @PostMapping(value = "/start-check") @ResponseStatus(HttpStatus.OK) public Result startCheckProcessDefinition(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result startCheckProcessDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "processDefinitionId") int processDefinitionId) { logger.info("login user {}, check process definition", loginUser.getUserName(), processDefinitionId); try { Loading @@ -149,9 +175,16 @@ public class ExecutorController extends BaseController { * @param processDefinitionId * @return */ @ApiIgnore @ApiOperation(value = "getReceiverCc", notes= "GET_RECEIVER_CC_NOTES") @ApiImplicitParams({ @ApiImplicitParam(name = "processDefinitionId", value = "PROCESS_DEFINITION_ID", required = true, dataType = "Int", example = "100"), @ApiImplicitParam(name = "processInstanceId", value = "PROCESS_INSTANCE_ID", required = true, dataType = "Int", example = "100") }) @GetMapping(value = "/get-receiver-cc") @ResponseStatus(HttpStatus.OK) public Result getReceiverCc(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result getReceiverCc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "processDefinitionId",required = false) Integer processDefinitionId, @RequestParam(value = "processInstanceId",required = false) Integer processInstanceId) { logger.info("login user {}, get process definition receiver and cc", loginUser.getUserName()); Loading
escheduler-common/src/main/java/cn/escheduler/common/Constants.java +10 −0 Original line number Diff line number Diff line Loading @@ -219,6 +219,11 @@ public final class Constants { */ public static final String SEMICOLON = ";"; /** * DOT . */ public static final String DOT = "."; /** * ZOOKEEPER_SESSION_TIMEOUT */ Loading Loading @@ -883,6 +888,11 @@ public final class Constants { */ public static final String LOGIN_USER_KEY_TAB_USERNAME = "login.user.keytab.username"; /** * default worker group id */ public static final int DEFAULT_WORKER_ID = -1; /** * loginUserFromKeytab path */ Loading
escheduler-common/src/main/java/cn/escheduler/common/queue/ITaskQueue.java +3 −6 Original line number Diff line number Diff line Loading @@ -24,20 +24,17 @@ public interface ITaskQueue { /** * take out all the elements * * this method has deprecated * use checkTaskExists instead * * @param key * @return */ @Deprecated List<String> getAllTasks(String key); /** * check task exists in the task queue or not * * @param key queue name * @param task ${priority}_${processInstanceId}_${taskId} * @param task ${processInstancePriority}_${processInstanceId}_${taskInstancePriority}_${taskId} * @return true if exists in the queue */ boolean checkTaskExists(String key, String task); Loading @@ -54,10 +51,10 @@ public interface ITaskQueue { * an element pops out of the queue * * @param key queue name * @param remove whether remove the element * @param n how many elements to poll * @return */ String poll(String key, boolean remove); List<String> poll(String key, int n); /** * remove a element from queue Loading
escheduler-common/src/main/java/cn/escheduler/common/queue/TaskQueueFactory.java +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ public class TaskQueueFactory { public static ITaskQueue getTaskQueueInstance() { String queueImplValue = CommonUtils.getQueueImplValue(); if (StringUtils.isNotBlank(queueImplValue)) { // queueImplValue = StringUtils.trim(queueImplValue); // queueImplValue = IpUtils.trim(queueImplValue); // if (SCHEDULER_QUEUE_REDIS_IMPL.equals(queueImplValue)) { // logger.info("task queue impl use reids "); Loading