-
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
support message dispatch rate on topic level #7863
support message dispatch rate on topic level #7863
Conversation
/pulsarbot run-failure-checks |
@MarvinCai @jianyun8023 Please help review this PR, thanks. |
/pulsarbot run-failure-checks |
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.
Leave a small comment.
@@ -3056,4 +3057,53 @@ protected void internalGetLastMessageId(AsyncResponse asyncResponse, boolean aut | |||
}); | |||
|
|||
} | |||
|
|||
protected void internalGetDispatchRate(AsyncResponse asyncResponse) { |
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.
It is recommended to return CompletableFuture instead of passing in the parameter AsyncResponse
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 have updated the implement interface, please take a look again. Thanks
|
||
@Override | ||
public void unregisterListener(TopicName topicName, TopicPolicyListener<TopicPolicies> listener) { | ||
listeners.computeIfAbsent(topicName, k -> Lists.newCopyOnWriteArrayList()); |
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.
wouldn't this remove all listeners for a given topic?
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.
It should remove the specific listener, and i have updated the code, please take a look again. Thanks
/pulsarbot run-failure-checks |
3 similar comments
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
b6712de
to
90fe769
Compare
/pulsarbot run-failure-checks |
### Motivation Support message dispatch rate on topic level. Based on the system topic function. ### Modifications Support set message dispatch rate on topic level. Support get message dispatch rate on topic level. Support remove message dispatch rate on topic level.
### Motivation Support message dispatch rate on topic level. Based on the system topic function. ### Modifications Support set message dispatch rate on topic level. Support get message dispatch rate on topic level. Support remove message dispatch rate on topic level.
### Motivation Support message dispatch rate on topic level. Based on the system topic function. ### Modifications Support set message dispatch rate on topic level. Support get message dispatch rate on topic level. Support remove message dispatch rate on topic level.
Fixes #7863 ### Motivation 1) Topic level policy will be overwritten by namespace level 2) After removing the topic level policy, `DispatchLimiter` does not take effect, the namespace level policy should be used ### Modifications 1)If there is a topic-level policy, it will not be overwritten by the namespace-level policy when the policy is updated 2)When removing topic-level policy, namespace-level policy will be used. If the namespace-level policy does not exist, the broker level will be used ### Verifying this change unit test: TopicPoliciesTest#testPolicyOverwrittenByNamespaceLevel
Fixes apache#7863 ### Motivation 1) Topic level policy will be overwritten by namespace level 2) After removing the topic level policy, `DispatchLimiter` does not take effect, the namespace level policy should be used ### Modifications 1)If there is a topic-level policy, it will not be overwritten by the namespace-level policy when the policy is updated 2)When removing topic-level policy, namespace-level policy will be used. If the namespace-level policy does not exist, the broker level will be used ### Verifying this change unit test: TopicPoliciesTest#testPolicyOverwrittenByNamespaceLevel
### Motivation Maybe CI jobs are failing with OOM in the brokers unit tests. The Surefire worker is configured with 4 processes, each with xmx of 1G. The problem was introduced in #7863 where a static map of listeners was added to an interface. That makes that map to contain all the `PulsarService` instances created during the tests execution and keeping references to everything else. The map should instead be scoped to the specific instance.
Maybe CI jobs are failing with OOM in the brokers unit tests. The Surefire worker is configured with 4 processes, each with xmx of 1G. The problem was introduced in #7863 where a static map of listeners was added to an interface. That makes that map to contain all the `PulsarService` instances created during the tests execution and keeping references to everything else. The map should instead be scoped to the specific instance. (cherry picked from commit 31ee454)
…9486) ### Motivation Maybe CI jobs are failing with OOM in the brokers unit tests. The Surefire worker is configured with 4 processes, each with xmx of 1G. The problem was introduced in apache#7863 where a static map of listeners was added to an interface. That makes that map to contain all the `PulsarService` instances created during the tests execution and keeping references to everything else. The map should instead be scoped to the specific instance.
Motivation
Support message dispatch rate on topic level.
Based on the system topic function.
Modifications
Support set message dispatch rate on topic level.
Support get message dispatch rate on topic level.
Support remove message dispatch rate on topic level.
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
If yes was chosen, please highlight the changes
Documentation
Does this pull request introduce a new feature? (yes)
If yes, how is the feature documented? (docs / JavaDocs)