Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
gdliu3 committed Mar 12, 2024
1 parent 7c0ea2e commit fe3435f
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,7 @@ public void handle(HttpPostCommand httpPostCommand) {
private SeaTunnelServer getSeaTunnelServer() {
Map<String, Object> extensionServices =
this.textCommandService.getNode().getNodeExtension().createExtensionServices();
SeaTunnelServer seaTunnelServer =
(SeaTunnelServer) extensionServices.get(Constant.SEATUNNEL_SERVICE_NAME);
if (!seaTunnelServer.isMasterNode()) {
return null;
}
return seaTunnelServer;
return (SeaTunnelServer) extensionServices.get(Constant.SEATUNNEL_SERVICE_NAME);
}

private void handleSubmitJob(HttpPostCommand httpPostCommand, String uri)
Expand Down Expand Up @@ -171,7 +166,7 @@ private void handleStopJob(HttpPostCommand httpPostCommand, String uri) {
}

SeaTunnelServer seaTunnelServer = getSeaTunnelServer();
if (seaTunnelServer == null) {
if (!seaTunnelServer.isMasterNode()) {
if (isStopWithSavePoint) {
NodeEngineUtil.sendOperationToMasterNode(
getNode().nodeEngine, new SavePointJobOperation(jobId))
Expand All @@ -183,7 +178,7 @@ private void handleStopJob(HttpPostCommand httpPostCommand, String uri) {
}

} else {
CoordinatorService coordinatorService = getSeaTunnelServer().getCoordinatorService();
CoordinatorService coordinatorService = seaTunnelServer.getCoordinatorService();

if (isStopWithSavePoint) {
coordinatorService.savePoint(jobId);
Expand Down

0 comments on commit fe3435f

Please sign in to comment.