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

public final class StringKeyConverter extends Object implements KeyConverter<String>
Encodes and decodes column names / row keys which are merely strings. Column prefixes are not part of the column name passed for encoding. It is added later, if required in the associated ColumnPrefix implementations.
  • Constructor Details

    • StringKeyConverter

      public StringKeyConverter()
  • Method Details

    • encode

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

      public String 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<String>
      Parameters:
      bytes - byte representation
      Returns:
      an object(key) of type T which has been constructed after decoding the bytes.