You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Shuai Zhang <sh...@gmail.com> on 2017/07/17 13:20:41 UTC

Why Kafka treat the value of TopicCommand's topic parameter as regex expression?

Hi Team,

In TopicCommand class, the description for "--topic" parameter is "The
topic to be create, alter or describe. Can also accept a regular expression
except for --create option".

It means the value of topic parameter will be treated as regex expression
in the logic, so multiple topics may be operated at the same time when
invoking "delete", "alter", "describe" and "list" methods.

For example, we have two topics on Kafka: "test.a" and "test.a", if I run
describe command "--delete --topic test.a", it will delete both of those
topics.

Why don't we treat the value user passed as a simple string instead of
regex expression? I would like to know your concern.

Actually I submitted one PR already:
https://github.com/apache/kafka/pull/3533, but I closed it after I see the
description of "topic" parameter.

Thanks!
-- 
Shuai Zhang

Re: Why Kafka treat the value of TopicCommand's topic parameter as regex expression?

Posted by Shuai Zhang <sh...@gmail.com>.
Sorry, typos. "test.a" and "test-a"

On Mon, Jul 17, 2017 at 9:20 PM, Shuai Zhang <sh...@gmail.com> wrote:

> Hi Team,
>
> In TopicCommand class, the description for "--topic" parameter is "The
> topic to be create, alter or describe. Can also accept a regular expression
> except for --create option".
>
> It means the value of topic parameter will be treated as regex expression
> in the logic, so multiple topics may be operated at the same time when
> invoking "delete", "alter", "describe" and "list" methods.
>
> For example, we have two topics on Kafka: "test.a" and "test.a", if I run
> describe command "--delete --topic test.a", it will delete both of those
> topics.
>
> Why don't we treat the value user passed as a simple string instead of
> regex expression? I would like to know your concern.
>
> Actually I submitted one PR already: https://github.com/apache/
> kafka/pull/3533, but I closed it after I see the description of "topic"
> parameter.
>
> Thanks!
> --
> Shuai Zhang
>



-- 
Shuai Zhang