chia7712 commented on code in PR #19579:
URL: https://github.com/apache/kafka/pull/19579#discussion_r2062814664


##########
server/src/main/java/org/apache/kafka/server/config/AbstractKafkaConfig.java:
##########
@@ -66,8 +68,16 @@ public abstract class AbstractKafkaConfig extends 
AbstractConfig {
         AddPartitionsToTxnConfig.CONFIG_DEF
     ));
 
+    public final List<String> logDirs;
+
+    @SuppressWarnings("this-escape")
     public AbstractKafkaConfig(ConfigDef definition, Map<?, ?> originals, 
Map<String, ?> configProviderProps, boolean doLog) {
         super(definition, originals, configProviderProps, doLog);
+        this.logDirs = 
Csv.parseCsvList(Optional.ofNullable(getString(ServerLogConfigs.LOG_DIRS_CONFIG)).orElse(getString(ServerLogConfigs.LOG_DIR_CONFIG)));

Review Comment:
   `KafkaConfig` overwrite the getter to reflect the newest config, so 
`getString` cause NPE as the sub class (`KafkaConfig`) is not initialized. 
   
   The logDirs() method isn't frequently used, so we can parse it only when 
it's needed to avoid initialization issues. WDYT?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to