Package com.linkedin.venice.compression
Class ZstdWithDictCompressor
- java.lang.Object
-
- com.linkedin.venice.compression.VeniceCompressor
-
- com.linkedin.venice.compression.ZstdWithDictCompressor
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class ZstdWithDictCompressor extends VeniceCompressor
-
-
Field Summary
-
Fields inherited from class com.linkedin.venice.compression.VeniceCompressor
SCHEMA_HEADER_LENGTH
-
-
Constructor Summary
Constructors Constructor Description ZstdWithDictCompressor(byte[] dictionary, int level)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static byte[]
buildDictionaryOnSyntheticAvroData()
Build a dictionary based on synthetic data.protected void
closeInternal()
protected byte[]
compressInternal(byte[] data)
protected java.nio.ByteBuffer
compressInternal(java.nio.ByteBuffer data, int startPositionOfOutput)
protected java.nio.ByteBuffer
decompressAndPrependSchemaHeaderInternal(byte[] data, int offset, int length, int schemaHeader)
protected java.nio.ByteBuffer
decompressInternal(byte[] data, int offset, int length)
protected java.io.InputStream
decompressInternal(java.io.InputStream inputStream)
protected java.nio.ByteBuffer
decompressInternal(java.nio.ByteBuffer data)
boolean
equals(java.lang.Object o)
int
hashCode()
-
Methods inherited from class com.linkedin.venice.compression.VeniceCompressor
close, compress, compress, decompress, decompress, decompress, decompressAndPrependSchemaHeader, getCompressionStrategy
-
-
-
-
Method Detail
-
compressInternal
protected byte[] compressInternal(byte[] data)
- Specified by:
compressInternal
in classVeniceCompressor
-
compressInternal
protected java.nio.ByteBuffer compressInternal(java.nio.ByteBuffer data, int startPositionOfOutput) throws java.io.IOException
- Specified by:
compressInternal
in classVeniceCompressor
- Throws:
java.io.IOException
-
decompressInternal
protected java.nio.ByteBuffer decompressInternal(java.nio.ByteBuffer data) throws java.io.IOException
- Specified by:
decompressInternal
in classVeniceCompressor
- Throws:
java.io.IOException
-
decompressInternal
protected java.nio.ByteBuffer decompressInternal(byte[] data, int offset, int length) throws java.io.IOException
- Specified by:
decompressInternal
in classVeniceCompressor
- Throws:
java.io.IOException
-
decompressAndPrependSchemaHeaderInternal
protected java.nio.ByteBuffer decompressAndPrependSchemaHeaderInternal(byte[] data, int offset, int length, int schemaHeader) throws java.io.IOException
- Specified by:
decompressAndPrependSchemaHeaderInternal
in classVeniceCompressor
- Throws:
java.io.IOException
-
decompressInternal
protected java.io.InputStream decompressInternal(java.io.InputStream inputStream) throws java.io.IOException
- Specified by:
decompressInternal
in classVeniceCompressor
- Throws:
java.io.IOException
-
closeInternal
protected void closeInternal() throws java.io.IOException
- Specified by:
closeInternal
in classVeniceCompressor
- Throws:
java.io.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()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-