Package org.apache.parquet.hadoop.util
Class SerializationUtil
- java.lang.Object
-
- org.apache.parquet.hadoop.util.SerializationUtil
-
public final class SerializationUtil extends Object
Serialization utils copied from: https://github.com/kevinweil/elephant-bird/blob/master/core/src/main/java/com/twitter/elephantbird/util/HadoopUtils.java TODO: Refactor elephant-bird so that we can depend on utils like this without extra baggage.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TreadObjectFromConfAsBase64(String key, org.apache.hadoop.conf.Configuration conf)Reads an object (that was written usingwriteObjectToConfAsBase64(java.lang.String, java.lang.Object, org.apache.hadoop.conf.Configuration)) from a configurationstatic voidwriteObjectToConfAsBase64(String key, Object obj, org.apache.hadoop.conf.Configuration conf)Writes an object to a configuration.
-
-
-
Method Detail
-
writeObjectToConfAsBase64
public static void writeObjectToConfAsBase64(String key, Object obj, org.apache.hadoop.conf.Configuration conf) throws IOException
Writes an object to a configuration.- Parameters:
key- for the configurationobj- the object to writeconf- to read from- Throws:
IOException- if there is an error while writing
-
readObjectFromConfAsBase64
public static <T> T readObjectFromConfAsBase64(String key, org.apache.hadoop.conf.Configuration conf) throws IOException
Reads an object (that was written usingwriteObjectToConfAsBase64(java.lang.String, java.lang.Object, org.apache.hadoop.conf.Configuration)) from a configuration- Type Parameters:
T- the Java type of the deserialized object- Parameters:
key- for the configurationconf- to read from- Returns:
- the read object, or null if key is not present in conf
- Throws:
IOException- if there is an error while reading
-
-