-
Notifications
You must be signed in to change notification settings - Fork 281
Endpoint to get latest step instance views across runs for a given workflow instance #204
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -32,6 +32,7 @@ | |||||||
| value = "/api/v3/workflows", | ||||||||
| produces = MediaType.APPLICATION_JSON_VALUE, | ||||||||
| consumes = MediaType.APPLICATION_JSON_VALUE) | ||||||||
| @SuppressWarnings("PMD.AvoidDuplicateLiterals") | ||||||||
|
Collaborator
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. Can you clarify why this is needed?
Collaborator
Author
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. I added this here because without this we will have to use constant for 'workflowId' and 'workflowInstanceId' in line 98 and 99 below Previously this file has a few such strings but with my new endpoint it crossed over the PMD threshold Similar pattern is used in other controllers maestro/maestro-server/src/main/java/com/netflix/maestro/server/controllers/WorkflowController.java Line 74 in 65c2d8a
Line 52 in 65c2d8a
Line 41 in 65c2d8a
|
||||||||
| public class StepInstanceController { | ||||||||
|
|
||||||||
| private final MaestroStepInstanceDao stepInstanceDao; | ||||||||
|
|
@@ -88,6 +89,20 @@ public StepInstance getStepInstance( | |||||||
| return instance; | ||||||||
| } | ||||||||
|
|
||||||||
| @GetMapping( | ||||||||
| value = "/{workflowId}/instances/{workflowInstanceId}/steps", | ||||||||
| consumes = MediaType.ALL_VALUE) | ||||||||
| @Operation( | ||||||||
| summary = "Get the most recent step instance across all runs for a given workflow instance") | ||||||||
| public List<StepInstance> getAllStepInstanceViews( | ||||||||
| @Valid @NotNull @PathVariable("workflowId") String workflowId, | ||||||||
| @PathVariable("workflowInstanceId") long workflowInstanceId) { | ||||||||
| List<StepInstance> instances = | ||||||||
| stepInstanceDao.getAllStepInstanceViews(workflowId, workflowInstanceId); | ||||||||
| instances.sort(Comparator.comparingLong(StepInstance::getStepInstanceId)); | ||||||||
| return instances; | ||||||||
| } | ||||||||
|
|
||||||||
| @GetMapping( | ||||||||
| value = "/{workflowId}/instances/{workflowInstanceId}/runs/{workflowRunId}/steps", | ||||||||
| consumes = MediaType.ALL_VALUE) | ||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.
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.
If you have any benchmarks or EXPLAIN / query plan results, could you share those as well?
Uh oh!
There was an error while loading. Please reload this page.
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.
I have pasted the query plan below
QUERY PLAN