Package org.apache.pulsar.broker.service
Interface PublishRateLimiter
- All Known Implementing Classes:
DisabledPublishRateLimiter,PublishRateLimiterImpl,ResourceGroupPublishLimiter
public interface PublishRateLimiter
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandlePublishThrottling(Producer producer, int numOfMessages, long msgSizeInBytes) Consumes publishing quota and handles throttling.voidupdates rate-limiting threshold based on policies.voidupdate(org.apache.pulsar.common.policies.data.PublishRate maxPublishRate) updates rate-limiting threshold based on passed in rate limiter.
-
Method Details
-
handlePublishThrottling
Consumes publishing quota and handles throttling.The rate limiter implementation calls
Producer.incrementThrottleCount()to indicate that the producer should be throttled. The rate limiter must schedule a call toProducer.decrementThrottleCount()after a throttling period that it calculates.- Parameters:
numOfMessages- number of messages to publishmsgSizeInBytes- size of messages in bytes to publish
-
update
updates rate-limiting threshold based on policies.- Parameters:
policies-clusterName-
-
update
void update(org.apache.pulsar.common.policies.data.PublishRate maxPublishRate) updates rate-limiting threshold based on passed in rate limiter.- Parameters:
maxPublishRate-
-