-
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
[improve][broker] PIP-300: Add custom dynamic configuration for plugins #20884
[improve][broker] PIP-300: Add custom dynamic configuration for plugins #20884
Conversation
3b2294a
to
98eb21f
Compare
final Field field; | ||
// value holds the external dynamic configuration. | ||
final String value; |
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.
Why add the new field value
, I could not find the place which uses it.
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.
This value can be removed, and then call the addCustomDynamicConfiguration()
without the value.
* <p> | ||
* The custom dynamic configuration doesn't support setting up a listener. | ||
*/ | ||
public void addCustomDynamicConfiguration(String key, String defaultValue, Predicate<String> validator) { |
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.
This new API is dangerous because some config's dynamic update is not supported now, such as messageExpiryCheckIntervalInMinutes
, serverPort
, the field can be marked dynamic update
only when we have genuinely implemented the dynamic update.
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.
@codelipenghui @Technoboy- Could you take a look?
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.
I see, this method is used for the third-party plugin, when a dynamic configuration has been added, the user can use the PulsarAdmin
to update this dynamic configuration, and then the plugin can also call the pulsar().getPulsarResources().getDynamicConfigResources().getDynamicConfigurationAsync()
to get the dynamic configuration.
ccd4c39
to
1d99f18
Compare
1d99f18
to
0cb1c78
Compare
@liudezhi2098 If you want to cherry-pick this PR to branch-2.10 and branch-2.11, please use |
62736f6
to
bfd88d0
Compare
/pulsarbot rerun-failure-checks |
@nodece This is a new capability that will be introduced to Pulsar plugins. It should be started with a PIP, and we can't cherry-pick features to the patch releases. |
The pr had no activity for 30 days, mark with Stale label. |
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Outdated
Show resolved
Hide resolved
I'm sorry for missing out on this PR recently. I can continue working on it. |
Could you rebase to master since the branch of PR is far behind the master branch? |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #20884 +/- ##
============================================
- Coverage 73.50% 73.37% -0.13%
+ Complexity 32818 32750 -68
============================================
Files 1893 1893
Lines 140721 140726 +5
Branches 15502 15502
============================================
- Hits 103432 103253 -179
- Misses 29200 29356 +156
- Partials 8089 8117 +28
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
c04dbd2
to
2da728d
Compare
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Outdated
Show resolved
Hide resolved
...r-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiDynamicConfigurationsTest.java
Outdated
Show resolved
Hide resolved
...r-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiDynamicConfigurationsTest.java
Outdated
Show resolved
Hide resolved
...r-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiDynamicConfigurationsTest.java
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Outdated
Show resolved
Hide resolved
@BewareMyPower Thanks for your review and your suggestions have been applied. |
@mattisonchao Could you take a look again? |
@nodece Please fix the code style:
|
Motivation
See PIP-300
Modifications
registerCustomDynamicConfiguration()
to support adding the dynamic configuration.Verifying this change
Make sure that the change passes the CI checks.
Add
testRegisterCustomDynamicConfiguration()
test.Documentation
doc
doc-required
doc-not-needed
doc-complete