org.springframework.data.hadoop.configuration
Class ConfigurationUtils

java.lang.Object
  extended by org.springframework.data.hadoop.configuration.ConfigurationUtils

public abstract class ConfigurationUtils
extends Object

Reusable utility class for common Configuration operations.

Author:
Costin Leau

Constructor Summary
ConfigurationUtils()
           
 
Method Summary
static void addProperties(Configuration configuration, Properties properties)
          Adds the specified properties to the given Configuration object.
static Properties asProperties(Configuration configuration)
          Returns a static Properties copy of the given configuration.
static Configuration createFrom(Configuration original, Properties properties)
          Creates a new Configuration based on the given arguments.
static Configuration merge(Configuration one, Configuration two)
          Creates a new Configuration by merging the given configurations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationUtils

public ConfigurationUtils()
Method Detail

addProperties

public static void addProperties(Configuration configuration,
                                 Properties properties)
Adds the specified properties to the given Configuration object.

Parameters:
configuration - configuration to manipulate. Should not be null.
properties - properties to add to the configuration. May be null.

createFrom

public static Configuration createFrom(Configuration original,
                                       Properties properties)
Creates a new Configuration based on the given arguments.

Parameters:
original - initial configuration to read from. May be null.
properties - properties object to add to the newly created configuration. May be null.
Returns:
newly created configuration based on the input parameters.

asProperties

public static Properties asProperties(Configuration configuration)
Returns a static Properties copy of the given configuration.

Parameters:
configuration - Hadoop configuration

merge

public static Configuration merge(Configuration one,
                                  Configuration two)
Creates a new Configuration by merging the given configurations. Ordering is important - the second configuration overriding values in the first.

Parameters:
one - configuration to read from. May be null.
two - configuration to read from. May be null.
Returns:
the result of merging the two configurations.