-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[refactor][cli][PIP-280] Refactor pulsar-client-tools
module
#20764
Conversation
This reverts commit 26d3348.
@tisonkun May I ask for a review? 🙏🏼 |
pulsar-client-tools
modulepulsar-client-tools
module
Thanks for your contribution! I'll give a review this weekend. |
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.
Thanks for your contribution @JooHyukKim!
This patch is in a good direction. Comments inline. And please check the CI failure.
final int retentionTimeInMin = retentionTimeInSec != -1 | ||
? (int) TimeUnit.SECONDS.toMinutes(retentionTimeInSec) | ||
: retentionTimeInSec.intValue(); | ||
final int retentionSizeInMB = sizeLimit != -1 |
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.
Perhaps we can later move this size conversion to ByteUnitUtil
also.
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.
True true 👍🏼, added to #21056
@@ -1311,23 +1297,16 @@ void run() throws PulsarAdminException { | |||
BacklogQuota.Builder builder = BacklogQuota.builder().retentionPolicy(policy); | |||
if (backlogQuotaType == BacklogQuota.BacklogQuotaType.destination_storage) { | |||
// set quota by storage size | |||
if (limitStr == null) { | |||
if (limit == null) { |
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.
We may use a Nonnull ValueValidator here?
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.
Hmmm, I did not touch limit
and limitTimeInSec
because they both have meaningful exception message such as...
throw new ParameterException("Quota type of 'destination_storage' needs a size limit");
... this, so may not fit, and plus Validator
s and Converter
s are both passed static via annotation, so... kinda tricky.
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.
Thanks for your explanation! Let's keep it AS IS then.
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java
Show resolved
Hide resolved
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.
LGTM. We should try to fix the CI issue.
Thanks for the review! @tisonkun I suspect the OWASP dependency check workflow might not run for commits/PRs from maintainers. This might slow down fixes, but I haven't yet succeeded in verifying. 🧐 |
/pulsarbot rerun-failure-checks |
@JooHyukKim Please read the CI output before retry, it gives:
So you may need to update some LICENSE file. Please check the CI output for details. |
Converted to |
Rebase on #20663. Let's test once more. |
Signed-off-by: tison <wander4096@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #20764 +/- ##
============================================
+ Coverage 73.25% 73.27% +0.02%
+ Complexity 32517 32510 -7
============================================
Files 1888 1888
Lines 140246 140067 -179
Branches 15443 15408 -35
============================================
- Hits 102736 102633 -103
+ Misses 29419 29373 -46
+ Partials 8091 8061 -30
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Thanks for your contributon! The first migration step is merged now :D |
…e#20764) Signed-off-by: tison <wander4096@gmail.com> Co-authored-by: tison <wander4096@gmail.com>
@tisonkun Thank you also for considerate time investment on this one! I will try to pick up where I left off 👍🏼. |
PIP: #20691
Motivation
Modifications
Verifying this change
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: https://github.com/JooHyukKim/pulsar/pull/18