jsancio commented on a change in pull request #10812:
URL: https://github.com/apache/kafka/pull/10812#discussion_r661835072



##########
File path: raft/src/main/java/org/apache/kafka/raft/Batch.java
##########
@@ -105,9 +117,10 @@ public int hashCode() {
      * @param baseOffset offset of the batch
      * @param epoch epoch of the leader that created this batch
      * @param lastOffset offset of the last record of this batch
+     * @param sizeInBytes number of bytes used by this batch
      */
-    public static <T> Batch<T> empty(long baseOffset, int epoch, long 
lastOffset) {
-        return new Batch<>(baseOffset, epoch, lastOffset, 
Collections.emptyList());
+    public static <T> Batch<T> empty(long baseOffset, int epoch, long 
lastOffset, int sizeInBytes) {

Review comment:
       Yep. `empty` is not a good name. These are actually control batches that 
cannot be decoded to a `T`. We still want to track their last offset, epoch and 
size.
   
   In this PR https://github.com/apache/kafka/pull/10946, I change this method 
name to `control`.




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