Skip to content

Commit

Permalink
Update LZ4Transcoder to match Compressed strategy factory type.
Browse files Browse the repository at this point in the history
  • Loading branch information
drcrallen committed Aug 29, 2015
1 parent 10af233 commit 413c0d1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions server/src/main/java/io/druid/client/cache/LZ4Transcoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,24 @@
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;

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
Expand Down Expand Up @@ -67,7 +66,7 @@ protected byte[] decompress(byte[] in)
{
byte[] out = null;
if(in != null) {
LZ4Decompressor decompressor = lz4Factory.decompressor();
LZ4FastDecompressor decompressor = lz4Factory.fastDecompressor();

int size = ByteBuffer.wrap(in).getInt();

Expand Down

0 comments on commit 413c0d1

Please sign in to comment.