forked from apache/dolphinscheduler
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release task group when failover (apache#425)
- Loading branch information
1 parent
06698e3
commit 7b00816
Showing
3 changed files
with
60 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...ter/src/main/java/org/apache/dolphinscheduler/server/master/service/TaskGroupService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.apache.dolphinscheduler.server.master.service; | ||
|
||
import org.apache.dolphinscheduler.dao.entity.ProcessInstance; | ||
import org.apache.dolphinscheduler.dao.entity.TaskInstance; | ||
import org.apache.dolphinscheduler.service.process.ProcessService; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class TaskGroupService { | ||
|
||
@Autowired | ||
private ProcessService processService; | ||
|
||
public void releaseTaskGroup(TaskInstance taskInstance) { | ||
if (taskInstance.getTaskGroupId() > 0) { | ||
TaskInstance nextTaskInstance = this.processService.releaseTaskGroup(taskInstance); | ||
if (nextTaskInstance != null) { | ||
ProcessInstance processInstance = | ||
this.processService.findProcessInstanceById(nextTaskInstance.getProcessInstanceId()); | ||
this.processService.sendStartTask2Master(processInstance, | ||
nextTaskInstance.getId(), | ||
org.apache.dolphinscheduler.remote.command.CommandType.TASK_WAKEUP_EVENT_REQUEST); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters