Skip to content

Commit

Permalink
fix(auto_balancer): add client ACL to load retriever consumer (#1182)
Browse files Browse the repository at this point in the history
Signed-off-by: Shichao Nie <[email protected]>
  • Loading branch information
SCNieh authored Apr 26, 2024
1 parent 13e0abd commit 1854f7a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/main/java/kafka/autobalancer/LoadRetriever.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import kafka.autobalancer.common.AutoBalancerThreadFactory;
import kafka.autobalancer.common.types.MetricTypes;
import kafka.autobalancer.config.AutoBalancerControllerConfig;
import kafka.autobalancer.config.StaticAutoBalancerConfig;
import kafka.autobalancer.config.StaticAutoBalancerConfigUtils;
import kafka.autobalancer.listeners.BrokerStatusListener;
import kafka.autobalancer.metricsreporter.metric.AutoBalancerMetrics;
import kafka.autobalancer.metricsreporter.metric.BrokerMetrics;
Expand Down Expand Up @@ -79,6 +81,7 @@ public class LoadRetriever extends AbstractResumableService implements BrokerSta
private final ScheduledExecutorService mainExecutorService;
private final Set<Integer> brokerIdsInUse;
private final Set<TopicPartition> currentAssignment = new HashSet<>();
private final StaticAutoBalancerConfig staticConfig;
private volatile boolean leaderEpochInitialized;
private volatile boolean isLeader;
private volatile Consumer<String, AutoBalancerMetrics> consumer;
Expand All @@ -97,6 +100,7 @@ public LoadRetriever(AutoBalancerControllerConfig config, Controller controller,
this.cond = lock.newCondition();
this.mainExecutorService = Executors.newSingleThreadScheduledExecutor(new AutoBalancerThreadFactory("load-retriever-main"));
leaderEpochInitialized = false;
staticConfig = new StaticAutoBalancerConfig(config.originals(), false);
metricReporterTopicPartition = config.getInt(AutoBalancerControllerConfig.AUTO_BALANCER_CONTROLLER_METRICS_TOPIC_NUM_PARTITIONS_CONFIG);
metricReporterTopicRetentionTime = config.getLong(AutoBalancerControllerConfig.AUTO_BALANCER_CONTROLLER_METRICS_TOPIC_RETENTION_MS_CONFIG);
consumerPollTimeout = config.getLong(AutoBalancerControllerConfig.AUTO_BALANCER_CONTROLLER_CONSUMER_POLL_TIMEOUT);
Expand Down Expand Up @@ -145,6 +149,7 @@ protected KafkaConsumer<String, AutoBalancerMetrics> createConsumer(String boots
consumerProps.setProperty(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "false");
consumerProps.setProperty(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
consumerProps.setProperty(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, MetricSerde.class.getName());
StaticAutoBalancerConfigUtils.addSslConfigs(consumerProps, this.staticConfig);
return new KafkaConsumer<>(consumerProps);
}

Expand Down

0 comments on commit 1854f7a

Please sign in to comment.