Package com.linkedin.venice.compression
Class VeniceCompressor
java.lang.Object
com.linkedin.venice.compression.VeniceCompressor
- All Implemented Interfaces:
- Closeable,- AutoCloseable
- Direct Known Subclasses:
- GzipCompressor,- NoopCompressor,- ZstdWithDictCompressor
- 
Field SummaryFields
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedVeniceCompressor(CompressionStrategy compressionStrategy) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()protected abstract voidbyte[]compress(byte[] data) compress(ByteBuffer src, int startPositionOfOutput) protected abstract byte[]compressInternal(byte[] data) protected abstract ByteBuffercompressInternal(ByteBuffer src, int startPositionOfOutput) decompress(byte[] data, int offset, int length) decompress(InputStream inputStream) decompress(ByteBuffer data) decompressAndPrependSchemaHeader(byte[] data, int offset, int length, int schemaHeader) This method tries to decompress data and maybe prepend the schema header.protected abstract ByteBufferdecompressAndPrependSchemaHeaderInternal(byte[] data, int offset, int length, int schemaHeader) protected abstract ByteBufferdecompressInternal(byte[] data, int offset, int length) protected abstract InputStreamdecompressInternal(InputStream inputStream) protected abstract ByteBufferdecompressInternal(ByteBuffer data) 
- 
Field Details- 
SCHEMA_HEADER_LENGTHprotected static final int SCHEMA_HEADER_LENGTH- See Also:
 
 
- 
- 
Constructor Details- 
VeniceCompressor
 
- 
- 
Method Details- 
compress- Throws:
- IOException
 
- 
compressInternal- Throws:
- IOException
 
- 
compress- Throws:
- IOException
 
- 
compressInternalprotected abstract ByteBuffer compressInternal(ByteBuffer src, int startPositionOfOutput) throws IOException - Throws:
- IOException
 
- 
decompress- Throws:
- IOException
 
- 
decompressInternal- Throws:
- IOException
 
- 
decompress- Throws:
- IOException
 
- 
decompressInternalprotected abstract ByteBuffer decompressInternal(byte[] data, int offset, int length) throws IOException - Throws:
- IOException
 
- 
decompressAndPrependSchemaHeaderpublic ByteBuffer decompressAndPrependSchemaHeader(byte[] data, int offset, int length, int schemaHeader) throws IOException This method tries to decompress data and maybe prepend the schema header. The returned ByteBuffer will be backed by byte array that starts with schema header, followed by the decompressed data. The ByteBuffer will be positioned at the beginning of the decompressed data and the remaining of the ByteBuffer will be the length of the decompressed data.- Throws:
- IOException
 
- 
decompressAndPrependSchemaHeaderInternalprotected abstract ByteBuffer decompressAndPrependSchemaHeaderInternal(byte[] data, int offset, int length, int schemaHeader) throws IOException - Throws:
- IOException
 
- 
getCompressionStrategy
- 
decompress- Throws:
- IOException
 
- 
decompressInternal- Throws:
- IOException
 
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
- 
closeInternal- Throws:
- IOException
 
 
-