Package com.linkedin.venice.compression
Class ZstdWithDictCompressor
java.lang.Object
com.linkedin.venice.compression.VeniceCompressor
com.linkedin.venice.compression.ZstdWithDictCompressor
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Field Summary
Fields inherited from class com.linkedin.venice.compression.VeniceCompressor
SCHEMA_HEADER_LENGTH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
Build a dictionary based on synthetic data.protected void
protected byte[]
compressInternal
(byte[] data) protected ByteBuffer
compressInternal
(ByteBuffer data, int startPositionOfOutput) protected ByteBuffer
decompressAndPrependSchemaHeaderInternal
(byte[] data, int offset, int length, int schemaHeader) protected ByteBuffer
decompressInternal
(byte[] data, int offset, int length) protected InputStream
decompressInternal
(InputStream inputStream) protected ByteBuffer
decompressInternal
(ByteBuffer data) boolean
int
hashCode()
Methods inherited from class com.linkedin.venice.compression.VeniceCompressor
close, compress, compress, decompress, decompress, decompress, decompressAndPrependSchemaHeader, getCompressionStrategy
-
Constructor Details
-
ZstdWithDictCompressor
public ZstdWithDictCompressor(byte[] dictionary, int level)
-
-
Method Details
-
compressInternal
protected byte[] compressInternal(byte[] data) - Specified by:
compressInternal
in classVeniceCompressor
-
compressInternal
protected ByteBuffer compressInternal(ByteBuffer data, int startPositionOfOutput) throws IOException - Specified by:
compressInternal
in classVeniceCompressor
- Throws:
IOException
-
decompressInternal
- Specified by:
decompressInternal
in classVeniceCompressor
- Throws:
IOException
-
decompressInternal
- Specified by:
decompressInternal
in classVeniceCompressor
- Throws:
IOException
-
decompressAndPrependSchemaHeaderInternal
protected ByteBuffer decompressAndPrependSchemaHeaderInternal(byte[] data, int offset, int length, int schemaHeader) throws IOException - Specified by:
decompressAndPrependSchemaHeaderInternal
in classVeniceCompressor
- Throws:
IOException
-
decompressInternal
- Specified by:
decompressInternal
in classVeniceCompressor
- Throws:
IOException
-
closeInternal
- Specified by:
closeInternal
in classVeniceCompressor
- Throws:
IOException
-
buildDictionaryOnSyntheticAvroData
public static byte[] buildDictionaryOnSyntheticAvroData()Build a dictionary based on synthetic data. Used for empty push where there is no available dictionary to retrieve from a push job.- Returns:
- a zstd compression dictionary trained on small amount of avro data
-
hashCode
public int hashCode() -
equals
-