ankitsultana commented on code in PR #12602:
URL: https://github.com/apache/pinot/pull/12602#discussion_r1529449729
##########
pinot-spi/src/main/java/org/apache/pinot/spi/stream/MessageBatch.java:
##########
@@ -104,6 +104,15 @@ default StreamPartitionMsgOffset
getNextStreamPartitionMsgOffsetAtIndex(int inde
return new LongMsgOffset(getNextStreamMessageOffsetAtIndex(index));
}
+ /**
+ * Returns the offset of this message.
+ * @param index
+ * @return
+ */
+ default StreamPartitionMsgOffset getStreamPartitionMsgOffsetAtIndex(int
index) {
+ return new LongMsgOffset(getMessageOffsetAtIndex(index));
Review Comment:
@Jackie-Jiang : at present there's no usage of
`MessageBatch#getMessageOffsetAtIndex` anywhere in the Pinot code. At present
we use `getNextStreamPartitionMsgOffsetAtIndex` which uses the deprecated
method `getNextStreamMessageOffsetAtIndex`.
If a user has a `MessageBatch` implementation that sits outside of this
repo, and they haven't implemented this method, then they will run into errors.
However, all of the `MessageBatch` implementations in this repo implement
this method and hence should continue to work as expected.
Given that, let us know if this is still okay to go.
##########
pinot-plugins/pinot-stream-ingestion/pinot-kafka-2.0/src/main/java/org/apache/pinot/plugin/stream/kafka20/KafkaMessageBatch.java:
##########
@@ -92,6 +92,11 @@ public StreamPartitionMsgOffset
getNextStreamPartitionMsgOffsetAtIndex(int index
return new LongMsgOffset(((KafkaStreamMessage)
_messageList.get(index)).getNextOffset());
}
+ @Override
+ public StreamPartitionMsgOffset getStreamPartitionMsgOffsetAtIndex(int
index) {
+ return new LongMsgOffset(((KafkaStreamMessage)
_messageList.get(index)).getOffset());
Review Comment:
Didn't the default interface method implementation work? I am wondering if
we need to implement this method for other stream types as well.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]