You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by "VampireAchao (via GitHub)" <gi...@apache.org> on 2023/10/28 12:22:25 UTC
[PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
VampireAchao opened a new pull request, #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295
<!--
Thank you for contributing to StreamPark! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
## Contribution Checklist
- If this is your first time, please read our contributor guidelines: [Submit Code](https://streampark.apache.org/community/submit_guide/submit_code).
- Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/incubator-streampark/issues).
- Name the pull request in the form "[Feature] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
- Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
- If the PR is unfinished, add `[WIP]` in your PR title, e.g., `[WIP][Feature] Title of the pull request`.
-->
## What changes were proposed in this pull request
Issue Number: see #3064 <!-- REMOVE this line if no issue to close -->
<!--(For example: This pull request proposed to add checkstyle plugin).-->
## Brief change log
<!--*(for example:)*
- *Add maven-checkstyle-plugin to root pom.xml*
-->
Improve streampark-console core package module service name base on [3.1 Naming Style]
1. Just query method
2. Just in service
## Verifying this change
<!--*(Please pick either of the following options)*-->
This change is a trivial rework / code cleanup without any test coverage.
Yes *(or)*
This change is already covered by existing tests, such as *(please describe tests)*.
No *(or)*
This change added tests and can be verified as follows:
<!--*(example:)*
- *Added integration tests for end-to-end.*
- *Added *Test to verify the change.*
- *Manually verified the change by testing locally.* -->
## Does this pull request potentially affect one of the following parts
- Dependencies (does it add or upgrade a dependency): No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "RocMarshal (via GitHub)" <gi...@apache.org>.
RocMarshal merged PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "wolfboys (via GitHub)" <gi...@apache.org>.
wolfboys commented on PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295#issuecomment-1783844948
Thanks very much for your contribution. There are some check style issues need to be resolved first.
`mvn spotless:apply`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "RocMarshal (via GitHub)" <gi...@apache.org>.
RocMarshal commented on code in PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295#discussion_r1375412278
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/YarnQueueController.java:
##########
@@ -55,7 +55,7 @@ public class YarnQueueController {
@ApiAccess
@PostMapping("list")
public RestResponse list(RestRequest restRequest, YarnQueue yarnQueue) {
- IPage<YarnQueue> queuePage = yarnQueueService.findYarnQueues(yarnQueue, restRequest);
+ IPage<YarnQueue> queuePage = yarnQueueService.page(yarnQueue, restRequest);
Review Comment:
~
##########
streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/YarnQueueServiceTest.java:
##########
@@ -97,7 +97,7 @@ void testFindYarnQueues() {
// Test for 1st page, size = 2, order by create time with queue_label
queryParams.setQueueLabel("q3");
IPage<YarnQueue> yarnQueuesWithQueueLabelLikeQuery =
- yarnQueueService.findYarnQueues(queryParams, request);
+ yarnQueueService.page(queryParams, request);
Review Comment:
~
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/VariableController.java:
##########
@@ -91,7 +91,7 @@ public RestResponse variableList(@RequestParam Long teamId, String keyword) {
@PostMapping("dependApps")
@RequiresPermissions("variable:depend_apps")
public RestResponse dependApps(RestRequest restRequest, Variable variable) {
- IPage<Application> dependApps = variableService.dependAppsPage(variable, restRequest);
+ IPage<Application> dependApps = variableService.pageDependApps(variable, restRequest);
Review Comment:
how about `getPage`, as mentioned in the guide page, methods name would be better to start with a `verb`.
##########
streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/YarnQueueServiceTest.java:
##########
@@ -87,7 +87,7 @@ void testFindYarnQueues() {
RestRequest request = new RestRequest();
request.setPageSize(2);
request.setPageNum(1);
- IPage<YarnQueue> yarnQueues = yarnQueueService.findYarnQueues(queryParams, request);
+ IPage<YarnQueue> yarnQueues = yarnQueueService.page(queryParams, request);
Review Comment:
~
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "VampireAchao (via GitHub)" <gi...@apache.org>.
VampireAchao commented on code in PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295#discussion_r1378518019
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProjectService.java:
##########
@@ -54,7 +54,7 @@ public interface ProjectService extends IService<Project> {
String getAppConfPath(Long id, String module);
- List<Application> getApplications(Project project);
+ List<Application> list(Project project);
Review Comment:
```diff
- List<Application> list(Project project);
- List<Application> listApp(Project project);
```
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProjectService.java:
##########
@@ -54,7 +54,7 @@ public interface ProjectService extends IService<Project> {
String getAppConfPath(Long id, String module);
- List<Application> getApplications(Project project);
+ List<Application> list(Project project);
Review Comment:
```diff
- List<Application> list(Project project);
+ List<Application> listApp(Project project);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "VampireAchao (via GitHub)" <gi...@apache.org>.
VampireAchao commented on code in PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295#discussion_r1378513287
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/YarnQueueService.java:
##########
@@ -27,7 +27,7 @@
public interface YarnQueueService extends IService<YarnQueue> {
- IPage<YarnQueue> findYarnQueues(YarnQueue yarnQueue, RestRequest restRequest);
+ IPage<YarnQueue> getPage(YarnQueue yarnQueue, RestRequest restRequest);
Review Comment:
Ditto, `yarnQueueService.getPage` already mentioned `yarnQueue`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "VampireAchao (via GitHub)" <gi...@apache.org>.
VampireAchao commented on PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295#issuecomment-1788222668
> cc 抄送@RocMarshal
Thx
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "VampireAchao (via GitHub)" <gi...@apache.org>.
VampireAchao commented on code in PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295#discussion_r1378513287
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/YarnQueueService.java:
##########
@@ -27,7 +27,7 @@
public interface YarnQueueService extends IService<YarnQueue> {
- IPage<YarnQueue> findYarnQueues(YarnQueue yarnQueue, RestRequest restRequest);
+ IPage<YarnQueue> getPage(YarnQueue yarnQueue, RestRequest restRequest);
Review Comment:
`yarnQueueService.getPage` already mentioned yarnQueue
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "VampireAchao (via GitHub)" <gi...@apache.org>.
VampireAchao commented on code in PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295#discussion_r1378518019
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProjectService.java:
##########
@@ -54,7 +54,7 @@ public interface ProjectService extends IService<Project> {
String getAppConfPath(Long id, String module);
- List<Application> getApplications(Project project);
+ List<Application> list(Project project);
Review Comment:
Refer to the `list()` method in `com.baomidou.mybatisplus.extension.service.IService`.
When we use `projectService.list()`, the term 'project' is already specified.
Therefore, I believe we can eliminate the redundancy.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "caicancai (via GitHub)" <gi...@apache.org>.
caicancai commented on PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295#issuecomment-1787351665
cc @RocMarshal
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "caicancai (via GitHub)" <gi...@apache.org>.
caicancai commented on code in PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295#discussion_r1377685088
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProjectService.java:
##########
@@ -54,7 +54,7 @@ public interface ProjectService extends IService<Project> {
String getAppConfPath(Long id, String module);
- List<Application> getApplications(Project project);
+ List<Application> list(Project project);
- boolean checkExists(Project project);
+ boolean exists(Project project);
Review Comment:
I think checkExists better
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProjectService.java:
##########
@@ -54,7 +54,7 @@ public interface ProjectService extends IService<Project> {
String getAppConfPath(Long id, String module);
- List<Application> getApplications(Project project);
+ List<Application> list(Project project);
Review Comment:
Just a list?
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/YarnQueueService.java:
##########
@@ -27,7 +27,7 @@
public interface YarnQueueService extends IService<YarnQueue> {
- IPage<YarnQueue> findYarnQueues(YarnQueue yarnQueue, RestRequest restRequest);
+ IPage<YarnQueue> getPage(YarnQueue yarnQueue, RestRequest restRequest);
Review Comment:
getYarnQueuesPage?
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/YarnQueueService.java:
##########
@@ -27,7 +27,7 @@
public interface YarnQueueService extends IService<YarnQueue> {
- IPage<YarnQueue> findYarnQueues(YarnQueue yarnQueue, RestRequest restRequest);
+ IPage<YarnQueue> getPage(YarnQueue yarnQueue, RestRequest restRequest);
Review Comment:
getYarnQueuesPage?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "VampireAchao (via GitHub)" <gi...@apache.org>.
VampireAchao commented on code in PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295#discussion_r1378512133
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProjectService.java:
##########
@@ -54,7 +54,7 @@ public interface ProjectService extends IService<Project> {
String getAppConfPath(Long id, String module);
- List<Application> getApplications(Project project);
+ List<Application> list(Project project);
- boolean checkExists(Project project);
+ boolean exists(Project project);
Review Comment:
Difference:
```java
void checkExists(Project project) {
if (notExists) {
throw new ProjectNotExistsException();
}
}
```
As a result:
```java
if (!exists(project)) {
throw new ProjectNotExistsException();
}
```
Alternatively, it could be simplified as:
```java
checkExist(project);
```
This approach is preferred since the "exists" method merely returns a boolean value, which enhances clarity and conciseness.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "VampireAchao (via GitHub)" <gi...@apache.org>.
VampireAchao commented on code in PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295#discussion_r1378518019
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProjectService.java:
##########
@@ -54,7 +54,7 @@ public interface ProjectService extends IService<Project> {
String getAppConfPath(Long id, String module);
- List<Application> getApplications(Project project);
+ List<Application> list(Project project);
Review Comment:
ok
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "VampireAchao (via GitHub)" <gi...@apache.org>.
VampireAchao commented on PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295#issuecomment-1784339517
Great!I'll fix it ASAP.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "VampireAchao (via GitHub)" <gi...@apache.org>.
VampireAchao commented on code in PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295#discussion_r1378512133
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProjectService.java:
##########
@@ -54,7 +54,7 @@ public interface ProjectService extends IService<Project> {
String getAppConfPath(Long id, String module);
- List<Application> getApplications(Project project);
+ List<Application> list(Project project);
- boolean checkExists(Project project);
+ boolean exists(Project project);
Review Comment:
Diff:
```java
void checkExists(Project project) {
if(notExists) {
throw new ProjectNotExistsException();
}
}
```
So:
```java
if (!exists(project)){
throw new ProjectNotExistsException();
}
```
Eq
```java
checkExist(project)
```
Cause "exists" just return boolean type better.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "VampireAchao (via GitHub)" <gi...@apache.org>.
VampireAchao commented on code in PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295#discussion_r1378513287
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/YarnQueueService.java:
##########
@@ -27,7 +27,7 @@
public interface YarnQueueService extends IService<YarnQueue> {
- IPage<YarnQueue> findYarnQueues(YarnQueue yarnQueue, RestRequest restRequest);
+ IPage<YarnQueue> getPage(YarnQueue yarnQueue, RestRequest restRequest);
Review Comment:
`yarnQueueService.getPage` already mentioned `yarnQueue`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "VampireAchao (via GitHub)" <gi...@apache.org>.
VampireAchao commented on code in PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295#discussion_r1378518019
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ProjectService.java:
##########
@@ -54,7 +54,7 @@ public interface ProjectService extends IService<Project> {
String getAppConfPath(Long id, String module);
- List<Application> getApplications(Project project);
+ List<Application> list(Project project);
Review Comment:
```diff
- List<Application> list(Project project);
+ List<Application> listApps(Project project);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] [Improve] Improve streampark-console core package module service name base on [3.1 Naming Style] [incubator-streampark]
Posted by "VampireAchao (via GitHub)" <gi...@apache.org>.
VampireAchao commented on code in PR #3295:
URL: https://github.com/apache/incubator-streampark/pull/3295#discussion_r1378513287
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/YarnQueueService.java:
##########
@@ -27,7 +27,7 @@
public interface YarnQueueService extends IService<YarnQueue> {
- IPage<YarnQueue> findYarnQueues(YarnQueue yarnQueue, RestRequest restRequest);
+ IPage<YarnQueue> getPage(YarnQueue yarnQueue, RestRequest restRequest);
Review Comment:
`yarnQueueService.getPage` already mentioned `yarnQueue`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org