[GitHub] [kafka] satishd commented on a diff in pull request #13049: KAFKA-14478: Move LogConfig/CleanerConfig and related to storage module

2023-01-04 Thread GitBox


satishd commented on code in PR #13049:
URL: https://github.com/apache/kafka/pull/13049#discussion_r1062049275


##
storage/src/main/java/org/apache/kafka/server/log/internals/LogConfig.java:
##
@@ -0,0 +1,504 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.server.log.internals;
+
+import static java.util.Arrays.asList;
+import static org.apache.kafka.common.config.ConfigDef.Range.between;
+import static org.apache.kafka.common.config.ConfigDef.Type.BOOLEAN;
+import static org.apache.kafka.common.config.ConfigDef.Type.DOUBLE;
+import static org.apache.kafka.common.config.ConfigDef.Type.LIST;
+import static org.apache.kafka.common.config.ConfigDef.Type.LONG;
+import static org.apache.kafka.common.config.ConfigDef.Type.STRING;
+import static org.apache.kafka.server.common.MetadataVersion.IBP_3_0_IV1;
+import static org.apache.kafka.common.config.ConfigDef.Importance.LOW;
+import static org.apache.kafka.common.config.ConfigDef.Importance.MEDIUM;
+import static org.apache.kafka.common.config.ConfigDef.Range.atLeast;
+import static org.apache.kafka.common.config.ConfigDef.Type.INT;
+import static org.apache.kafka.common.config.ConfigDef.ValidString.in;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.stream.Collectors;
+import org.apache.kafka.common.config.AbstractConfig;
+import org.apache.kafka.common.config.ConfigDef;
+import org.apache.kafka.common.config.ConfigDef.ConfigKey;
+import org.apache.kafka.common.config.ConfigDef.Type;
+import org.apache.kafka.common.config.ConfigDef.ValidList;
+import org.apache.kafka.common.config.ConfigException;
+import org.apache.kafka.common.config.TopicConfig;
+import org.apache.kafka.common.errors.InvalidConfigurationException;
+import org.apache.kafka.common.record.LegacyRecord;
+import org.apache.kafka.common.record.RecordVersion;
+import org.apache.kafka.common.record.Records;
+import org.apache.kafka.common.record.TimestampType;
+import org.apache.kafka.common.utils.ConfigUtils;
+import org.apache.kafka.common.utils.Utils;
+import org.apache.kafka.server.common.MetadataVersion;
+import org.apache.kafka.server.common.MetadataVersionValidator;
+import org.apache.kafka.server.config.ServerTopicConfigSynonyms;
+import org.apache.kafka.server.record.BrokerCompressionType;
+
+public class LogConfig extends AbstractConfig {
+
+public static class MessageFormatVersion {
+private final String messageFormatVersionString;
+private final String interBrokerProtocolVersionString;
+private final MetadataVersion messageFormatVersion;
+private final MetadataVersion interBrokerProtocolVersion;
+
+public MessageFormatVersion(String messageFormatVersionString, String 
interBrokerProtocolVersionString) {
+this.messageFormatVersionString = messageFormatVersionString;
+this.interBrokerProtocolVersionString = 
interBrokerProtocolVersionString;
+this.messageFormatVersion = 
MetadataVersion.fromVersionString(messageFormatVersionString);
+this.interBrokerProtocolVersion = 
MetadataVersion.fromVersionString(interBrokerProtocolVersionString);
+}
+
+public MetadataVersion messageFormatVersion() {
+return messageFormatVersion;
+}
+
+public MetadataVersion interBrokerProtocolVersion() {
+return interBrokerProtocolVersion;
+}
+
+public boolean shouldIgnore() {
+return 
shouldIgnoreMessageFormatVersion(interBrokerProtocolVersion);
+}
+
+public boolean shouldWarn() {
+return interBrokerProtocolVersion.isAtLeast(IBP_3_0_IV1)
+&& 
messageFormatVersion.highestSupportedRecordVersion().precedes(RecordVersion.V2);
+}
+
+@SuppressWarnings("deprecation")
+public String topicWarningMessage(String topicName) {
+return "Topic configuration " + 
TopicConfig.MESSAGE_FORMAT_VERSION_CONFIG + " with value `"
++ messageFormatV

[GitHub] [kafka] satishd commented on a diff in pull request #13049: KAFKA-14478: Move LogConfig/CleanerConfig and related to storage module

2023-01-04 Thread GitBox


satishd commented on code in PR #13049:
URL: https://github.com/apache/kafka/pull/13049#discussion_r1061238797


##
core/src/main/scala/kafka/raft/KafkaMetadataLog.scala:
##
@@ -544,7 +544,7 @@ case class MetadataLogConfig(logSegmentBytes: Int,
  retentionMillis: Long,
  maxBatchSizeInBytes: Int,
  maxFetchSizeInBytes: Int,
- fileDeleteDelayMs: Int,
+ fileDeleteDelayMs: Long,

Review Comment:
   Good catch!



-- 
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