Github user albertshau commented on a diff in the pull request:

    https://github.com/apache/twill/pull/16#discussion_r90151909
  
    --- Diff: 
twill-core/src/main/java/org/apache/twill/kafka/client/KafkaConsumer.java ---
    @@ -35,8 +35,10 @@
          * Invoked when new messages is available.
          * @param messages Iterator of new messages. The {@link 
FetchedMessage} instance maybe reused in the Iterator
          *                 and across different invocation.
    +     * @return A long larger than zero as the offset to restart fetching 
messages when offset error is caught,
    +     *         {@code -1} if the error cannot be resolved. Returns {@code 
0} if no need to restart fetching.
          */
    -    void onReceived(Iterator<FetchedMessage> messages);
    +    long onReceived(Iterator<FetchedMessage> messages);
    --- End diff --
    
    -1 for latest and -2 for earliest seems to make sense. 0 is a valid kafka 
offset, though I suppose practically speaking, any use of 0 could be replaced 
by -2.
    
    It is unclear what an 'error' means. Does it mean the consumer should stop 
consuming? I think we can just leave that out.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to