KAFKA-2308: make MemoryRecords idempotent; reviewed by Guozhang Wang

This commit is contained in:
Gwen Shapira 2015-07-08 09:57:16 -07:00 committed by Guozhang Wang
parent 4204f4a06b
commit 67b6b9a45b
1 changed files with 5 additions and 3 deletions

View File

@ -115,9 +115,11 @@ public class MemoryRecords implements Records {
* Close this batch for no more appends
*/
public void close() {
compressor.close();
writable = false;
buffer = compressor.buffer();
if (writable) {
compressor.close();
writable = false;
buffer = compressor.buffer();
}
}
/** Write the records in this set to the given channel */