Configurable, CompressionCodec@Public @Unstable public class PassthroughCodec extends java.lang.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 | Class | Description |
|---|---|---|
protected static class |
PassthroughCodec.PassthroughDecompressorStream |
The decompressor.
|
protected static class |
PassthroughCodec.StubDecompressor |
The decompressor is a no-op.
|
CompressionCodec.Util| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
CLASSNAME |
Classname of the codec: "org.apache.hadoop.io.compress.PassthroughCodec".
|
static java.lang.String |
DEFAULT_EXTENSION |
This default extension is here so that if no extension has been defined,
some value is still returned: ".passthrough"..
|
static java.lang.String |
OPT_EXTENSION |
Option to control the extension of the code: "io.compress.passthrough.extension".
|
| Constructor | Description |
|---|---|
PassthroughCodec() |
| Modifier and Type | Method | Description |
|---|---|---|
Compressor |
createCompressor() |
Create a new
Compressor for use by this CompressionCodec. |
Decompressor |
createDecompressor() |
Create a new
Decompressor for use by this CompressionCodec. |
CompressionInputStream |
createInputStream(java.io.InputStream in) |
Create a
CompressionInputStream that will read from the given
input stream. |
CompressionInputStream |
createInputStream(java.io.InputStream in,
Decompressor decompressor) |
Create a
CompressionInputStream that will read from the given
InputStream with the given Decompressor. |
CompressionOutputStream |
createOutputStream(java.io.OutputStream out) |
Create a
CompressionOutputStream that will write to the given
OutputStream. |
CompressionOutputStream |
createOutputStream(java.io.OutputStream out,
Compressor compressor) |
Create a
CompressionOutputStream that will write to the given
OutputStream with the given Compressor. |
java.lang.Class<? extends Compressor> |
getCompressorType() |
Get the type of
Compressor needed by this CompressionCodec. |
Configuration |
getConf() |
Return the configuration used by this object.
|
java.lang.Class<? extends Decompressor> |
getDecompressorType() |
Get the type of
Decompressor needed by this CompressionCodec. |
java.lang.String |
getDefaultExtension() |
Get the default filename extension for this kind of compression.
|
void |
setConf(Configuration conf) |
Set the configuration to be used by this object.
|
public static final java.lang.String CLASSNAME
public static final java.lang.String OPT_EXTENSION
public static final java.lang.String DEFAULT_EXTENSION
public Configuration getConf()
ConfigurablegetConf in interface Configurablepublic void setConf(Configuration conf)
ConfigurablesetConf in interface Configurableconf - configuration to be usedpublic java.lang.String getDefaultExtension()
CompressionCodecgetDefaultExtension in interface CompressionCodecpublic CompressionOutputStream createOutputStream(java.io.OutputStream out) throws java.io.IOException
CompressionCodecCompressionOutputStream that will write to the given
OutputStream.createOutputStream in interface CompressionCodecout - the location for the final output streamjava.io.IOException - raised on errors performing I/O.public CompressionOutputStream createOutputStream(java.io.OutputStream out, Compressor compressor) throws java.io.IOException
CompressionCodecCompressionOutputStream that will write to the given
OutputStream with the given Compressor.createOutputStream in interface CompressionCodecout - the location for the final output streamcompressor - compressor to usejava.io.IOException - raised on errors performing I/O.public java.lang.Class<? extends Compressor> getCompressorType()
CompressionCodecCompressor needed by this CompressionCodec.getCompressorType in interface CompressionCodecpublic Compressor createCompressor()
CompressionCodecCompressor for use by this CompressionCodec.createCompressor in interface CompressionCodecpublic CompressionInputStream createInputStream(java.io.InputStream in) throws java.io.IOException
CompressionCodecCompressionInputStream that will read from the given
input stream.createInputStream in interface CompressionCodecin - the stream to read compressed bytes fromjava.io.IOException - raised on errors performing I/O.public CompressionInputStream createInputStream(java.io.InputStream in, Decompressor decompressor) throws java.io.IOException
CompressionCodecCompressionInputStream that will read from the given
InputStream with the given Decompressor.createInputStream in interface CompressionCodecin - the stream to read compressed bytes fromdecompressor - decompressor to usejava.io.IOException - raised on errors performing I/O.public java.lang.Class<? extends Decompressor> getDecompressorType()
CompressionCodecDecompressor needed by this CompressionCodec.getDecompressorType in interface CompressionCodecpublic Decompressor createDecompressor()
CompressionCodecDecompressor for use by this CompressionCodec.createDecompressor in interface CompressionCodecCopyright © 2008–2025 Apache Software Foundation. All rights reserved.