public interface CompressionFormat extends Serializable
Modifier and Type | Field and Description |
---|---|
static CompressionFormat |
NONE
A format indicating no compression of data.
|
Modifier and Type | Method and Description |
---|---|
OutputStream |
compressStream(OutputStream out)
Wraps the specified stream in a compressor for
the format.
|
SplitInputStream |
decompressSplitStream(DataSplit split,
InputStream in,
int bufferSize)
Wraps the specified stream for a split in a decompressor
for the format.
|
InputStream |
decompressStream(InputStream in)
Wraps the specified stream in a decompressor for
the format.
|
String |
getCompressedFilename(String fileName)
Adds the common file suffix associated with this format
to the given file name.
|
String |
getName()
Gets the name of the compression algorithm.
|
SplitIterator |
getSplitIterator(FileClient client,
Path filePath,
SplitOptions options)
Create a
SplitIterator for the given file path and options. |
String |
getUncompressedFilename(String fileName)
Strips any file suffix associated with this format
from the given file name.
|
boolean |
isCompressedFilename(String fileName)
Indicates whether the specified file name is compressed
in this format.
|
boolean |
isSplittable()
Indicates whether compressed data files may be split.
|
static final CompressionFormat NONE
String getName()
boolean isSplittable()
true
if the compression format allow
file splits, false
otherwise.boolean isCompressedFilename(String fileName)
fileName
- the file name to checktrue
if the file is believed to be
compressed in this format, false
otherwise.String getUncompressedFilename(String fileName)
fileName
- the file name to processString getCompressedFilename(String fileName)
fileName
- the file name to processInputStream decompressStream(InputStream in) throws IOException
in
- the compressed byte stream to decompressIOException
- if an I/O error occursOutputStream compressStream(OutputStream out) throws IOException
out
- the uncompressed byte stream to compressIOException
- if an I/O error occursSplitIterator getSplitIterator(FileClient client, Path filePath, SplitOptions options) throws IOException
SplitIterator
for the given file path and options.
Iterators may vary based on the compression format of an input data stream or
if the input is not compressed. For instance, compression formats that do not
support splitting will create an iterator with a single split: the whole file.client
- the file client in usefilePath
- path to the input fileoptions
- splitting optionsIOException
- if an I/O error occursSplitInputStream decompressSplitStream(DataSplit split, InputStream in, int bufferSize) throws IOException
UnsupportedOperationException
will be thrown.split
- split being read and decompressedin
- the compressed byte stream for a split to decompressbufferSize
- IOException
- if an I/O error occursUnsupportedOperationException
- if the compression format does not support splittingCopyright © 2021 Actian Corporation. All rights reserved.