zhijiangW commented on a change in pull request #10375: [FLINK-14845][runtime]
Introduce data compression to reduce disk and network IO of shuffle.
URL: https://github.com/apache/flink/pull/10375#discussion_r353698841
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGateTest.java
##########
@@ -126,6 +126,41 @@ public void testBasicGetNextLogic() throws Exception {
}
}
+ /**
+ * Tests that the compressed buffer will be decompressed after calling
{@link SingleInputGate#getNext()}.
+ */
+ @Test
+ public void testGetCompressedBuffer() throws Exception {
+ int bufferSize = 1024;
+ String compressCodec = "LZ4";
+ BufferCompressor compressor = new BufferCompressor(bufferSize,
compressCodec);
+ BufferDecompressor decompressor = new
BufferDecompressor(bufferSize, compressCodec);
+
+ SingleInputGate inputGate = new
SingleInputGateBuilder().setBufferDecompressor(decompressor).build();
Review comment:
It is better to close gate afterwards via `try (SingleInputGate inputGate =
new SingleInputGateBuilder().setBufferDecompressor(decompressor).build())` to
avoid potential resource leak.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services