Umm... Reading the TopicCommand code
https://github.com/apache/kafka/blob/362613347371e9d74184e900ab80ba230940a5c8/core/src/main/scala/kafka/admin/TopicCommand.scala#L192
, it looks like the replication factor (for --describe option, at least) is
calculated by:

1) retrieving the "partitions" map from /brokers/topics/<topic-name>, where
the key is the partition number and the value is a list of replicas and

2) getting the first key-value pair (head) from the map retrieved above,
and from this kv pair then get the size of the replica list (._2.size), no?

When I got the data of get /config/topics/testTopic it came as
{"version":1,"config":{}}, that is, the config was empty (I am running from
a stale -- about two weeks -- trunk).

​What I am missing? :)​

Cheers,
Ed

On Fri, Oct 16, 2015 at 5:19 PM, Guozhang Wang <wangg...@gmail.com> wrote:

> Replication factor is stored as topic configs that are introduced since
> 0.8.1, you can find it in the wiki you mentioned.
>
> Guozhang
>
> On Fri, Oct 16, 2015 at 12:33 PM, James Cheng <jch...@tivo.com> wrote:
>
> > Hi,
> >
> > Where is the replication factor for a topic stored? It isn't listed at
> >
> https://cwiki.apache.org/confluence/display/KAFKA/Kafka+data+structures+in+Zookeeper
> .
> > But the kafka-topics --describe command returns something. Where is it
> > finding that?
> >
> > Thanks,
> > -James
> >
> >
> > ________________________________
> >
> > This email and any attachments may contain confidential and privileged
> > material for the sole use of the intended recipient. Any review, copying,
> > or distribution of this email (or any attachments) by others is
> prohibited.
> > If you are not the intended recipient, please contact the sender
> > immediately and permanently delete this email and any attachments. No
> > employee or agent of TiVo Inc. is authorized to conclude any binding
> > agreement on behalf of TiVo Inc. by email. Binding agreements with TiVo
> > Inc. may only be made by a signed written agreement.
> >
>
>
>
> --
> -- Guozhang
>

Reply via email to