Jason918 opened a new pull request #12032:
URL: https://github.com/apache/pulsar/pull/12032


   ### Motivation
   
   Currently we can reset the read position of a cursor by message id or 
timestamp. Since we formerly introduced index in broker metadata since 2.9.0, 
reset cursor by index is very helpful in other protocol handler (KoP or RoP). 
   
   ### Modifications
   
   Added seekByIndex in consumer api.
   The implementation is similar to seeking by timestamp.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change added tests and can be verified as follows:
     - PersistentMessageFinderByIndexTest.java is unit test for the core finder 
implementation in broker.
     - ConsumerSeekTest.java is the integration test for client implementation.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): ( no)
     - The public API: (yes?)  added optional field 'index' in CommandSeek
     - The schema: ( no ) 
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: ( no)
   
   ### Documentation
   
   Check the box below and label this PR (if you have committer privilege).
   
   Need to update docs? 
   
   - [ ] doc-required 
     
     (If you need help on updating docs, create a doc issue)
     
   - [ ] no-need-doc 
     
     (Please explain why)
     
   - [x] doc 
     
     (If this PR contains doc changes) 
   User can refer to the java doc in file 
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to