-
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 13756][Broker]Optimize topic policy with HierarchyTopicPolicies about publishRate #14267
Conversation
caa4b46
to
ce4c049
Compare
ce4c049
to
3bf6552
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/AbstractTopic.java
Outdated
Show resolved
Hide resolved
topicPolicies.getDelayedDeliveryEnabled().updateTopicValue(data.getDelayedDeliveryEnabled()); | ||
topicPolicies.getDelayedDeliveryTickTimeMillis().updateTopicValue(data.getDelayedDeliveryTickTimeMillis()); | ||
topicPolicies.getCompactionThreshold().updateTopicValue(data.getCompactionThreshold()); | ||
} | ||
|
||
private PublishRate normalize(PublishRate publishRate) { |
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's better to move this to a static method in PublishRate class.
topicPolicies.getDelayedDeliveryEnabled().updateTopicValue(data.getDelayedDeliveryEnabled()); | ||
topicPolicies.getDelayedDeliveryTickTimeMillis().updateTopicValue(data.getDelayedDeliveryTickTimeMillis()); | ||
topicPolicies.getCompactionThreshold().updateTopicValue(data.getCompactionThreshold()); | ||
} | ||
|
||
private PublishRate normalize(PublishRate publishRate) { |
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's better to move this to a static method in PublishRate class.
0787b18
to
353f93f
Compare
353f93f
to
1ea7071
Compare
@@ -1061,7 +1044,8 @@ protected boolean isExceedMaximumMessageSize(int size, PublishContext publishCon | |||
/** | |||
* update topic publish dispatcher for this topic. | |||
*/ | |||
protected void updatePublishDispatcher(PublishRate publishRate) { | |||
public void updatePublishDispatcher() { | |||
PublishRate publishRate = topicPolicies.getPublishRate().get(); |
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.
Can this return 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.
It can not return null, I will remove the if (publishRate != null
below @eolivelli
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.
@eolivelli PTAL
…s about publishRate (apache#14267)
Master Issue: #13756
Motivation
See issue: #13756
Modifications
publishRate
inorg.apache.pulsar.common.policies.data.HierarchyTopicPolicies
publishRate
inorg.apache.pulsar.broker.service.AbstractTopic
Verifying this change
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation
no-need-doc