Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
carlomedas committed Oct 20, 2014
1 parent d52b152 commit bdef4fc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.compress.BlockDecompressorStream;
import org.apache.hadoop.io.compress.CodecPool;
import org.apache.hadoop.io.compress.Decompressor;

import java.io.EOFException;
Expand Down Expand Up @@ -331,9 +332,10 @@ public long getCompressedBytesRead() {
public void close() throws IOException {
byte[] b = new byte[4096];
while (!decompressor.finished()) {
decompressor.decompress(b, 0, b.length);
decompressor.decompress(b, 0, b.length);
}
super.close();
CodecPool.returnDecompressor(decompressor);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.io.DataOutputBuffer;
import org.apache.hadoop.io.compress.CodecPool;
import org.apache.hadoop.io.compress.Compressor;
import org.apache.hadoop.io.compress.CompressorStream;

Expand Down Expand Up @@ -122,6 +123,8 @@ public void close() throws IOException {

out.close();
closed = true;

CodecPool.returnCompressor(compressor);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
/**
* LZ4 Compressor (FAST).
*/
class Lz4Compressor implements Compressor {
public class Lz4Compressor implements Compressor {
private static final Log LOG = LogFactory.getLog(Lz4Compressor.class.getName());

private int directBufferSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
/**
* LZ4 Decompressor, tuned for 4mc purposes.
*/
class Lz4Decompressor implements Decompressor {
public class Lz4Decompressor implements Decompressor {

private static final Log LOG = LogFactory.getLog(Lz4Decompressor.class.getName());

Expand Down

0 comments on commit bdef4fc

Please sign in to comment.