Package kafka.server
Class ReplicationQuotaManager
java.lang.Object
kafka.server.ReplicationQuotaManager
- All Implemented Interfaces:
ReplicaQuota
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReplicationQuotaManager
(org.apache.kafka.server.config.ReplicationQuotaManagerConfig config, org.apache.kafka.common.metrics.Metrics metrics, org.apache.kafka.server.quota.QuotaType replicationType, org.apache.kafka.common.utils.Time time) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Check if the quota is currently exceededboolean
isThrottled
(org.apache.kafka.common.TopicPartition topicPartition) Is the passed partition throttled by this ReplicationQuotaManagervoid
markThrottled
(String topic) Mark all replicas for this topic as throttledvoid
markThrottled
(String topic, List<Integer> partitions) Update the set of throttled partitions for this QuotaManager.void
record
(long value) Add the passed value to the throttled rate.void
removeThrottle
(String topic) void
updateQuota
(org.apache.kafka.common.metrics.Quota quota) Update the quotalong
-
Field Details
-
ALL_REPLICAS
-
-
Constructor Details
-
ReplicationQuotaManager
public ReplicationQuotaManager(org.apache.kafka.server.config.ReplicationQuotaManagerConfig config, org.apache.kafka.common.metrics.Metrics metrics, org.apache.kafka.server.quota.QuotaType replicationType, org.apache.kafka.common.utils.Time time)
-
-
Method Details
-
updateQuota
public void updateQuota(org.apache.kafka.common.metrics.Quota quota) Update the quota -
isQuotaExceeded
public boolean isQuotaExceeded()Check if the quota is currently exceeded- Specified by:
isQuotaExceeded
in interfaceReplicaQuota
-
isThrottled
public boolean isThrottled(org.apache.kafka.common.TopicPartition topicPartition) Is the passed partition throttled by this ReplicationQuotaManager- Specified by:
isThrottled
in interfaceReplicaQuota
-
record
public void record(long value) Add the passed value to the throttled rate. This method ignores the quota with the value being added to the rate even if the quota is exceeded- Specified by:
record
in interfaceReplicaQuota
-
markThrottled
Update the set of throttled partitions for this QuotaManager. The partitions passed, for any single topic, will replace any previous -
markThrottled
Mark all replicas for this topic as throttled -
removeThrottle
-
upperBound
public long upperBound()
-