jlprat commented on code in PR #15272: URL: https://github.com/apache/kafka/pull/15272#discussion_r1467861593
########## core/src/main/scala/kafka/server/metadata/BrokerMetadataPublisher.scala: ########## @@ -80,7 +80,7 @@ object BrokerMetadataPublisher extends Logging { Option(newTopicsImage.getPartition(topicId, partitionId)) match { case Some(partition) => if (!partition.replicas.contains(brokerId)) { - info(s"Found stray log dir $log: the current replica assignment ${partition.replicas} " + + info(s"Found stray log dir $log: the current replica assignment ${partition.replicas.mkString("Array(", ", ", ")")} " + Review Comment: This actually should have printed the memory reference and not the contents. With the current version, it prints the contents. ########## core/src/main/scala/kafka/server/ConfigAdminManager.scala: ########## @@ -154,26 +154,25 @@ class ConfigAdminManager(nodeId: Int, throw new InvalidRequestException(s"Unknown resource type ${resource.resourceType().toInt}") } } catch { - case t: Throwable => { + case t: Throwable => val err = ApiError.fromThrowable(t) - info(s"Error preprocessing incrementalAlterConfigs request on ${configResource}", t) + info(s"Error preprocessing incrementalAlterConfigs request on $configResource", t) results.put(resource, err) - } } } }) results } - def validateBrokerConfigChange( + private def validateBrokerConfigChange( resource: IAlterConfigsResource, configResource: ConfigResource ): Unit = { val perBrokerConfig = !configResource.name().isEmpty val persistentProps = configRepository.config(configResource) val configProps = conf.dynamicConfig.fromPersistentProps(persistentProps, perBrokerConfig) val alterConfigOps = resource.configs().asScala.map { - case config => + config => Review Comment: Previous code was the standard in really old version of Scala, since then anonymous function style is preferred. ########## core/src/main/scala/kafka/server/ConfigHelper.scala: ########## @@ -80,7 +80,7 @@ class ConfigHelper(metadataCache: MetadataCache, config: KafkaConfig, configRepo def describeConfigs(resourceToConfigNames: List[DescribeConfigsResource], includeSynonyms: Boolean, includeDocumentation: Boolean): List[DescribeConfigsResponseData.DescribeConfigsResult] = { - resourceToConfigNames.map { case resource => Review Comment: Previous code was the standard in really old version of Scala, since then anonymous function style is preferred. ########## core/src/main/scala/kafka/server/metadata/ClientQuotaMetadataManager.scala: ########## @@ -98,14 +98,14 @@ class ClientQuotaMetadataManager(private[metadata] val quotaManagers: QuotaManag } } quotaDelta.changes().entrySet().forEach { e => - handleUserClientQuotaChange(userClientEntity, e.getKey, e.getValue.asScala.map(_.toDouble)) + handleUserClientQuotaChange(userClientEntity, e.getKey, e.getValue.asScala) Review Comment: The map to Double wasn't needed as it was already a double ########## core/src/main/scala/kafka/server/ConfigAdminManager.scala: ########## @@ -369,15 +365,13 @@ object ConfigAdminManager { persistentResponses: AlterConfigsResponseData ): AlterConfigsResponseData = { val response = new AlterConfigsResponseData() - val responsesByResource = persistentResponses.responses().iterator().asScala.map { - case r => (r.resourceName(), r.resourceType()) -> new ApiError(r.errorCode(), r.errorMessage()) Review Comment: Previous code was the standard in really old version of Scala, since then anonymous function style is preferred. ########## core/src/main/scala/kafka/server/AutoTopicCreationManager.scala: ########## @@ -50,6 +50,10 @@ trait AutoTopicCreationManager { object AutoTopicCreationManager { + /** + * @deprecated use [[apply(kafka.server.KafkaConfig, kafka.server.MetadataCache, scala.Option, scala.Option, scala.Option, scala.Option, org.apache.kafka.coordinator.group.GroupCoordinator, kafka.coordinator.transaction.TransactionCoordinator)]] + */ + @deprecated("Use the alternative apply method", "3.8.0") Review Comment: I could alternatively delete this method altogether. -- 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