Class HotPartitionManager

java.lang.Object
io.confluent.kafka.multitenant.metrics.HotPartitionManager
All Implemented Interfaces:
org.apache.kafka.common.Configurable

public class HotPartitionManager extends Object implements org.apache.kafka.common.Configurable
Manages the per-partition hot partition metrics derived from the bytes-in and bytes-out metrics on each partition. This classes provides the entry points of recording hot partitions' existence. It checks the current recorded ingress/egress for the given partition and determines whether to record the hot partitions or not.
  • Constructor Details

    • HotPartitionManager

      public HotPartitionManager(org.apache.kafka.common.utils.Time time)
  • Method Details

    • configure

      public void configure(Map<String,?> configs)
      Specified by:
      configure in interface org.apache.kafka.common.Configurable
    • mayRecordHotPartitionIn

      public void mayRecordHotPartitionIn(org.apache.kafka.common.metrics.Metrics metrics, TenantMetrics.TenantMetricsContext context, org.apache.kafka.common.TopicPartition tp, long timeMs)
      Records the existence of hot partition ingress-wise for the given partition. It first checks the current ingress of the given partition and determines whether to record the existence or not.
      Parameters:
      metrics - broker-wide metric registry
      context - request context to find the tenant and client id
      tp - topic partition to check and record hot partition
      timeMs - current timestamp in milliseconds
    • mayRecordHotPartitionOut

      public void mayRecordHotPartitionOut(org.apache.kafka.common.metrics.Metrics metrics, TenantMetrics.MetricsRequestContext context, org.apache.kafka.common.TopicPartition tp, long timeMs)
      Records the existence of hot partition egress-wise for the given partition. It first checks the current egress of the given partition and determines whether to record the existence or not.
      Parameters:
      metrics - broker-wide metric registry
      context - request context to find the tenant and client id
      tp - topic partition to check and record hot partition
      timeMs - current timestamp in milliseconds