Repository: kafka
Updated Branches:
  refs/heads/trunk 022bf1295 -> 537f98a5d


KAFKA-4745; Remove unnecessary flush in KafkaLZ4BlockOutputStream.close()

Remove unnecessary 'flush', the underlying stream should handle it on close.

Author: Will Droste <[email protected]>

Reviewers: Ismael Juma <[email protected]>

Closes #2528 from wdroste/trunk


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/537f98a5
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/537f98a5
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/537f98a5

Branch: refs/heads/trunk
Commit: 537f98a5d64b86022ac2125c75d079c26e4b9830
Parents: 022bf12
Author: Will Droste <[email protected]>
Authored: Thu Mar 9 01:00:33 2017 +0000
Committer: Ismael Juma <[email protected]>
Committed: Thu Mar 9 01:00:44 2017 +0000

----------------------------------------------------------------------
 .../apache/kafka/common/record/KafkaLZ4BlockOutputStream.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/537f98a5/clients/src/main/java/org/apache/kafka/common/record/KafkaLZ4BlockOutputStream.java
----------------------------------------------------------------------
diff --git 
a/clients/src/main/java/org/apache/kafka/common/record/KafkaLZ4BlockOutputStream.java
 
b/clients/src/main/java/org/apache/kafka/common/record/KafkaLZ4BlockOutputStream.java
index 034b945..9a100f1 100644
--- 
a/clients/src/main/java/org/apache/kafka/common/record/KafkaLZ4BlockOutputStream.java
+++ 
b/clients/src/main/java/org/apache/kafka/common/record/KafkaLZ4BlockOutputStream.java
@@ -258,10 +258,10 @@ public final class KafkaLZ4BlockOutputStream extends 
FilterOutputStream {
     @Override
     public void close() throws IOException {
         if (!finished) {
+            // basicallly flush the buffer writing the last block
             writeBlock();
+            // write the end block and finish the stream
             writeEndMark();
-            flush();
-            finished = true;
         }
         if (out != null) {
             out.close();

Reply via email to