mimaison commented on code in PR #13417:
URL: https://github.com/apache/kafka/pull/13417#discussion_r1272000322


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/LogConfig.java:
##########
@@ -59,6 +35,35 @@
 import org.apache.kafka.server.config.ServerTopicConfigSynonyms;
 import org.apache.kafka.server.record.BrokerCompressionType;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+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 static java.util.Arrays.asList;
+import static org.apache.kafka.common.config.ConfigDef.Importance.HIGH;
+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.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.INT;
+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.common.config.ConfigDef.ValidString.in;
+import static org.apache.kafka.server.common.MetadataVersion.IBP_3_0_IV1;

Review Comment:
   Can we undo reordering the imports?



##########
streams/src/test/java/org/apache/kafka/streams/integration/SmokeTestDriverIntegrationTest.java:
##########
@@ -38,6 +37,7 @@
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
+import java.util.stream.Stream;

Review Comment:
   This is not related to the rest of this PR, let's undo this change



##########
metadata/src/main/java/org/apache/kafka/metadata/broker/RawMetaProperties.java:
##########
@@ -0,0 +1,120 @@
+/*
+ * 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.metadata.broker;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+import java.util.Properties;
+
+public class RawMetaProperties {

Review Comment:
   I wonder if we should first do a PR to move these classes from core to 
metadata. 



##########
checkstyle/import-control.xml:
##########
@@ -302,6 +302,9 @@
     <allow pkg="org.apache.kafka.clients.admin" />
     <allow pkg="org.apache.kafka.clients.producer" />
     <allow pkg="org.apache.kafka.clients.consumer" />
+    <allow pkg="org.apache.kafka.metadata.bootstrap" />
+    <allow pkg="org.apache.kafka.metadata.broker" />
+    <allow pkg="org.apache.kafka.storage.internals.log" />

Review Comment:
   We should not import internals packages. 



##########
storage/src/main/java/org/apache/kafka/storage/internals/log/LogConfig.java:
##########
@@ -230,6 +235,55 @@ public Optional<String> serverConfigName(String 
configName) {
         FOLLOWER_REPLICATION_THROTTLED_REPLICAS_CONFIG
     ));
 
+    private static final String DEFAULT_LOG_DIR = "/tmp/kafka-logs";

Review Comment:
   This class is for configurations for the storage layer. We should not put 
unrelated configurations like `ZOOKEEPER_CONNECT_PROP` in it.



##########
core/src/main/scala/kafka/utils/ToolsUtils.scala:
##########
@@ -79,4 +94,226 @@ object ToolsUtils {
     CommandLineUtils.printUsageAndExit(parser, message)
     throw new AssertionError("printUsageAndExit should not return, but it 
did.")
   }
+
+  def buildBootstrapMetadata(metadataVersion: MetadataVersion,
+                             metadataOptionalArguments: 
Option[ArrayBuffer[ApiMessageAndVersion]],
+                             source: String): BootstrapMetadata = {
+
+    val metadataRecords = new util.ArrayList[ApiMessageAndVersion]
+    metadataRecords.add(new ApiMessageAndVersion(new FeatureLevelRecord().
+      setName(MetadataVersion.FEATURE_NAME).
+      setFeatureLevel(metadataVersion.featureLevel()), 0.toShort));
+
+    metadataOptionalArguments.foreach { metadataArguments =>
+      for (record <- metadataArguments) metadataRecords.add(record)
+    }
+
+    BootstrapMetadata.fromRecords(metadataRecords, source)
+  }
+
+  def parseArguments(args: Array[String]): Namespace = {

Review Comment:
   It looks like these methods are specific to the Kafka storage tool. We 
should not put them in a utils class and not in core.



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