-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Improve][feature] Add JobInstance Delete #161
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
17 changes: 17 additions & 0 deletions
17
...c/main/java/org/apache/seatunnel/datasource/plugin/db2/jdbc/Db2JdbcDataSourceChannel.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
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
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
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 |
---|---|---|
|
@@ -18,13 +18,11 @@ | |
package org.apache.seatunnel.app.controller; | ||
|
||
import org.apache.seatunnel.app.common.Result; | ||
import org.apache.seatunnel.app.domain.response.executor.JobExecutorRes; | ||
import org.apache.seatunnel.app.service.IJobExecutorService; | ||
import org.apache.seatunnel.app.service.IJobInstanceService; | ||
import org.apache.seatunnel.server.common.SeatunnelErrorEnum; | ||
import org.apache.seatunnel.server.common.SeatunnelException; | ||
|
||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestAttribute; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
@@ -44,34 +42,26 @@ | |
public class JobExecutorController { | ||
|
||
@Resource IJobExecutorService jobExecutorService; | ||
@Resource private IJobInstanceService jobInstanceService; | ||
|
||
@GetMapping("/execute") | ||
@ApiOperation(value = "Execute synchronization tasks", httpMethod = "GET") | ||
public Result<Long> jobExecutor( | ||
@PostMapping("/create") | ||
@ApiOperation(value = "Create synchronization tasks", httpMethod = "POST") | ||
public Result<Long> jobCreate( | ||
@ApiParam(value = "userId", required = true) @RequestAttribute("userId") Integer userId, | ||
@ApiParam(value = "jobDefineId", required = true) @RequestParam("jobDefineId") | ||
Long jobDefineId) { | ||
return jobExecutorService.jobExecute(userId, jobDefineId); | ||
Long jobDefineId) { | ||
return jobExecutorService.jobCreate(userId, jobDefineId); | ||
} | ||
|
||
@GetMapping("/resource") | ||
@ApiOperation(value = "get the resource for job executor", httpMethod = "GET") | ||
public Result<JobExecutorRes> resource( | ||
@ApiParam(value = "userId", required = true) @RequestParam Integer userId, | ||
@ApiParam(value = "Job define id", required = true) @RequestParam Long jobDefineId) | ||
throws IOException { | ||
try { | ||
JobExecutorRes executeResource = | ||
jobInstanceService.createExecuteResource(userId, jobDefineId); | ||
return Result.success(executeResource); | ||
} catch (Exception e) { | ||
log.error("Get the resource for job executor error", e); | ||
throw new SeatunnelException(SeatunnelErrorEnum.ILLEGAL_STATE, e.getMessage()); | ||
} | ||
@PostMapping("/execute") | ||
@ApiOperation(value = "Execute synchronization tasks", httpMethod = "Post") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. httpMethod = "Post" should be changed to httpMethod = "POST" |
||
public Result<Long> jobExecutor( | ||
@ApiParam(value = "userId", required = true) @RequestAttribute("userId") Integer userId, | ||
@ApiParam(value = "jobInstanceId", required = true) @RequestParam Long jobInstanceId) { | ||
return jobExecutorService.jobExecute(userId, jobInstanceId); | ||
} | ||
|
||
@GetMapping("/pause") | ||
@PostMapping("/pause") | ||
@ApiOperation(value = "Pause synchronization tasks", httpMethod = "POST") | ||
public Result<Void> jobPause( | ||
@ApiParam(value = "userId", required = true) @RequestAttribute("userId") Integer userId, | ||
@ApiParam(value = "jobInstanceId", required = true) @RequestParam Long jobInstanceId) { | ||
|
@@ -84,4 +74,12 @@ public Result<Void> jobRestore( | |
@ApiParam(value = "jobInstanceId", required = true) @RequestParam Long jobInstanceId) { | ||
return jobExecutorService.jobStore(userId, jobInstanceId); | ||
} | ||
|
||
@DeleteMapping("/delete") | ||
@ApiOperation(value = "Delete synchronization tasks", httpMethod = "DELETE") | ||
public Result<Void> jobCancel( | ||
@ApiParam(value = "userId", required = true) @RequestAttribute("userId") Integer userId, | ||
@ApiParam(value = "jobInstanceId", required = true) @RequestParam Long jobInstanceId) { | ||
return jobExecutorService.jobDelete(userId, jobInstanceId); | ||
} | ||
} |
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
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
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as seatunnel 2.3.5 is released, can you pls update seatunnel verstion to 2.3.5