Skip to content

Commit 14bf9b2

Browse files
massakamdlg99
authored andcommitted
Replace net.jpountz.lz4:lz4 with at.yawk.lz4:lz4-java (apache#4696)
(cherry picked from commit b88fb5f)
1 parent dea8112 commit 14bf9b2

7 files changed

Lines changed: 23 additions & 23 deletions

File tree

bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ Apache Software License, Version 2.
275275
- lib/com.beust-jcommander-1.82.jar [24]
276276
- lib/com.yahoo.datasketches-memory-0.8.3.jar [25]
277277
- lib/com.yahoo.datasketches-sketches-core-0.8.3.jar [25]
278-
- lib/net.jpountz.lz4-lz4-1.3.0.jar [26]
278+
- lib/at.yawk.lz4-lz4-java-1.10.2.jar [26]
279279
- lib/com.google.api.grpc-proto-google-common-protos-2.9.0.jar [28]
280280
- lib/com.google.code.gson-gson-2.9.0.jar [29]
281281
- lib/io.opencensus-opencensus-api-0.28.0.jar [30]
@@ -346,7 +346,7 @@ Apache Software License, Version 2.
346346
[23] Source available at https://github.com/facebook/rocksdb/tree/v6.29.4.1
347347
[24] Source available at https://github.com/cbeust/jcommander/tree/1.82
348348
[25] Source available at https://github.com/DataSketches/sketches-core/tree/sketches-0.8.3
349-
[26] Source available at https://github.com/lz4/lz4-java/tree/1.3.0
349+
[26] Source available at https://github.com/yawkat/lz4-java/tree/v1.10.2
350350
[28] Source available at https://github.com/googleapis/java-common-protos/tree/v2.17.0
351351
[29] Source available at https://github.com/google/gson/tree/gson-parent-2.10.1
352352
[30] Source available at https://github.com/census-instrumentation/opencensus-java/tree/v0.28.0
@@ -459,13 +459,13 @@ decoding data in LZF format, written by Tatu Saloranta. It can be obtained at:
459459
* HOMEPAGE:
460460
* https://github.com/ning/compress
461461

462-
lib/io.netty-netty-codec-4.1.121.Final.jar optionally depends on 'lz4', a LZ4 Java compression
462+
lib/io.netty-netty-codec-4.1.121.Final.jar optionally depends on 'lz4-java', a LZ4 Java compression
463463
and decompression library written by Adrien Grand. It can be obtained at:
464464

465465
* LICENSE:
466466
* deps/netty/LICENSE.lz4.txt (Apache License 2.0)
467467
* HOMEPAGE:
468-
* https://github.com/jpountz/lz4-java
468+
* https://github.com/yawkat/lz4-java
469469

470470
lib/io.netty-netty-codec-4.1.121.Final.jar optionally depends on 'lzma-java', a LZMA Java compression
471471
and decompression library, which can be obtained at:

bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ Apache Software License, Version 2.
246246
- lib/org.apache.zookeeper-zookeeper-jute-3.9.3.jar [20]
247247
- lib/org.apache.zookeeper-zookeeper-3.9.3-tests.jar [20]
248248
- lib/com.beust-jcommander-1.82.jar [23]
249-
- lib/net.jpountz.lz4-lz4-1.3.0.jar [25]
249+
- lib/at.yawk.lz4-lz4-java-1.10.2.jar [25]
250250
- lib/com.google.api.grpc-proto-google-common-protos-2.9.0.jar [27]
251251
- lib/com.google.code.gson-gson-2.9.0.jar [28]
252252
- lib/io.opencensus-opencensus-api-0.28.0.jar [29]
@@ -305,7 +305,7 @@ Apache Software License, Version 2.
305305
[19] Source available at https://github.com/apache/commons-lang/tree/LANG_3_6
306306
[20] Source available at https://github.com/apache/zookeeper/tree/release-3.8.0
307307
[23] Source available at https://github.com/cbeust/jcommander/tree/1.82
308-
[25] Source available at https://github.com/lz4/lz4-java/tree/1.3.0
308+
[25] Source available at https://github.com/yawkat/lz4-java/tree/v1.10.2
309309
[27] Source available at https://github.com/googleapis/java-common-protos/tree/v2.17.0
310310
[28] Source available at https://github.com/google/gson/tree/gson-parent-2.10.1
311311
[29] Source available at https://github.com/census-instrumentation/opencensus-java/tree/v0.28.0
@@ -416,13 +416,13 @@ decoding data in LZF format, written by Tatu Saloranta. It can be obtained at:
416416
* HOMEPAGE:
417417
* https://github.com/ning/compress
418418

419-
lib/io.netty-netty-codec-4.1.121.Final.jar optionally depends on 'lz4', a LZ4 Java compression
419+
lib/io.netty-netty-codec-4.1.121.Final.jar optionally depends on 'lz4-java', a LZ4 Java compression
420420
and decompression library written by Adrien Grand. It can be obtained at:
421421

422422
* LICENSE:
423423
* deps/netty/LICENSE.lz4.txt (Apache License 2.0)
424424
* HOMEPAGE:
425-
* https://github.com/jpountz/lz4-java
425+
* https://github.com/yawkat/lz4-java
426426

427427
lib/io.netty-netty-codec-4.1.121.Final.jar optionally depends on 'lzma-java', a LZMA Java compression
428428
and decompression library, which can be obtained at:

bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ Apache Software License, Version 2.
275275
- lib/com.beust-jcommander-1.82.jar [24]
276276
- lib/com.yahoo.datasketches-memory-0.8.3.jar [25]
277277
- lib/com.yahoo.datasketches-sketches-core-0.8.3.jar [25]
278-
- lib/net.jpountz.lz4-lz4-1.3.0.jar [26]
278+
- lib/at.yawk.lz4-lz4-java-1.10.2.jar [26]
279279
- lib/com.google.api.grpc-proto-google-common-protos-2.9.0.jar [28]
280280
- lib/com.google.code.gson-gson-2.9.0.jar [29]
281281
- lib/io.opencensus-opencensus-api-0.28.0.jar [30]
@@ -342,7 +342,7 @@ Apache Software License, Version 2.
342342
[23] Source available at https://github.com/facebook/rocksdb/tree/v6.29.4.1
343343
[24] Source available at https://github.com/cbeust/jcommander/tree/1.82
344344
[25] Source available at https://github.com/DataSketches/sketches-core/tree/sketches-0.8.3
345-
[26] Source available at https://github.com/lz4/lz4-java/tree/1.3.0
345+
[26] Source available at https://github.com/yawkat/lz4-java/tree/v1.10.2
346346
[28] Source available at https://github.com/googleapis/java-common-protos/tree/v2.17.0
347347
[29] Source available at https://github.com/google/gson/tree/gson-parent-2.10.1
348348
[30] Source available at https://github.com/census-instrumentation/opencensus-java/tree/v0.28.0
@@ -454,13 +454,13 @@ decoding data in LZF format, written by Tatu Saloranta. It can be obtained at:
454454
* HOMEPAGE:
455455
* https://github.com/ning/compress
456456

457-
lib/io.netty-netty-codec-4.1.121.Final.jar optionally depends on 'lz4', a LZ4 Java compression
457+
lib/io.netty-netty-codec-4.1.121.Final.jar optionally depends on 'lz4-java', a LZ4 Java compression
458458
and decompression library written by Adrien Grand. It can be obtained at:
459459

460460
* LICENSE:
461461
* deps/netty/LICENSE.lz4.txt (Apache License 2.0)
462462
* HOMEPAGE:
463-
* https://github.com/jpountz/lz4-java
463+
* https://github.com/yawkat/lz4-java
464464

465465
lib/io.netty-netty-codec-4.1.121.Final.jar optionally depends on 'lzma-java', a LZMA Java compression
466466
and decompression library, which can be obtained at:

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
<libthrift.version>0.14.2</libthrift.version>
153153
<lombok.version>1.18.30</lombok.version>
154154
<log4j.version>2.18.0</log4j.version>
155-
<lz4.version>1.3.0</lz4.version>
155+
<lz4-java.version>1.10.2</lz4-java.version>
156156
<mockito.version>3.12.4</mockito.version>
157157
<netty.version>4.1.121.Final</netty.version>
158158
<netty-iouring.version>0.0.26.Final</netty-iouring.version>
@@ -319,9 +319,9 @@
319319

320320
<!-- compression libs -->
321321
<dependency>
322-
<groupId>net.jpountz.lz4</groupId>
323-
<artifactId>lz4</artifactId>
324-
<version>${lz4.version}</version>
322+
<groupId>at.yawk.lz4</groupId>
323+
<artifactId>lz4-java</artifactId>
324+
<version>${lz4-java.version}</version>
325325
</dependency>
326326

327327
<!-- yaml dependencies -->

shaded/distributedlog-core-shaded/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<include>com.google.guava:failureaccess</include>
7575
<include>com.google.guava:guava</include>
7676
<include>com.google.protobuf:protobuf-java</include>
77-
<include>net.jpountz.lz4:lz4</include>
77+
<include>at.yawk.lz4:lz4-java</include>
7878
<include>com.datastax.oss:bookkeeper-common</include>
7979
<include>com.datastax.oss:bookkeeper-common-allocator</include>
8080
<include>com.datastax.oss:cpu-affinity</include>

stream/distributedlog/common/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
<artifactId>netty-buffer</artifactId>
7575
</dependency>
7676
<dependency>
77-
<groupId>net.jpountz.lz4</groupId>
78-
<artifactId>lz4</artifactId>
77+
<groupId>at.yawk.lz4</groupId>
78+
<artifactId>lz4-java</artifactId>
7979
</dependency>
8080
<dependency>
8181
<groupId>org.jmock</groupId>

stream/distributedlog/common/src/main/java/org/apache/distributedlog/io/LZ4CompressionCodec.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import java.nio.ByteBuffer;
2626
import net.jpountz.lz4.LZ4Compressor;
2727
import net.jpountz.lz4.LZ4Factory;
28-
import net.jpountz.lz4.LZ4FastDecompressor;
28+
import net.jpountz.lz4.LZ4SafeDecompressor;
2929

3030
/**
3131
* An {@code lz4} based {@link CompressionCodec} implementation.
@@ -44,7 +44,7 @@ public static LZ4CompressionCodec of() {
4444
// Used for compression
4545
private static final LZ4Compressor compressor = factory.fastCompressor();
4646
// Used to decompress when the size of the output is known
47-
private static final LZ4FastDecompressor decompressor = factory.fastDecompressor();
47+
private static final LZ4SafeDecompressor decompressor = factory.safeDecompressor();
4848

4949
@Override
5050
public ByteBuf compress(ByteBuf uncompressed, int headerLen) {
@@ -69,7 +69,7 @@ public ByteBuf compress(ByteBuf uncompressed, int headerLen) {
6969
}
7070

7171
@Override
72-
// length parameter is ignored here because of the way the fastDecompressor works.
72+
// length parameter is ignored here because of the way the safeDecompressor works.
7373
public ByteBuf decompress(ByteBuf compressed, int decompressedSize) {
7474
checkNotNull(compressed);
7575
checkArgument(compressed.readableBytes() >= 0);
@@ -80,7 +80,7 @@ public ByteBuf decompress(ByteBuf compressed, int decompressedSize) {
8080
ByteBuffer compressedNio = compressed.nioBuffer(compressed.readerIndex(), compressed.readableBytes());
8181

8282
decompressor.decompress(
83-
compressedNio, compressedNio.position(),
83+
compressedNio, compressedNio.position(), compressedNio.remaining(),
8484
uncompressedNio, uncompressedNio.position(), uncompressedNio.remaining());
8585
uncompressed.writerIndex(decompressedSize);
8686
return uncompressed;

0 commit comments

Comments
 (0)