I want to know,when startOffsetTime`s value is kafka.api.OffsetRequest.EarliestTime().the offset value is what? -
when set startoffsettime=kafka.api.offsetrequest.latesttime()
, offset`s value largest available.
when set startoffsettime kafka.api.offsetrequest.earliesttime()
offset value?
it hard understand question little bit. anyway suppose asking offset when query earliest offset.
kafka has log retention configurations allow set time live message or log file size. more here.
imagine have topic log retention hours set 1 hour , produce messages following offsets:
0 1 2 3 4 5 6 7 8 9 10 ...
after 1 hour old messages removed log , may following picture:
<offsets 0 1 2 3 4 no more exist in log> 5 6 7 8 9 10 ...
then when query earliest offset 5
offsets 0-4
no more exist.
the same applies log.retention.bytes
config, when exceed configuration value, older messages dropped (whole segment actually, doesn't matter question) resulting in earliest offset higher 0
.
Comments
Post a Comment