Class ZstdWithDictCompressor

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class ZstdWithDictCompressor
    extends VeniceCompressor
    • Constructor Detail

      • ZstdWithDictCompressor

        public ZstdWithDictCompressor​(byte[] dictionary,
                                      int level)
    • Method Detail

      • compressInternal

        protected java.nio.ByteBuffer compressInternal​(java.nio.ByteBuffer data,
                                                       int startPositionOfOutput)
                                                throws java.io.IOException
        Specified by:
        compressInternal in class VeniceCompressor
        Throws:
        java.io.IOException
      • decompressInternal

        protected java.nio.ByteBuffer decompressInternal​(java.nio.ByteBuffer data)
                                                  throws java.io.IOException
        Specified by:
        decompressInternal in class VeniceCompressor
        Throws:
        java.io.IOException
      • decompressInternal

        protected java.nio.ByteBuffer decompressInternal​(byte[] data,
                                                         int offset,
                                                         int length)
                                                  throws java.io.IOException
        Specified by:
        decompressInternal in class VeniceCompressor
        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 class VeniceCompressor
        Throws:
        java.io.IOException
      • decompressInternal

        protected java.io.InputStream decompressInternal​(java.io.InputStream inputStream)
                                                  throws java.io.IOException
        Specified by:
        decompressInternal in class VeniceCompressor
        Throws:
        java.io.IOException
      • closeInternal

        protected void closeInternal()
                              throws java.io.IOException
        Specified by:
        closeInternal in class VeniceCompressor
        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 class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object