pan3793 commented on code in PR #53454:
URL: https://github.com/apache/spark/pull/53454#discussion_r2792009418
##########
core/src/main/scala/org/apache/spark/io/CompressionCodec.scala:
##########
@@ -153,11 +153,11 @@ class LZ4CompressionCodec(conf: SparkConf) extends
CompressionCodec {
override def compressedInputStream(s: InputStream): InputStream = {
val disableConcatenationOfByteStream = false
- new LZ4BlockInputStream(
- s,
- lz4Factory.fastDecompressor(),
- xxHashFactory.newStreamingHash32(defaultSeed).asChecksum,
- disableConcatenationOfByteStream)
+ LZ4BlockInputStream.newBuilder()
+ .withDecompressor(lz4Factory.safeDecompressor())
+ .withChecksum(xxHashFactory.newStreamingHash32(defaultSeed).asChecksum)
+ .withStopOnEmptyBlock(disableConcatenationOfByteStream)
Review Comment:
yes, exactly, you can check the source code at
https://github.com/yawkat/lz4-java/blob/33d180cb70c4d93c80fb0dc3ab3002f457e93840/src/java/net/jpountz/lz4/LZ4BlockInputStream.java#L69
```
public LZ4BlockInputStream(InputStream in, LZ4FastDecompressor
fastDecompressor, Checksum checksum, boolean stopOnEmptyBlock) {
this(in, fastDecompressor, null, checksum, stopOnEmptyBlock);
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]