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

public final class LongKeyConverter extends Object implements KeyConverter<Long>
Encodes and decodes column names / row keys which are long.
  • Constructor Details

    • LongKeyConverter

      public LongKeyConverter()
  • Method Details

    • encode

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

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