You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@amoro.apache.org by "klion26 (via GitHub)" <gi...@apache.org> on 2024/10/20 09:06:01 UTC
[PR] [AMORO-3279] Get the total result when retrieve the optimizing tables from db [amoro]
klion26 opened a new pull request, #3283:
URL: https://github.com/apache/amoro/pull/3283
<!--
Thanks for sending a pull request!
Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://amoro.apache.org/how-to-contribute/
2. If the PR is related to an issue in https://github.com/apache/amoro/issues, add '[AMORO-XXXX]' in your PR title, e.g., '[AMORO-XXXX] Your PR title ...'.
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][AMORO-XXXX] Your PR title ...'.
-->
## Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you add a feature, you can talk about its use case.
2. If you fix a bug, you can clarify why it is a bug.
3. Use Fix/Resolve/Close #{ISSUE_NUMBER} to link this PR to its related issue
-->
Close #3279
## Brief change log
<!--
Clearly describe the changes made in modules, classes, methods, etc.
-->
Before the change, the total number of optimizing tables with the given filter will be retrieved from memory, this means that we'll retrieve info from two different place, after the change, we'll retrieve the optimizing tables and total result both frm db by using PageHelper.
-
## How was this patch tested?
- [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible
- [ ] Add screenshots for manual tests if appropriate
- [ ] Run test locally before making a pull request
## Documentation
- Does this pull request introduce a new feature? (no)
- If yes, how is the feature documented? (not applicable)
--
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: commits-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [AMORO-3279] Get the total result when retrieve the optimizing tables from db [amoro]
Posted by "zhoujinsong (via GitHub)" <gi...@apache.org>.
zhoujinsong merged PR #3283:
URL: https://github.com/apache/amoro/pull/3283
--
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: commits-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [AMORO-3279] Get the total result when retrieve the optimizing tables from db [amoro]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #3283:
URL: https://github.com/apache/amoro/pull/3283#issuecomment-2425888489
## [Codecov](https://app.codecov.io/gh/apache/amoro/pull/3283?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: Patch coverage is `44.44444%` with `15 lines` in your changes missing coverage. Please review.
> Project coverage is 30.17%. Comparing base [(`63b355d`)](https://app.codecov.io/gh/apache/amoro/commit/63b355da88664b60a8f9c40ee902edc4753da0d2?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`5393cdf`)](https://app.codecov.io/gh/apache/amoro/commit/5393cdf5cff84e56176d38a8396d601ba92f64c2?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 1 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/amoro/pull/3283?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...dashboard/controller/OptimizerGroupController.java](https://app.codecov.io/gh/apache/amoro/pull/3283?src=pr&el=tree&filepath=amoro-ams%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Famoro%2Fserver%2Fdashboard%2Fcontroller%2FOptimizerGroupController.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-YW1vcm8tYW1zL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9hbW9yby9zZXJ2ZXIvZGFzaGJvYXJkL2NvbnRyb2xsZXIvT3B0aW1pemVyR3JvdXBDb250cm9sbGVyLmphdmE=) | 7.14% | [13 Missing :warning: ](https://app.codecov.io/gh/apache/amoro/pull/3283?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ache/amoro/server/optimizing/OptimizingStatus.java](https://app.codecov.io/gh/apache/amoro/pull/3283?src=pr&el=tree&filepath=amoro-ams%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Famoro%2Fserver%2Foptimizing%2FOptimizingStatus.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-YW1vcm8tYW1zL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9hbW9yby9zZXJ2ZXIvb3B0aW1pemluZy9PcHRpbWl6aW5nU3RhdHVzLmphdmE=) | 50.00% | [1 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/amoro/pull/3283?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #3283 +/- ##
============================================
+ Coverage 22.54% 30.17% +7.63%
- Complexity 2312 3841 +1529
============================================
Files 397 580 +183
Lines 38201 48020 +9819
Branches 5437 6207 +770
============================================
+ Hits 8611 14491 +5880
- Misses 28863 32538 +3675
- Partials 727 991 +264
```
| [Flag](https://app.codecov.io/gh/apache/amoro/pull/3283/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [core](https://app.codecov.io/gh/apache/amoro/pull/3283/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `30.17% <44.44%> (?)` | |
| [trino](https://app.codecov.io/gh/apache/amoro/pull/3283/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/amoro/pull/3283?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
--
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: commits-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [AMORO-3279] Get the total result when retrieve the optimizing tables from db [amoro]
Posted by "klion26 (via GitHub)" <gi...@apache.org>.
klion26 commented on code in PR #3283:
URL: https://github.com/apache/amoro/pull/3283#discussion_r1808136592
##########
amoro-ams/src/main/java/org/apache/amoro/server/dashboard/controller/OptimizerGroupController.java:
##########
@@ -82,25 +84,33 @@ public void getOptimizerTables(Context ctx) {
String optimizerGroupUsedInDbFilter = ALL_GROUP.equals(optimizerGroup) ? null : optimizerGroup;
// get all info from underlying table table_runtime
- List<TableRuntimeMeta> tableRuntimeBeans =
+
+ List<Integer> statusCodes =
+ actionFilter.isEmpty()
+ ? null
+ : actionFilter.stream()
+ .map(filter -> ProcessStatus.valueOf(filter).ordinal())
Review Comment:
```suggestion
.map(filter -> OptimizingStatus.valueOf(filter).getCode())
```
--
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: commits-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [AMORO-3279] Get the total result when retrieve the optimizing tables from db [amoro]
Posted by "klion26 (via GitHub)" <gi...@apache.org>.
klion26 commented on PR #3283:
URL: https://github.com/apache/amoro/pull/3283#issuecomment-2425779646
@zhoujinsong @majin1102 could you please have a look at this when you're free, thanks.
--
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: commits-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [AMORO-3279] Get the total result when retrieve the optimizing tables from db [amoro]
Posted by "klion26 (via GitHub)" <gi...@apache.org>.
klion26 commented on code in PR #3283:
URL: https://github.com/apache/amoro/pull/3283#discussion_r1808472725
##########
amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableService.java:
##########
@@ -344,18 +346,35 @@ public List<Blocker> getBlockers(TableIdentifier tableIdentifier) {
}
@Override
- public List<TableRuntimeMeta> getTableRuntimes(
+ public Pair<List<TableRuntimeMeta>, Integer> getTableRuntimes(
Review Comment:
I've added the comments in the Interface, please take another look when you're free. thanks.
--
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: commits-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [AMORO-3279] Get the total result when retrieve the optimizing tables from db [amoro]
Posted by "klion26 (via GitHub)" <gi...@apache.org>.
klion26 commented on code in PR #3283:
URL: https://github.com/apache/amoro/pull/3283#discussion_r1808136592
##########
amoro-ams/src/main/java/org/apache/amoro/server/dashboard/controller/OptimizerGroupController.java:
##########
@@ -82,25 +84,33 @@ public void getOptimizerTables(Context ctx) {
String optimizerGroupUsedInDbFilter = ALL_GROUP.equals(optimizerGroup) ? null : optimizerGroup;
// get all info from underlying table table_runtime
- List<TableRuntimeMeta> tableRuntimeBeans =
+
+ List<Integer> statusCodes =
+ actionFilter.isEmpty()
+ ? null
+ : actionFilter.stream()
+ .map(filter -> ProcessStatus.valueOf(filter).ordinal())
Review Comment:
```suggestion
.map(filter -> OptimizingStatus.ofDisplayValue(filter).getCode())
```
--
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: commits-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [AMORO-3279] Get the total result when retrieve the optimizing tables from db [amoro]
Posted by "zhoujinsong (via GitHub)" <gi...@apache.org>.
zhoujinsong commented on code in PR #3283:
URL: https://github.com/apache/amoro/pull/3283#discussion_r1808438219
##########
amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableService.java:
##########
@@ -344,18 +346,35 @@ public List<Blocker> getBlockers(TableIdentifier tableIdentifier) {
}
@Override
- public List<TableRuntimeMeta> getTableRuntimes(
+ public Pair<List<TableRuntimeMeta>, Integer> getTableRuntimes(
Review Comment:
Can you add some comments to explain the meaning of this return value?
--
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: commits-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [AMORO-3279] Get the total result when retrieve the optimizing tables from db [amoro]
Posted by "klion26 (via GitHub)" <gi...@apache.org>.
klion26 commented on PR #3283:
URL: https://github.com/apache/amoro/pull/3283#issuecomment-2426516546
@zhoujinsong thanks for the review and merging!
--
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: commits-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org