Closed JustinLiAtSBU closed 4 years ago
@JustinLiAtSBU: Thanks for reporting! All this sounds like a reasonable enhancement request. If you have cycles, please feel free to take a stab at it and start the dialog with the pull request — we could collaborate to get this improved.
Hi Sabby. To be completely honest I’m not familiar with the source code of spring, but I’ll take a look at the code and see if there’s anything I can do. I have just cloned it on my local.
On Fri, Jul 17, 2020 at 4:08 PM Sabby Anandan notifications@github.com wrote:
@JustinLiAtSBU https://github.com/JustinLiAtSBU: Thanks for reporting! All this sounds like a reasonable enhancement request. If you have cycles, please feel free to take a stab at it and start the dialog with the pull request — we could collaborate to get this improved.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/spring-cloud/spring-cloud-dataflow/issues/4051#issuecomment-660315049, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM33TF5VKWB2GZ533HDDKG3R4CVVTANCNFSM4O4LPWPA .
@JustinLiAtSBU: Thanks for considering. I am going to tag @cppwfs and @ilayaperumalg to help guide you with the relevant changes.
@sabbyanandan Great. Thank you.
Hello @JustinLiAtSBU , There are 3 classes that require an update:
executionListByTaskName
found here: https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/TaskOperations.java#L109-L115
that would pass in page sizes and page.executionListByTaskName
https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/TaskOperations.java#L109-L115 but with the parameters required. If you can submit a PR for this that would be awesome!
If not you can still hit the RESTful api directly as discussed here: https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#api-guide-resources-task-executions-list-by-name
Thanks for sharing this. I’m going to start working on this once I get off work.
On Tue, Jul 21, 2020 at 10:01 AM Glenn Renfro notifications@github.com wrote:
Hello @JustinLiAtSBU https://github.com/JustinLiAtSBU , There are 3 class that require an update:
- TaskOperations.java (Interface)
- TaskTemplate.java (Impl)
TaskTemplateTests.java (Test)
- You would want to add a new function to the TaskOperations for the executionListByTaskName found here: https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/TaskOperations.java#L109-L115 that would pass in page sizes and page.
- Add the implementation to the TaskTemplate for the executionListByTaskName https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/TaskOperations.java#L109-L115 but with the parameters required.
- Update the tests : https://github.com/spring-cloud/spring-cloud-dataflow/blob/master/spring-cloud-dataflow-rest-client/src/test/java/org/springframework/cloud/dataflow/rest/client/TaskTemplateTests.java
If you can submit a PR for this that would be awesome! If not you can still hit the RESTful api directly as discussed here: https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#api-guide-resources-task-executions-list-by-name
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/spring-cloud/spring-cloud-dataflow/issues/4051#issuecomment-661879849, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM33TF4FBKCYJ3TXJHFVLYLR4WNUFANCNFSM4O4LPWPA .
@JustinLiAtSBU Are you working on this? I don't mind giving this a shot. @cppwfs Does this only need the changes you specified above? A new method to get executionListByTaskName as a Pageable object?
@sabbyanandan Can I start work on this ticket? Seems doable.
Yes, please! Any help is appreciated.
Hey @sabbyanandan @cppwfs I have raised a draft PR for this issue, could you please check if I'm on the right track there? Might not have exactly understood the issue. Can't find where the exposed method in DataFlowTemplate will be used. Thanks.
Problem description: If I wanted to implement some pagination for TaskExecutionResources, I have to use the methods in the DataFlowTemplate, such as that was returned from the function. However, since PageImpl requires a list, I would have to convert the collection into an ArrayList. This is very inefficient and could get extremely slow if there was a lot of task executions. What's more inefficient is that what I have to do to get a page is to
executionListByTaskName().getContent()
. Then I would use Page, Pageable, and PageImpl to create a page out of the CollectionSolution description: A solution that I would like to see is another function in the DataFlowTemplate that is similar to
DataFlowTemplate.taskOperations().executionListByTaskName(taskName)
. However, this new function would have additional parameters for page size and page number, or a Pageable object. The goal of this new function would be to allow the user to easily and efficiently implement pagination on TaskExecutionResources so that they can be displayed on a dashboard or something.Description of alternatives: My alternative solution was described above.
Additional context: If anything I wrote was unclear, I also made a StackOverflow post here that might describe this better.