java.lang.Object
org.apache.hadoop.yarn.server.timelineservice.storage.common.GenericConverter
All Implemented Interfaces:
ValueConverter

public final class GenericConverter extends Object implements ValueConverter
Uses GenericObjectMapper to encode objects as bytes and decode bytes as objects.
  • Method Details

    • getInstance

      public static GenericConverter getInstance()
    • encodeValue

      public byte[] encodeValue(Object value) throws IOException
      Description copied from interface: ValueConverter
      Encode an object as a byte array depending on the converter implementation.
      Specified by:
      encodeValue in interface ValueConverter
      Parameters:
      value - Value to be encoded.
      Returns:
      a byte array
      Throws:
      IOException - if any problem is encountered while encoding.
    • decodeValue

      public Object decodeValue(byte[] bytes) throws IOException
      Description copied from interface: ValueConverter
      Decode a byte array and convert it into an object depending on the converter implementation.
      Specified by:
      decodeValue in interface ValueConverter
      Parameters:
      bytes - Byte array to be decoded.
      Returns:
      an object
      Throws:
      IOException - if any problem is encountered while decoding.