zhaijack commented on issue #1219: Issue 1069: Provide a setting in consumer 
configuration to specify where to start consuming messages 
URL: https://github.com/apache/incubator-pulsar/pull/1219#issuecomment-372527172
 
 
   @XiaoZYang, Regarding the earliest position, there may be messages before 
it, but has been deleted. 
   Seems counter in getLastPositionAndCounter represent all added entries to 
this ledger, backlog == added_entry_counter - consumed_counter. In 
initializeCursorPosition(),  we set `messagesConsumedCounter = 
lastPositionCounter.second` so the backlog is 0. 
   
   While in this `getFirstPositionAndCounter`, we could make 
messagesConsumedCounter as value
   `ENTRIES_ADDED_COUNTER_UPDATER.get(this)  - 
getNumberOfEntries(Range.openClosed(firstPosition, lastPosition))`.
   
   Besides this, seems this need rebase, and fix the unit-test error. Thanks.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to