Package io.deephaven.parquet.compress
Interface CompressorAdapter
- All Superinterfaces:
AutoCloseable,SafeCloseable
An Intermediate adapter interface between Deephaven column writing and parquet compression.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CompressorAdapterAnCompressorAdapterinstance that reads and writes uncompressed data directly. -
Method Summary
Modifier and TypeMethodDescriptioncompress(OutputStream os) Creates a new output stream that will take uncompressed writes, and flush data to the provided stream as compressed data.org.apache.parquet.bytes.BytesInputdecompress(InputStream inputStream, int compressedSize, int uncompressedSize) Returns an in-memory instance of BytesInput containing the fully decompressed results of the input stream.org.apache.parquet.hadoop.metadata.CompressionCodecNamevoidreset()Reset the internal state of thisCompressorAdapterso more rows can be read or written.Methods inherited from interface io.deephaven.util.SafeCloseable
close
-
Field Details
-
PASSTHRU
AnCompressorAdapterinstance that reads and writes uncompressed data directly.
-
-
Method Details
-
compress
Creates a new output stream that will take uncompressed writes, and flush data to the provided stream as compressed data.- Parameters:
os- the output stream to write compressed contents to- Returns:
- an output stream that can accept writes
- Throws:
IOException- thrown if an error occurs writing data
-
decompress
org.apache.parquet.bytes.BytesInput decompress(InputStream inputStream, int compressedSize, int uncompressedSize) throws IOException Returns an in-memory instance of BytesInput containing the fully decompressed results of the input stream. Callers should process the results beforeinputStreamis closed; if theBytesInputinterface needs to persist longer thaninputStream, callers should useBytesInput.copy(BytesInput)on the results.- Parameters:
inputStream- an input stream containing compressed datacompressedSize- the number of bytes in the compressed datauncompressedSize- the number of bytes that should be present when decompressed- Returns:
- the decompressed bytes, copied into memory
- Throws:
IOException- thrown if an error occurs reading data.
-
getCodecName
org.apache.parquet.hadoop.metadata.CompressionCodecName getCodecName()- Returns:
- the CompressionCodecName enum value that represents this compressor.
-
reset
void reset()Reset the internal state of thisCompressorAdapterso more rows can be read or written.
-