Umm... the replica *assignment* gets stored under /brokers/topics/<topic>
as "partitions" field, no? Under /brokers/topics/<topic>/partitions there
is a znode for each partition number with a 'state' as a sub-znode, right?

James, by doing via zkCli.sh:

get /brokers/topics/<topic>

You get a json like below:

{"version":1,"partitions":{"8":[1],"4":[1],"9":[1],"5":[1],"6":[1],"1":[1],"0":[1],"2":[1],"7":[1],"3":[1]}}

As you can see above, the replica list has only one element ([1]) for each
partition because ReplicationFactor = 1. You can infer the replication
factor by getting the *size* of this list for any element.


On Fri, Oct 16, 2015 at 5:51 PM, Gwen Shapira <g...@confluent.io> wrote:

> We don't store the replication factor per-se. When the topic is created, we
> use the replication factor to generate replica-assignment, and the replica
> assignment gets stored in ZK under: /brokers/topics/<topic>/partitions/...
>
> This is what gets modified when we re-assign replicas.
>
> Hope this helps.
>
> Gwen
>
> 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.
> >
>

Reply via email to