Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAFKA-16770; [2/2] Coalesce records into bigger batches #16215

Merged
merged 13 commits into from
Jun 12, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,14 @@ public boolean hasRoomFor(long timestamp, ByteBuffer key, ByteBuffer value, Head
return this.writeLimit >= estimatedBytesWritten() + recordSize;
}

/**
* Check if we have room for a given number of bytes.
*/
public boolean hasRoomFor(int estimatedRecordsSize) {
if (isFull()) return false;
return this.writeLimit >= estimatedBytesWritten() + estimatedRecordsSize;
}

public boolean isClosed() {
return builtRecords != null;
}
Expand Down
Loading