Skip to content

Commit

Permalink
Reduced ERROR level logging in KafkaAdminTopicConfigProvider
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Cooper <code@tomcooper.dev>
  • Loading branch information
tomncooper committed Jun 3, 2021
1 parent 677fd99 commit 5ca0999
Showing 1 changed file with 6 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@

package com.linkedin.kafka.cruisecontrol.config;

import com.linkedin.kafka.cruisecontrol.KafkaCruiseControl;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;
import com.linkedin.kafka.cruisecontrol.config.constants.ExecutorConfig;
import com.linkedin.kafka.cruisecontrol.model.Load;
import com.linkedin.kafka.cruisecontrol.monitor.LoadMonitor;
import org.apache.kafka.clients.admin.AdminClient;
import org.apache.kafka.clients.admin.Config;
Expand All @@ -24,7 +19,6 @@
import org.slf4j.LoggerFactory;

import static com.linkedin.cruisecontrol.common.utils.Utils.validateNotNull;
import static com.linkedin.kafka.cruisecontrol.detector.AnomalyDetectorUtils.KAFKA_CRUISE_CONTROL_OBJECT_CONFIG;


/**
Expand Down Expand Up @@ -62,12 +56,8 @@ public Properties topicConfigs(String topic) {
.all()
.get()
.get(topicResource);
} catch (InterruptedException e) {
LOG.error("The request for the configuration of topic '{}' was interrupted", topic);
e.printStackTrace();
} catch (ExecutionException e) {
LOG.error("The request for the configuration of topic '{}' failed", topic);
e.printStackTrace();
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Config check for topic {} failed due to failure to describe its configs.", topic, e);
}

if (topicConfig != null) {
Expand All @@ -93,12 +83,8 @@ public Map<String, Properties> allTopicConfigs() {
)
.get()
.get();
} catch (InterruptedException e) {
LOG.error("The request for the configuration of all topics was interrupted");
e.printStackTrace();
} catch (ExecutionException e) {
LOG.error("The request for the configuration of all topics failed");
e.printStackTrace();
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Config check for all topics failed due to failure to describe their configs.", e);
}

Map<String, Properties> propsMap = new HashMap<>();
Expand Down Expand Up @@ -127,7 +113,8 @@ private static Properties convertTopicConfigToProperties(Config config) {
public void configure(Map<String, ?> configs) {
_adminClient = (AdminClient) validateNotNull(
configs.get(LoadMonitor.KAFKA_ADMIN_CLIENT_OBJECT_CONFIG),
() -> String.format("Missing %s when creating Kafka Admin Client based Topic Config Provider", LoadMonitor.KAFKA_ADMIN_CLIENT_OBJECT_CONFIG));
() -> String.format("Missing %s when creating Kafka Admin Client based Topic Config Provider",
LoadMonitor.KAFKA_ADMIN_CLIENT_OBJECT_CONFIG));
_clusterConfigs = loadClusterConfigs(configs, CLUSTER_CONFIGS_FILE);
}

Expand Down

0 comments on commit 5ca0999

Please sign in to comment.