public class ConfigurationObjectUtils extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
decodeBytes(String str)
Decode bytes from a hex String
|
static String |
encodeBytes(byte[] bytes)
Encode bytes to a hex String
|
static byte[] |
getByteArray(String confOption,
org.apache.hadoop.conf.Configuration conf)
Get byte array from a conf option
|
static <T> T |
getObjectKryo(String confOption,
org.apache.hadoop.conf.Configuration conf)
Get object from a conf option using kryo
|
static void |
setByteArray(byte[] data,
String confOption,
org.apache.hadoop.conf.Configuration conf)
Set byte array to a conf option
|
static <T> void |
setObjectKryo(T object,
String confOption,
org.apache.hadoop.conf.Configuration conf)
Set object in a conf option using kryo
|
public static String encodeBytes(byte[] bytes)
bytes
- byte[]public static byte[] decodeBytes(String str)
str
- String to decodepublic static void setByteArray(byte[] data, String confOption, org.apache.hadoop.conf.Configuration conf)
data
- Byte arrayconfOption
- Conf optionconf
- Configurationpublic static byte[] getByteArray(String confOption, org.apache.hadoop.conf.Configuration conf)
confOption
- Conf optionconf
- Configurationpublic static <T> void setObjectKryo(T object, String confOption, org.apache.hadoop.conf.Configuration conf)
T
- Type of the objectobject
- Object to setconfOption
- Conf optionconf
- Configurationpublic static <T> T getObjectKryo(String confOption, org.apache.hadoop.conf.Configuration conf)
T
- Type of the objectconfOption
- Conf optionconf
- ConfigurationCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.