navina commented on code in PR #10418: URL: https://github.com/apache/pinot/pull/10418#discussion_r1151420757
########## pinot-spi/src/main/java/org/apache/pinot/spi/stream/MessageBatch.java: ########## @@ -116,4 +116,14 @@ default StreamPartitionMsgOffset getOffsetOfNextBatch() { default boolean isEndOfPartitionGroup() { return false; } + + /** + * This is useful while determining ingestion delay for a message batch. Retaining metadata for last message in + * a batch can enable us to estimate the ingestion delay for the batch. + * + * @return null by default. + */ + default public StreamMessageMetadata getLastMessageMetadata() { Review Comment: >the last index may not be the message that provided the last metadata: it depends on errors etc and the external code already did the filtering for us so I don't want to have to redo that logic here. The fact that last index may not be the message that provides the last metadata is not clear to me. Say the batch contains consumed = "[m1, m2, m3, m4]" and after filtering = "[m1 , m2, <filtered>, m4]". Is such a batch this possible? If yes, what should be the return value of `getLastMessageMetadata` ? m3 ? The javadoc says "Retaining metadata for last message in a batch can enable us to estimate the ingestion delay for the batch." . So, it is m4? -- 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