Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.orc.bench.core;

import io.airlift.compress.lz4.Lz4Codec;
import io.airlift.compress.snappy.SnappyCodec;
import org.apache.hadoop.fs.Path;

Expand All @@ -34,6 +35,7 @@ public enum CompressionKind {
NONE("none"),
ZLIB("gz"),
SNAPPY("snappy"),
LZ4("lz4"),
ZSTD("zstd");

CompressionKind(String extension) {
Expand All @@ -54,6 +56,8 @@ public OutputStream create(OutputStream out) throws IOException {
return new GZIPOutputStream(out);
case SNAPPY:
return new SnappyCodec().createOutputStream(out);
case LZ4:
return new Lz4Codec().createOutputStream(out);
default:
throw new IllegalArgumentException("Unhandled kind " + this);
}
Expand All @@ -67,6 +71,8 @@ public InputStream read(InputStream in) throws IOException {
return new GZIPInputStream(in);
case SNAPPY:
return new SnappyCodec().createInputStream(in);
case LZ4:
return new Lz4Codec().createInputStream(in);
default:
throw new IllegalArgumentException("Unhandled kind " + this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public static org.apache.orc.CompressionKind getCodec(CompressionKind compressio
return org.apache.orc.CompressionKind.ZLIB;
case SNAPPY:
return org.apache.orc.CompressionKind.SNAPPY;
case LZ4:
return org.apache.orc.CompressionKind.LZ4;
case ZSTD:
return org.apache.orc.CompressionKind.ZSTD;
default:
Expand Down
Loading