You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/07/21 18:54:38 UTC

[GitHub] [kafka] abbccdda opened a new pull request #9049: MINOR: fix scala warnings

abbccdda opened a new pull request #9049:
URL: https://github.com/apache/kafka/pull/9049


   
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


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

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



[GitHub] [kafka] ijuma commented on a change in pull request #9049: MINOR: fix scala warnings

Posted by GitBox <gi...@apache.org>.
ijuma commented on a change in pull request #9049:
URL: https://github.com/apache/kafka/pull/9049#discussion_r460453337



##########
File path: core/src/main/scala/kafka/admin/ConfigCommand.scala
##########
@@ -344,11 +342,14 @@ object ConfigCommand extends Config {
         val sensitiveEntries = newEntries.filter(_._2.value == null)
         if (sensitiveEntries.nonEmpty)
           throw new InvalidConfigurationException(s"All sensitive broker config entries must be specified for --alter, missing entries: ${sensitiveEntries.keySet}")
-        val newConfig = new JConfig(newEntries.asJava.values)
+
+        val alterLogLevelEntries = (newEntries.values.map(new AlterConfigOp(_, AlterConfigOp.OpType.SET))
+          ++ configsToBeDeleted.map { k => new AlterConfigOp(new ConfigEntry(k, ""), AlterConfigOp.OpType.DELETE) }
+          ).asJavaCollection
 
         val configResource = new ConfigResource(ConfigResource.Type.BROKER, entityNameHead)
         val alterOptions = new AlterConfigsOptions().timeoutMs(30000).validateOnly(false)
-        adminClient.alterConfigs(Map(configResource -> newConfig).asJava, alterOptions).all().get(60, TimeUnit.SECONDS)
+        adminClient.incrementalAlterConfigs(Map(configResource -> alterLogLevelEntries).asJava, alterOptions).all().get(60, TimeUnit.SECONDS)

Review comment:
       Some broker versions don't support incremental alter configs, so you would be breaking compatibility by making this change.




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

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



[GitHub] [kafka] abbccdda commented on pull request #9049: MINOR: fix scala warnings

Posted by GitBox <gi...@apache.org>.
abbccdda commented on pull request #9049:
URL: https://github.com/apache/kafka/pull/9049#issuecomment-664102269


   Sg, will close the PR @ijuma 


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

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



[GitHub] [kafka] ijuma commented on a change in pull request #9049: MINOR: fix scala warnings

Posted by GitBox <gi...@apache.org>.
ijuma commented on a change in pull request #9049:
URL: https://github.com/apache/kafka/pull/9049#discussion_r460453389



##########
File path: core/src/main/scala/kafka/security/authorizer/AclAuthorizer.scala
##########
@@ -384,8 +380,8 @@ class AclAuthorizer extends Authorizer with Logging {
 
     val prefixed = new ArrayBuffer[AclEntry]
     aclCacheSnapshot
-      .from(new ResourcePattern(resourceType, resourceName, PatternType.PREFIXED))
-      .to(new ResourcePattern(resourceType, resourceName.take(1), PatternType.PREFIXED))
+      .rangeFrom(new ResourcePattern(resourceType, resourceName, PatternType.PREFIXED))
+      .rangeTo(new ResourcePattern(resourceType, resourceName.take(1), PatternType.PREFIXED))

Review comment:
       Scala 2.12 doesn't have these methods.




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

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



[GitHub] [kafka] abbccdda closed pull request #9049: MINOR: fix scala warnings

Posted by GitBox <gi...@apache.org>.
abbccdda closed pull request #9049:
URL: https://github.com/apache/kafka/pull/9049


   


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

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