-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Issue 2689] Support set backlog quota on topic level. #7646
[Issue 2689] Support set backlog quota on topic level. #7646
Conversation
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.
Looks good to me, just left some minor comments.
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Outdated
Show resolved
Hide resolved
private boolean checkQuotas(BacklogQuota quota, RetentionPolicies retention) { | ||
if (retention==null||retention.getRetentionSizeInMB() == 0 || | ||
retention.getRetentionSizeInMB() == -1) { | ||
return true; | ||
} | ||
if (quota == null) { | ||
quota = pulsar().getBrokerService().getBacklogQuotaManager().getDefaultQuota(); | ||
} | ||
if (quota.getLimit() >= ( retention.getRetentionSizeInMB() * 1024 * 1024)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
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.
Should keep consistent with checkQuotas in the NamespacesBase, And you can move this method to AdminResource so that you can use it both in the NamespacesBase and PersistentTopicsBase
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.
Ok, I extracted it.
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java
Show resolved
Hide resolved
/pulsarbot run-failure-checks |
3 similar comments
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
… with the namespace
c705b50
to
3dc2dab
Compare
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
### Motivation Support set backlog quota on topic level. Based on the system topic function, refer to @codelipenghui topic-level backlog quota based on zk implementation ###Modifications Support get-backlog-quotas on topic level. Support set-backlog-quota on topic level. Support remove-backlog-quota on topic level.
### Motivation Support set backlog quota on topic level. Based on the system topic function, refer to @codelipenghui topic-level backlog quota based on zk implementation ###Modifications Support get-backlog-quotas on topic level. Support set-backlog-quota on topic level. Support remove-backlog-quota on topic level.
### Motivation Support set backlog quota on topic level. Based on the system topic function, refer to @codelipenghui topic-level backlog quota based on zk implementation ###Modifications Support get-backlog-quotas on topic level. Support set-backlog-quota on topic level. Support remove-backlog-quota on topic level.
…stence polices, message TTL, and backlog quota on topic level (#7852) Motivation In PRs, #7738, #7646, #7817, persistence polices, message TTL, and backlog quota policies are supported on topic level. The PR for code modification is updated and merged. but the doc is not updated accordingly. This PR is used to support to set/get/remove persistence polices, message TTL, and backlog quota on topic level. Modifications Update the Pulsar Admin CLI doc to support to set/get/remove persistence polices, message TTL, and backlog quota on topic level. * Update backlog-quota policies on topic level * update contents * update contents
…stence polices, message TTL, and backlog quota on topic level (apache#7852) Motivation In PRs, apache#7738, apache#7646, apache#7817, persistence polices, message TTL, and backlog quota policies are supported on topic level. The PR for code modification is updated and merged. but the doc is not updated accordingly. This PR is used to support to set/get/remove persistence polices, message TTL, and backlog quota on topic level. Modifications Update the Pulsar Admin CLI doc to support to set/get/remove persistence polices, message TTL, and backlog quota on topic level. * Update backlog-quota policies on topic level * update contents * update contents
Move this change to 2.6.2, because the #8199 depends on it. |
### Motivation Support set backlog quota on topic level. Based on the system topic function, refer to @codelipenghui topic-level backlog quota based on zk implementation ###Modifications Support get-backlog-quotas on topic level. Support set-backlog-quota on topic level. Support remove-backlog-quota on topic level. (cherry picked from commit 26c49a8)
Motivation
Support set backlog quota on topic level.
Based on the system topic function, refer to @codelipenghui topic-level backlog quota based on zk implementation
###Modifications
Support get-backlog-quotas on topic level.
Support set-backlog-quota on topic level.
Support remove-backlog-quota on topic level.
Verifying this change
This change added tests and can be verified as follows:
TopicBacklogQuotaTest.java
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesyes
)Documentation
yes
)docs
/JavaDocs
)