public interface PublishRateLimiter
| Modifier and Type | Field and Description |
|---|---|
static PublishRateLimiter |
DISABLED_RATE_LIMITER |
| Modifier and Type | Method and Description |
|---|---|
void |
checkPublishRate()
checks and update state of current publish and marks if it has exceeded the rate-limiting threshold.
|
void |
incrementPublishCount(int numOfMessages,
long msgSizeInBytes)
increments current publish count.
|
boolean |
isPublishRateExceeded()
returns true if current publish has reached the rate-limiting threshold.
|
boolean |
resetPublishCount()
reset current publish count.
|
boolean |
tryAcquire(int numbers,
long bytes)
try to acquire permit
|
void |
update(org.apache.pulsar.common.policies.data.Policies policies,
String clusterName)
updates rate-limiting threshold based on policies.
|
void |
update(org.apache.pulsar.common.policies.data.PublishRate maxPublishRate)
updates rate-limiting threshold based on passed in rate limiter.
|
static final PublishRateLimiter DISABLED_RATE_LIMITER
void checkPublishRate()
void incrementPublishCount(int numOfMessages,
long msgSizeInBytes)
numOfMessages - msgSizeInBytes - boolean resetPublishCount()
boolean isPublishRateExceeded()
void update(org.apache.pulsar.common.policies.data.Policies policies,
String clusterName)
policies - clusterName - void update(org.apache.pulsar.common.policies.data.PublishRate maxPublishRate)
maxPublishRate - boolean tryAcquire(int numbers,
long bytes)
numbers - bytes - Copyright © 2017–2021 Apache Software Foundation. All rights reserved.