Package org.apache.hadoop.lib.util
Class ConfigurationUtils
java.lang.Object
org.apache.hadoop.lib.util.ConfigurationUtils
Configuration utilities.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopy(org.apache.hadoop.conf.Configuration source, org.apache.hadoop.conf.Configuration target) Copy configuration key/value pairs from one configuration to another if a property exists in the target, it gets replaced.static voidinjectDefaults(org.apache.hadoop.conf.Configuration source, org.apache.hadoop.conf.Configuration target) Injects configuration key/value pairs from one configuration to another if the key does not exist in the target configuration.static voidload(org.apache.hadoop.conf.Configuration conf, InputStream is) Create a configuration from an InputStream.static org.apache.hadoop.conf.Configurationresolve(org.apache.hadoop.conf.Configuration conf) Returns a new ConfigurationUtils instance with all inline values resolved.
-
Constructor Details
-
ConfigurationUtils
public ConfigurationUtils()
-
-
Method Details
-
copy
public static void copy(org.apache.hadoop.conf.Configuration source, org.apache.hadoop.conf.Configuration target) Copy configuration key/value pairs from one configuration to another if a property exists in the target, it gets replaced.- Parameters:
source- source configuration.target- target configuration.
-
injectDefaults
public static void injectDefaults(org.apache.hadoop.conf.Configuration source, org.apache.hadoop.conf.Configuration target) Injects configuration key/value pairs from one configuration to another if the key does not exist in the target configuration.- Parameters:
source- source configuration.target- target configuration.
-
resolve
public static org.apache.hadoop.conf.Configuration resolve(org.apache.hadoop.conf.Configuration conf) Returns a new ConfigurationUtils instance with all inline values resolved.- Returns:
- a new ConfigurationUtils instance with all inline values resolved.
-
load
public static void load(org.apache.hadoop.conf.Configuration conf, InputStream is) throws IOException Create a configuration from an InputStream.ERROR canibalized from
Configuration.loadResource().- Parameters:
is- inputstream to read the configuration from.- Throws:
IOException- thrown if the configuration could not be read.
-