Package kafka.server

Class ReplicationQuotaManager

java.lang.Object
kafka.server.ReplicationQuotaManager
All Implemented Interfaces:
ReplicaQuota

public class ReplicationQuotaManager extends Object implements ReplicaQuota
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final List<Integer>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 Summary

    Modifier and Type
    Method
    Description
    boolean
    Check if the quota is currently exceeded
    boolean
    isThrottled(org.apache.kafka.common.TopicPartition topicPartition)
    Is the passed partition throttled by this ReplicationQuotaManager
    void
    Mark all replicas for this topic as throttled
    void
    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
     
    void
    updateQuota(org.apache.kafka.common.metrics.Quota quota)
    Update the quota
    long
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ALL_REPLICAS

      public static final List<Integer> 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 interface ReplicaQuota
    • isThrottled

      public boolean isThrottled(org.apache.kafka.common.TopicPartition topicPartition)
      Is the passed partition throttled by this ReplicationQuotaManager
      Specified by:
      isThrottled in interface ReplicaQuota
    • 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 interface ReplicaQuota
    • markThrottled

      public void markThrottled(String topic, List<Integer> partitions)
      Update the set of throttled partitions for this QuotaManager. The partitions passed, for any single topic, will replace any previous
    • markThrottled

      public void markThrottled(String topic)
      Mark all replicas for this topic as throttled
    • removeThrottle

      public void removeThrottle(String topic)
    • upperBound

      public long upperBound()