dielhennr commented on a change in pull request #10480:
URL: https://github.com/apache/kafka/pull/10480#discussion_r610281681



##########
File path: 
raft/src/main/java/org/apache/kafka/raft/internals/BatchAccumulator.java
##########
@@ -202,6 +203,25 @@ private void completeCurrentBatch() {
         currentBatch = null;
     }
 
+    public void addControlBatch(MemoryRecords records) {
+        appendLock.lock();
+        try {
+            drainStatus = DrainStatus.STARTED;
+            completed.add(new CompletedBatch<>(
+                nextOffset,
+                null,

Review comment:
       Using `Optional.ofNullable` in the constructor saved the time of having 
to change every other instantiation of CompletedBatch.




-- 
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.

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


Reply via email to