jsancio commented on code in PR #19661:
URL: https://github.com/apache/kafka/pull/19661#discussion_r2082110647


##########
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:
   > In RecordBatchIterator, we convert an IOException to a KafkaException. 
Should we be consistent here?
   
   Are you suggesting I change it to throw an `UncheckedIOException`? If so, 
that is what I did. I looked at the method declaration and we don't seem to 
document that `KafkaException` is thrown. It should be okay to change the type. 
What do you think?



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to