Class ConfigurationUtils

java.lang.Object
net.sansa_stack.hadoop.util.ConfigurationUtils

public class ConfigurationUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> T
    getJson(org.apache.hadoop.conf.Configuration conf, com.google.gson.Gson gson, String key, Class<T> clz, T defaultValue)
     
    static <T> T
    getSerializable(org.apache.hadoop.conf.Configuration conf, String key, T defaultValue)
    Get a (non-null) string as a base64 url encoded serialized object Obviously results in non-human-readable configuration objects and should thus be avoided.
    static void
    setJson(org.apache.hadoop.conf.Configuration conf, com.google.gson.Gson gson, String key, Object obj)
     
    static void
    setSerializable(org.apache.hadoop.conf.Configuration conf, String key, Serializable serializable)
    Set a serializable object as a base64 url encoded string

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ConfigurationUtils

      public ConfigurationUtils()
  • Method Details

    • getSerializable

      public static <T> T getSerializable(org.apache.hadoop.conf.Configuration conf, String key, T defaultValue)
      Get a (non-null) string as a base64 url encoded serialized object Obviously results in non-human-readable configuration objects and should thus be avoided. Useful for rapid prototyping though.
    • setSerializable

      public static void setSerializable(org.apache.hadoop.conf.Configuration conf, String key, Serializable serializable)
      Set a serializable object as a base64 url encoded string
    • getJson

      public static <T> T getJson(org.apache.hadoop.conf.Configuration conf, com.google.gson.Gson gson, String key, Class<T> clz, T defaultValue)
    • setJson

      public static void setJson(org.apache.hadoop.conf.Configuration conf, com.google.gson.Gson gson, String key, Object obj)