Skip to content

Commit

Permalink
KAFKA-18631 Remove ZkConfigs (#18693)
Browse files Browse the repository at this point in the history
Reviewers: Chia-Ping Tsai <[email protected]>
  • Loading branch information
mingyen066 authored Jan 25, 2025
1 parent 9bab9dc commit a8f6fc9
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 173 deletions.
1 change: 0 additions & 1 deletion checkstyle/import-control.xml
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,6 @@
<allow pkg="org.apache.kafka.metadata" />
<allow pkg="org.eclipse.jetty.client"/>
<allow class="org.apache.kafka.storage.internals.log.CleanerConfig" />
<allow class="org.apache.kafka.server.config.ZkConfigs" />
</subpackage>
</subpackage>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3704,8 +3704,8 @@ class PlaintextAdminIntegrationTest extends BaseAdminIntegrationTest {
new AlterConfigOp(new ConfigEntry("kafka.log.LogCleaner", LogLevelConfig.ERROR_LOG_LEVEL), AlterConfigOp.OpType.SET)
).asJavaCollection
alterBrokerLoggers(alterLogCleanerLoggerEntry)
val changedZKLoggerConfig = describeBrokerLoggers()
assertEquals(LogLevelConfig.ERROR_LOG_LEVEL, changedZKLoggerConfig.get("kafka.log.LogCleaner").value())
val changedBrokerLoggerConfig = describeBrokerLoggers()
assertEquals(LogLevelConfig.ERROR_LOG_LEVEL, changedBrokerLoggerConfig.get("kafka.log.LogCleaner").value())

// properly test various set operations and one delete
val alterLogLevelsEntries = Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ class DynamicBrokerConfigTest {
// in an AlterConfigs request. Validation should fail with an exception if any of the configs are invalid.
assertThrows(classOf[ConfigException], () => config.dynamicConfig.validate(props, perBrokerConfig = true))

// DynamicBrokerConfig#updateBrokerConfig is used to update configs from ZooKeeper during
// startup and when configs are updated in ZK. Update should apply valid configs and ignore
// DynamicBrokerConfig#updateBrokerConfig is used to update configs from broker during
// startup and when configs are updated in broker. Update should apply valid configs and ignore
// invalid ones.
config.dynamicConfig.updateBrokerConfig(0, props)
validProps.foreach { case (name, value) => assertEquals(value, config.originals.get(name)) }
Expand Down
20 changes: 2 additions & 18 deletions core/src/test/scala/unit/kafka/server/KafkaConfigTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import org.apache.kafka.coordinator.transaction.{TransactionLogConfig, Transacti
import org.apache.kafka.network.SocketServerConfigs
import org.apache.kafka.raft.QuorumConfig
import org.apache.kafka.server.common.MetadataVersion
import org.apache.kafka.server.config.{DelegationTokenManagerConfigs, KRaftConfigs, QuotaConfig, ReplicationConfigs, ServerConfigs, ServerLogConfigs, ServerTopicConfigSynonyms, ZkConfigs}
import org.apache.kafka.server.config.{DelegationTokenManagerConfigs, KRaftConfigs, QuotaConfig, ReplicationConfigs, ServerConfigs, ServerLogConfigs, ServerTopicConfigSynonyms}
import org.apache.kafka.server.log.remote.storage.RemoteLogManagerConfig
import org.apache.kafka.server.metrics.MetricConfigs
import org.apache.kafka.storage.internals.log.CleanerConfig
Expand All @@ -49,7 +49,7 @@ import org.junit.jupiter.api.function.Executable
import scala.jdk.CollectionConverters._

class KafkaConfigTest {

def createDefaultConfig(): Properties = {
val props = new Properties()
props.setProperty(KRaftConfigs.PROCESS_ROLES_CONFIG, "broker,controller")
Expand Down Expand Up @@ -799,21 +799,6 @@ class KafkaConfigTest {

KafkaConfig.configNames.foreach { name =>
name match {
case ZkConfigs.ZK_SSL_CLIENT_ENABLE_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_boolean")
case ZkConfigs.ZK_CLIENT_CNXN_SOCKET_CONFIG => //ignore string
case ZkConfigs.ZK_SSL_KEY_STORE_LOCATION_CONFIG => //ignore string
case ZkConfigs.ZK_SSL_KEY_STORE_PASSWORD_CONFIG => //ignore string
case ZkConfigs.ZK_SSL_KEY_STORE_TYPE_CONFIG => //ignore string
case ZkConfigs.ZK_SSL_TRUST_STORE_LOCATION_CONFIG => //ignore string
case ZkConfigs.ZK_SSL_TRUST_STORE_PASSWORD_CONFIG => //ignore string
case ZkConfigs.ZK_SSL_TRUST_STORE_TYPE_CONFIG => //ignore string
case ZkConfigs.ZK_SSL_PROTOCOL_CONFIG => //ignore string
case ZkConfigs.ZK_SSL_ENABLED_PROTOCOLS_CONFIG => //ignore string
case ZkConfigs.ZK_SSL_CIPHER_SUITES_CONFIG => //ignore string
case ZkConfigs.ZK_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG => //ignore string
case ZkConfigs.ZK_SSL_CRL_ENABLE_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_boolean")
case ZkConfigs.ZK_SSL_OCSP_ENABLE_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_boolean")

case ServerConfigs.BROKER_ID_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number")
case ServerConfigs.NUM_IO_THREADS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
case ServerConfigs.BACKGROUND_THREADS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
Expand Down Expand Up @@ -1180,7 +1165,6 @@ class KafkaConfigTest {
defaults.setProperty(KRaftConfigs.PROCESS_ROLES_CONFIG, "broker")
defaults.setProperty(QuorumConfig.QUORUM_BOOTSTRAP_SERVERS_CONFIG, "CONTROLLER://localhost:9092")
defaults.setProperty(KRaftConfigs.CONTROLLER_LISTENER_NAMES_CONFIG, "CONTROLLER")
// For ZkConnectionTimeoutMs
defaults.setProperty(ServerConfigs.BROKER_ID_GENERATION_ENABLE_CONFIG, "false")
defaults.setProperty(ServerConfigs.RESERVED_BROKER_MAX_ID_CONFIG, "1")
defaults.setProperty(ServerConfigs.BROKER_ID_CONFIG, "1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
public abstract class AbstractKafkaConfig extends AbstractConfig {
public static final ConfigDef CONFIG_DEF = Utils.mergeConfigs(List.of(
RemoteLogManagerConfig.configDef(),
ZkConfigs.CONFIG_DEF,
ServerConfigs.CONFIG_DEF,
KRaftConfigs.CONFIG_DEF,
SocketServerConfigs.CONFIG_DEF,
Expand Down
149 changes: 0 additions & 149 deletions server/src/main/java/org/apache/kafka/server/config/ZkConfigs.java

This file was deleted.

0 comments on commit a8f6fc9

Please sign in to comment.