apoorvmittal10 commented on code in PR #19581:
URL: https://github.com/apache/kafka/pull/19581#discussion_r2076108970
##########
clients/src/main/java/org/apache/kafka/common/record/MemoryRecords.java:
##########
@@ -312,7 +312,7 @@ public ByteBuffer buffer() {
* @return A sliced buffer on this message set limited based on the given
position and size
*/
@Override
- public MemoryRecords slice(int position, int size) {
+ public Records slice(int position, int size) {
Review Comment:
Thanks for the suggestion @junrao . @AndrewJSchofield did also referenced
same
[approach](https://github.com/apache/kafka/blob/2df14b1190601955c01d4d74318093087601faa0/clients/src/main/java/org/apache/kafka/clients/admin/AbstractOptions.java#L25)
in our discussion, but the issue I told him was that now where ever `Records`
will be used then we have to specify the `type` else compilation will fail
because of `warning: [rawtypes] usage` or we need to suppress warnings at all
the places.
2) option was that I changed the code to with minimal casting.
3) Was the original where I returned specific types from implemeting classes.
4) Can be which I didn't implement is to not define `slice` API in
`Records.java` and if slice API is needed then cast to the specific Records
type and use the `slice` API.
--
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]