chia7712 commented on code in PR #19661:
URL: https://github.com/apache/kafka/pull/19661#discussion_r2080825212
##########
clients/src/main/java/org/apache/kafka/common/record/FileRecords.java:
##########
@@ -121,10 +122,14 @@ public void readInto(ByteBuffer buffer, int position)
throws IOException {
}
@Override
- public Records slice(int position, int size) throws IOException {
+ public FileRecords slice(int position, int size) {
int availableBytes = availableBytes(position, size);
int startPosition = this.start + position;
- return new FileRecords(file, channel, startPosition, startPosition +
availableBytes, true);
+ try {
+ return new FileRecords(file, channel, startPosition, startPosition
+ availableBytes, true);
+ } catch (IOException e) {
+ throw new UncheckedIOException(e);
Review Comment:

It seems the IOException is meaningless when the isSlice=true. Maybe we can
have a new constructor of FileRecords which does not have IOException in the
signature?
--
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]