You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/12/07 21:14:12 UTC

[GitHub] merlimat closed pull request #3141: fix CompressionCodecLZ4

merlimat closed pull request #3141: fix CompressionCodecLZ4
URL: https://github.com/apache/pulsar/pull/3141
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/pulsar-common/src/main/java/org/apache/pulsar/common/compression/CompressionCodecLZ4.java b/pulsar-common/src/main/java/org/apache/pulsar/common/compression/CompressionCodecLZ4.java
index 01b600de79..a57992cfab 100644
--- a/pulsar-common/src/main/java/org/apache/pulsar/common/compression/CompressionCodecLZ4.java
+++ b/pulsar-common/src/main/java/org/apache/pulsar/common/compression/CompressionCodecLZ4.java
@@ -23,6 +23,7 @@
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.PooledByteBufAllocator;
+import lombok.extern.slf4j.Slf4j;
 import net.jpountz.lz4.LZ4Compressor;
 import net.jpountz.lz4.LZ4Factory;
 import net.jpountz.lz4.LZ4FastDecompressor;
@@ -30,11 +31,16 @@
 /**
  * LZ4 Compression
  */
+@Slf4j
 public class CompressionCodecLZ4 implements CompressionCodec {
 
     static {
-        // Force the attempt to load LZ4 JNI
-        net.jpountz.util.Native.load();
+        try {
+            // Force the attempt to load LZ4 JNI
+            net.jpountz.util.Native.load();
+        } catch (Throwable th) {
+            log.warn("Failed to load native LZ4 implementation: {}", th.getMessage());
+        }
     }
 
     private static final LZ4Factory lz4Factory = LZ4Factory.fastestInstance();


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services