zookeeper - How to get data from old offset point in Kafka? -
i using zookeeper info kafka. , here info lastly offset point. there way specify time of offset old data?
there 1 alternative autooffset.reset. accepts smallest or largest. can please explain smallest , largest. can autooffset.reset helps in getting info old offset point instead of latest offset point?
the consumers belong grouping and, each partition, zookeeper keeps track of progress of consumer grouping in partition.
to fetch beginning, can delete info associated progress hussain refered
zkutils.maybedeletepath(${zkhost:zkport}", "/consumers/${group.id}");
you can specify offset of partition want, specified in core/src/main/scala/kafka/tools/updateoffsetsinzk.scala
zkutils.updatepersistentpath(zkclient, topicdirs.consumeroffsetdir + "/" + partition, offset.tostring)
however offset not time indexed, know each partition sequence.
if message contains timestamp (and beware timestamp has nil moment kafka received message), can seek indexer attempts retrieve 1 entry in steps incrementing offset n, , store tuple (topic x, part 2, offset 100, timestamp) somewhere.
when want retrieve entries specified moment in time, can apply binary search rough index until find entry want , fetch there.
offset zookeeper apache-kafka
No comments:
Post a Comment