Class AppIdKeyConverter
java.lang.Object
org.apache.hadoop.yarn.server.timelineservice.storage.common.AppIdKeyConverter
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecode(byte[] appIdBytes) Decodes a byte array and returns a key of type T.byte[]Encodes a key as a byte array.static intReturns the size of app id after encoding.
-
Constructor Details
-
AppIdKeyConverter
public AppIdKeyConverter()
-
-
Method Details
-
encode
Description copied from interface:KeyConverterEncodes a key as a byte array.- Specified by:
encodein interfaceKeyConverter<String>- Parameters:
appIdStr- key to be encoded.- Returns:
- a byte array.
-
decode
Description copied from interface:KeyConverterDecodes a byte array and returns a key of type T.- Specified by:
decodein interfaceKeyConverter<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.
-