@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()
ConfigurablegetConf in interface Configurablepublic void setConf(Configuration conf)
ConfigurablesetConf in interface Configurableconf - configuration to be usedpublic String getDefaultExtension()
CompressionCodecgetDefaultExtension in interface CompressionCodecpublic CompressionOutputStream createOutputStream(OutputStream out) throws IOException
CompressionCodecCompressionOutputStream that will write to the given
OutputStream.createOutputStream in interface CompressionCodecout - the location for the final output streamIOExceptionpublic CompressionOutputStream createOutputStream(OutputStream out, Compressor compressor) throws 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 useIOExceptionpublic 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(InputStream in) throws IOException
CompressionCodecCompressionInputStream that will read from the given
input stream.createInputStream in interface CompressionCodecin - the stream to read compressed bytes fromIOExceptionpublic CompressionInputStream createInputStream(InputStream in, Decompressor decompressor) throws 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 useIOExceptionpublic 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 © 2022 Apache Software Foundation. All rights reserved.