Class KeyUrnCompressor

java.lang.Object
com.linkedin.davinci.compression.KeyUrnCompressor

public class KeyUrnCompressor extends Object
This class provides functionality to compress and decompress keys containing URNs using a URN dictionary. It supports both string type key schema (when the entire key is a URN) and record type key schema (when the key is a record containing one or more URN fields).
  • Constructor Details

    • KeyUrnCompressor

      public KeyUrnCompressor(org.apache.avro.Schema keySchema, UrnDictV1 urnDict)
    • KeyUrnCompressor

      public KeyUrnCompressor(org.apache.avro.Schema keySchema, List<String> urnFieldNames, UrnDictV1 urnDict)
  • Method Details

    • compressKey

      public byte[] compressKey(byte[] key, boolean updateDictUponUnknownUrn)
    • compressKey

      public byte[] compressKey(Object keyObject, boolean updateDictUponUnknownUrn)
    • decompressAndDecodeKey

      public Object decompressAndDecodeKey(byte[] compressedKey)
    • decompressKey

      public byte[] decompressKey(byte[] compressedKey)
    • validateKeySchemaBasedOnUrnFieldNames

      public static void validateKeySchemaBasedOnUrnFieldNames(org.apache.avro.Schema keySchema, List<String> urnFieldNames)
    • getUrnDict

      public UrnDictV1 getUrnDict()
    • getUrnFieldNames

      public List<String> getUrnFieldNames()