From 413c0d1c9e7bff3f27aa868985e548bd4fae4d90 Mon Sep 17 00:00:00 2001 From: Charles Allen Date: Fri, 28 Aug 2015 19:19:48 -0700 Subject: [PATCH] Update LZ4Transcoder to match Compressed strategy factory type. --- .../src/main/java/io/druid/client/cache/LZ4Transcoder.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/io/druid/client/cache/LZ4Transcoder.java b/server/src/main/java/io/druid/client/cache/LZ4Transcoder.java index 89e2c2bac6d..b23ff9e51f1 100644 --- a/server/src/main/java/io/druid/client/cache/LZ4Transcoder.java +++ b/server/src/main/java/io/druid/client/cache/LZ4Transcoder.java @@ -21,6 +21,7 @@ import com.google.common.primitives.Ints; import net.jpountz.lz4.LZ4Compressor; import net.jpountz.lz4.LZ4Decompressor; import net.jpountz.lz4.LZ4Factory; +import net.jpountz.lz4.LZ4FastDecompressor; import net.spy.memcached.transcoders.SerializingTranscoder; import java.nio.ByteBuffer; @@ -28,18 +29,16 @@ import java.nio.ByteBuffer; public class LZ4Transcoder extends SerializingTranscoder { - private final LZ4Factory lz4Factory; + private final LZ4Factory lz4Factory = LZ4Factory.fastestInstance(); public LZ4Transcoder() { super(); - lz4Factory = LZ4Factory.fastestJavaInstance(); } public LZ4Transcoder(int max) { super(max); - lz4Factory = LZ4Factory.fastestJavaInstance(); } @Override @@ -67,7 +66,7 @@ public class LZ4Transcoder extends SerializingTranscoder { byte[] out = null; if(in != null) { - LZ4Decompressor decompressor = lz4Factory.decompressor(); + LZ4FastDecompressor decompressor = lz4Factory.fastDecompressor(); int size = ByteBuffer.wrap(in).getInt();