@InterfaceAudience.Public @InterfaceStability.Unstable public class PassthroughCodec extends Object implements Configurable, CompressionCodec
OPT_EXTENSION
.
This allows decompression to be disabled on a job, even when there is
a registered/discoverable decompression codec for a file extension
-without having to change the standard codec binding mechanism.
For example, to disable decompression for a gzipped files, set the
options
io.compression.codecs = org.apache.hadoop.io.compress.PassthroughCodec io.compress.passthrough.extension = .gzNote: this is not a Splittable codec: it doesn't know the capabilities of the passed in stream. It should be possible to extend this in a subclass: the inner classes are marked as protected to enable this. Do not retrofit splitting to this class..
Modifier and Type | Field and Description |
---|---|
static String |
CLASSNAME
Classname of the codec: "org.apache.hadoop.io.compress.PassthroughCodec".
|
static String |
DEFAULT_EXTENSION
This default extension is here so that if no extension has been defined,
some value is still returned: ".passthrough"..
|
static String |
OPT_EXTENSION
Option to control the extension of the code: "io.compress.passthrough.extension".
|
Constructor and Description |
---|
PassthroughCodec() |
public static final String CLASSNAME
public static final String OPT_EXTENSION
public static final String DEFAULT_EXTENSION
public Configuration getConf()
Configurable
getConf
in interface Configurable
public void setConf(Configuration conf)
Configurable
setConf
in interface Configurable
conf
- configuration to be usedpublic String getDefaultExtension()
CompressionCodec
getDefaultExtension
in interface CompressionCodec
public CompressionOutputStream createOutputStream(OutputStream out) throws IOException
CompressionCodec
CompressionOutputStream
that will write to the given
OutputStream
.createOutputStream
in interface CompressionCodec
out
- the location for the final output streamIOException
public CompressionOutputStream createOutputStream(OutputStream out, Compressor compressor) throws IOException
CompressionCodec
CompressionOutputStream
that will write to the given
OutputStream
with the given Compressor
.createOutputStream
in interface CompressionCodec
out
- the location for the final output streamcompressor
- compressor to useIOException
public Class<? extends Compressor> getCompressorType()
CompressionCodec
Compressor
needed by this CompressionCodec
.getCompressorType
in interface CompressionCodec
public Compressor createCompressor()
CompressionCodec
Compressor
for use by this CompressionCodec
.createCompressor
in interface CompressionCodec
public CompressionInputStream createInputStream(InputStream in) throws IOException
CompressionCodec
CompressionInputStream
that will read from the given
input stream.createInputStream
in interface CompressionCodec
in
- the stream to read compressed bytes fromIOException
public CompressionInputStream createInputStream(InputStream in, Decompressor decompressor) throws IOException
CompressionCodec
CompressionInputStream
that will read from the given
InputStream
with the given Decompressor
.createInputStream
in interface CompressionCodec
in
- the stream to read compressed bytes fromdecompressor
- decompressor to useIOException
public Class<? extends Decompressor> getDecompressorType()
CompressionCodec
Decompressor
needed by this CompressionCodec
.getDecompressorType
in interface CompressionCodec
public Decompressor createDecompressor()
CompressionCodec
Decompressor
for use by this CompressionCodec
.createDecompressor
in interface CompressionCodec
Copyright © 2019 Apache Software Foundation. All rights reserved.