Skip to content

Commit

Permalink
[Improve] DistributedTask enums improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfboys committed Sep 29, 2024
1 parent 0509c0b commit 185859e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,10 @@ public enum DistributedTaskEnum {
*/
ABORT(4),

/**
* Stop the given application.
*/
STOP(5),

/**
* Forces the given application to stop.
*/
FORCED_STOP(6);
FORCED_STOP(5);

private final int value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public void forcedStop(Long id) {
public void cancel(SparkApplication appParam) throws Exception {
// For HA purposes, if the task is not processed locally, save the Distribution task and return
if (!distributedTaskService.isLocalProcessing(appParam.getId())) {
distributedTaskService.saveDistributedTask(appParam, false, DistributedTaskEnum.STOP);
distributedTaskService.saveDistributedTask(appParam, false, DistributedTaskEnum.CANCEL);
return;
}
SparkAppHttpWatcher.setOptionState(appParam.getId(), SparkOptionStateEnum.STOPPING);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public void executeDistributedTask(DistributedTask distributedTask) throws Excep
case REVOKE:
sparkApplicationActionService.revoke(appParam.getId());
break;
case STOP:
case CANCEL:
sparkApplicationActionService.cancel(appParam);
break;
case FORCED_STOP:
Expand Down

0 comments on commit 185859e

Please sign in to comment.