sajjad-moradi commented on a change in pull request #7927: URL: https://github.com/apache/pinot/pull/7927#discussion_r772771553
########## File path: pinot-spi/src/main/java/org/apache/pinot/spi/stream/MessageBatch.java ########## @@ -82,6 +88,13 @@ default StreamPartitionMsgOffset getNextStreamParitionMsgOffsetAtIndex(int index return new LongMsgOffset(getNextStreamMessageOffsetAtIndex(index)); } + /** + * @return last offset in the batch + */ + default StreamPartitionMsgOffset getLastOffset() { + return getNextStreamParitionMsgOffsetAtIndex(getMessageCount() - 1); Review comment: `getMessageCount() - 1` is not a valid offset. Since this method is overridden for kafka 2.0 and the other streams are not supposed to use this method, at least for now, I believe we should throw IllegalStateException here. -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org