Jason918 commented on a change in pull request #14151:
URL: https://github.com/apache/pulsar/pull/14151#discussion_r803454189
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherSingleActiveConsumer.java
##########
@@ -543,19 +543,13 @@ public void updateRateLimiter(DispatchRate dispatchRate) {
if (!this.dispatchRateLimiter.isPresent() && dispatchRate != null) {
this.dispatchRateLimiter = Optional.of(new
DispatchRateLimiter(topic, Type.SUBSCRIPTION));
}
- this.dispatchRateLimiter.ifPresent(limiter -> {
- if (dispatchRate != null) {
-
this.dispatchRateLimiter.get().updateDispatchRate(dispatchRate);
- } else {
- this.dispatchRateLimiter.get().updateDispatchRate();
- }
- });
+
this.dispatchRateLimiter.ifPresent(DispatchRateLimiter::updateDispatchRate);
}
@Override
public void initializeDispatchRateLimiterIfNeeded(Optional<Policies>
policies) {
Review comment:
We can remove "Optional<Policies> policies" now.
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherSingleActiveConsumer.java
##########
@@ -543,19 +543,13 @@ public void updateRateLimiter(DispatchRate dispatchRate) {
if (!this.dispatchRateLimiter.isPresent() && dispatchRate != null) {
Review comment:
We can call `initializeDispatchRateLimiterIfNeeded` here after remove
the params.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]