Skip to content

Added query for composed-task-runner status. #5792

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

Merged

Conversation

corneil
Copy link
Contributor

@corneil corneil commented May 2, 2024

Fixes #5782

@corneil corneil requested review from cppwfs and onobc May 2, 2024 14:06
Copy link
Contributor

@cppwfs cppwfs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, great job! Had some annoying questions ;-)

this.resourceAssembler = new TaskExecutionThinResourceAssembler();
}

@GetMapping(produces = "application/json")
@ResponseStatus(HttpStatus.OK)
public PagedModel<TaskExecutionThinResource> listTasks(Pageable pageable, PagedResourcesAssembler<AggregateTaskExecution> pagedAssembler) {
return pagedAssembler.toModel(explorer.findAll(pageable, true), resourceAssembler);
Page<AggregateTaskExecution> page = explorer.findAll(pageable, true);
taskJobService.populateComposeTaskRunnerStatus(page.getContent());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we determined the cost of running the retrieval of the CTR status for the results set?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I compared before and after timings from org.springframework.cloud.dataflow.integration.test.tasks.TaskExecutionQueryIT
I added index in parent_execution_id and now the difference is hardly noticeable.

execution.setCtrTaskStatus(ctrStatus);
});
}
LOG.info("updated {} ctr statuses", updated.get());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a debug?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes


@RequestMapping(value = "", method = RequestMethod.GET, params = "name")
@ResponseStatus(HttpStatus.OK)
public PagedModel<TaskExecutionThinResource> retrieveTasksByName(@RequestParam("name") String taskName,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a test to verify the population of the status?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding

Added check for taskExecutionStatus on task execution list.
@corneil corneil requested a review from cppwfs May 3, 2024 12:01
@@ -313,6 +313,10 @@ public void stopJobExecution(long jobExecutionId, String schemaTarget) throws No
logger.info("stopped:{}:{}:status={}", jobExecutionId, schemaTarget, status);
}

@Override
public void populateComposeTaskRunnerStatus(Collection<AggregateTaskExecution> taskExecutions) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to add a test here as well.

@corneil corneil requested a review from cppwfs May 3, 2024 13:12
@cppwfs cppwfs added this to the 2.11.3 milestone May 3, 2024
@corneil corneil merged commit 6f97589 into spring-cloud:main May 6, 2024
3 checks passed
@corneil corneil deleted the corneil/gh-5782-thin-execution-task-status branch May 6, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix the thin task execution page query for CTR status
2 participants