java.lang.Object
org.apache.hadoop.yarn.server.timelineservice.storage.common.AppIdKeyConverter
All Implemented Interfaces:
KeyConverter<String>

public final class AppIdKeyConverter extends Object implements KeyConverter<String>
Encodes and decodes ApplicationId for row keys. App ID is stored in row key as 12 bytes, cluster timestamp section of app id (long - 8 bytes) followed by sequence id section of app id (int - 4 bytes).
  • Constructor Details

    • AppIdKeyConverter

      public AppIdKeyConverter()
  • Method Details

    • encode

      public byte[] encode(String appIdStr)
      Description copied from interface: KeyConverter
      Encodes a key as a byte array.
      Specified by:
      encode in interface KeyConverter<String>
      Parameters:
      appIdStr - key to be encoded.
      Returns:
      a byte array.
    • decode

      public String decode(byte[] appIdBytes)
      Description copied from interface: KeyConverter
      Decodes a byte array and returns a key of type T.
      Specified by:
      decode in interface KeyConverter<String>
      Parameters:
      appIdBytes - byte representation
      Returns:
      an object(key) of type T which has been constructed after decoding the bytes.
    • getKeySize

      public static int getKeySize()
      Returns the size of app id after encoding.
      Returns:
      size of app id after encoding.