Package com.linkedin.davinci.compression
Class KeyUrnCompressor
java.lang.Object
com.linkedin.davinci.compression.KeyUrnCompressor
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 Summary
ConstructorsConstructorDescriptionKeyUrnCompressor
(org.apache.avro.Schema keySchema, UrnDictV1 urnDict) KeyUrnCompressor
(org.apache.avro.Schema keySchema, List<String> urnFieldNames, UrnDictV1 urnDict) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
compressKey
(byte[] key, boolean updateDictUponUnknownUrn) byte[]
compressKey
(Object keyObject, boolean updateDictUponUnknownUrn) decompressAndDecodeKey
(byte[] compressedKey) byte[]
decompressKey
(byte[] compressedKey) static void
validateKeySchemaBasedOnUrnFieldNames
(org.apache.avro.Schema keySchema, List<String> urnFieldNames)
-
Constructor Details
-
KeyUrnCompressor
-
KeyUrnCompressor
-
-
Method Details
-
compressKey
public byte[] compressKey(byte[] key, boolean updateDictUponUnknownUrn) -
compressKey
-
decompressAndDecodeKey
-
decompressKey
public byte[] decompressKey(byte[] compressedKey) -
validateKeySchemaBasedOnUrnFieldNames
-
getUrnDict
-
getUrnFieldNames
-