Package org.apache.parquet.hadoop.util
Class SerializationUtil
java.lang.Object
org.apache.parquet.hadoop.util.SerializationUtil
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
Modifier and TypeMethodDescriptionstatic <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 <T> TreadObjectFromConfAsBase64(String key, org.apache.parquet.conf.ParquetConfiguration 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 Details
-
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
-
readObjectFromConfAsBase64
public static <T> T readObjectFromConfAsBase64(String key, org.apache.parquet.conf.ParquetConfiguration 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
-