Parkerhiphop commented on code in PR #24239:
URL: https://github.com/apache/kafka/pull/24239#discussion_r4703192376


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/UnifiedLog.java:
##########
@@ -1589,11 +1592,15 @@ private LogAppendInfo 
analyzeAndValidateRecords(MemoryRecords records,
             }
 
             if (requireOffsetsMonotonic && !monotonic) {
-                throw new OffsetsOutOfOrderException("Out of order offsets 
found in append to " + topicPartition() + ": " +
-                        StreamSupport.stream(records.records().spliterator(), 
false)
-                            .map(Record::offset)
-                            .map(String::valueOf)
-                            .collect(Collectors.joining(",")));
+                StringJoiner offsets = new StringJoiner(",");
+                for (RecordBatch recordBatch : records.batches()) {

Review Comment:
   Thanks. I replace the original loop with `records.records()` 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]

Reply via email to