jsancio commented on a change in pull request #10899:
URL: https://github.com/apache/kafka/pull/10899#discussion_r660227382
##########
File path: raft/src/main/java/org/apache/kafka/snapshot/SnapshotReader.java
##########
@@ -100,4 +116,21 @@ public void close() {
new RecordsIterator<>(snapshot.records(), serde, bufferSupplier,
maxBatchSize)
);
}
+
+ /**
+ * Returns the next non-control Batch
+ */
+ private Optional<Batch<T>> nextBatch() {
+ while (iterator.hasNext()) {
+ Batch<T> batch = iterator.next();
+
+ if (batch.records().isEmpty()) {
+ continue;
+ } else {
+ return Optional.of(batch);
+ }
Review comment:
```suggestion
if (!batch.records().isEmpty()) {
return Optional.of(batch);
}
```
--
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]