Skip to content

Commit

Permalink
KAFKA-2246; Fix incorrect config ZK path.
Browse files Browse the repository at this point in the history
This bug was introduced while committing KAFKA-2205. Basically, the path for topic overrides was renamed to "topic" from "topics". However, this causes existing topic config overrides to break because they will not be read from ZK anymore since the path is different.

https://reviews.apache.org/r/34554/

Author: Aditya Auradkar <[email protected]>

Reviewers: Joel Koshy

Closes apache#152 from auradkar/2446
  • Loading branch information
auradkar authored and jjkoshy committed Aug 20, 2015
1 parent 47b7a68 commit 0b04f9f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions core/src/main/scala/kafka/admin/ConfigCommand.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ object ConfigCommand {
val opts = new ConfigCommandOptions(args)

if(args.length == 0)
CommandLineUtils.printUsageAndDie(opts.parser, "Add/Remove entity (topic/client) configs")
CommandLineUtils.printUsageAndDie(opts.parser, "Add/Remove entity (topics/clients) configs")

opts.checkArgs()

Expand Down Expand Up @@ -122,7 +122,7 @@ object ConfigCommand {
.ofType(classOf[String])
val alterOpt = parser.accepts("alter", "Alter the configuration for the entity.")
val describeOpt = parser.accepts("describe", "List configs for the given entity.")
val entityType = parser.accepts("entity-type", "Type of entity (topic/client)")
val entityType = parser.accepts("entity-type", "Type of entity (topics/clients)")
.withRequiredArg
.ofType(classOf[String])
val entityName = parser.accepts("entity-name", "Name of entity (topic name/client id)")
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/scala/kafka/server/DynamicConfigManager.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import org.I0Itec.zkclient.{IZkChildListener, ZkClient}
* Represents all the entities that can be configured via ZK
*/
object ConfigType {
val Topic = "topic"
val Client = "client"
val Topic = "topics"
val Client = "clients"
}

/**
Expand Down Expand Up @@ -180,4 +180,4 @@ class DynamicConfigManager(private val zkClient: ZkClient,
}
}
}
}
}
8 changes: 4 additions & 4 deletions core/src/test/scala/unit/kafka/admin/ConfigCommandTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,30 @@ class ConfigCommandTest extends ZooKeeperTestHarness with Logging {
// Should parse correctly
var createOpts = new ConfigCommandOptions(Array("--zookeeper", zkConnect,
"--entity-name", "x",
"--entity-type", "client",
"--entity-type", "clients",
"--describe"))
createOpts.checkArgs()

// For --alter and added config
createOpts = new ConfigCommandOptions(Array("--zookeeper", zkConnect,
"--entity-name", "x",
"--entity-type", "client",
"--entity-type", "clients",
"--alter",
"--added-config", "a=b,c=d"))
createOpts.checkArgs()

// For alter and deleted config
createOpts = new ConfigCommandOptions(Array("--zookeeper", zkConnect,
"--entity-name", "x",
"--entity-type", "client",
"--entity-type", "clients",
"--alter",
"--deleted-config", "a,b,c"))
createOpts.checkArgs()

// For alter and both added, deleted config
createOpts = new ConfigCommandOptions(Array("--zookeeper", zkConnect,
"--entity-name", "x",
"--entity-type", "client",
"--entity-type", "clients",
"--alter",
"--added-config", "a=b,c=d",
"--deleted-config", "a"))
Expand Down

0 comments on commit 0b04f9f

Please sign in to comment.