public class SnappyCompression extends Object implements CompressionFormat
NONE| Constructor and Description |
|---|
SnappyCompression() |
| 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.
|
public String getName()
CompressionFormatgetName in interface CompressionFormatpublic boolean isSplittable()
CompressionFormatisSplittable in interface CompressionFormattrue if the compression format allow
file splits, false otherwise.public boolean isCompressedFilename(String fileName)
CompressionFormatisCompressedFilename in interface CompressionFormatfileName - the file name to checktrue if the file is believed to be
compressed in this format, false otherwise.public String getUncompressedFilename(String fileName)
CompressionFormatgetUncompressedFilename in interface CompressionFormatfileName - the file name to processpublic String getCompressedFilename(String fileName)
CompressionFormatgetCompressedFilename in interface CompressionFormatfileName - the file name to processpublic InputStream decompressStream(InputStream in) throws IOException
CompressionFormatdecompressStream in interface CompressionFormatin - the compressed byte stream to decompressIOException - if an I/O error occurspublic OutputStream compressStream(OutputStream out) throws IOException
CompressionFormatcompressStream in interface CompressionFormatout - the uncompressed byte stream to compressIOException - if an I/O error occurspublic SplitIterator getSplitIterator(FileClient client, Path filePath, SplitOptions options) throws IOException
CompressionFormatSplitIterator 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.getSplitIterator in interface CompressionFormatclient - the file client in usefilePath - path to the input fileoptions - splitting optionsIOException - if an I/O error occurspublic SplitInputStream decompressSplitStream(DataSplit split, InputStream in, int bufferSize) throws IOException
CompressionFormatUnsupportedOperationException will be thrown.decompressSplitStream in interface CompressionFormatsplit - split being read and decompressedin - the compressed byte stream for a split to decompressIOException - if an I/O error occursCopyright © 2024 Actian Corporation. All rights reserved.