Class GenericConverter
java.lang.Object
org.apache.hadoop.yarn.server.timelineservice.storage.common.GenericConverter
- All Implemented Interfaces:
ValueConverter
Uses GenericObjectMapper to encode objects as bytes and decode bytes as
objects.
-
Method Summary
Modifier and TypeMethodDescriptiondecodeValue(byte[] bytes) Decode a byte array and convert it into an object depending on the converter implementation.byte[]encodeValue(Object value) Encode an object as a byte array depending on the converter implementation.static GenericConverter
-
Method Details
-
getInstance
-
encodeValue
Description copied from interface:ValueConverterEncode an object as a byte array depending on the converter implementation.- Specified by:
encodeValuein interfaceValueConverter- Parameters:
value- Value to be encoded.- Returns:
- a byte array
- Throws:
IOException- if any problem is encountered while encoding.
-
decodeValue
Description copied from interface:ValueConverterDecode a byte array and convert it into an object depending on the converter implementation.- Specified by:
decodeValuein interfaceValueConverter- Parameters:
bytes- Byte array to be decoded.- Returns:
- an object
- Throws:
IOException- if any problem is encountered while decoding.
-