Spring for Apache Hadoop

org.springframework.yarn.configuration
Class ConfigurationFactoryBean

java.lang.Object
  extended by org.springframework.yarn.configuration.ConfigurationFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<org.apache.hadoop.yarn.conf.YarnConfiguration>, org.springframework.beans.factory.InitializingBean

public class ConfigurationFactoryBean
extends java.lang.Object
implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.FactoryBean<org.apache.hadoop.yarn.conf.YarnConfiguration>

FactoryBean for creating Configuration instances.

Author:
Costin Leau, Janne Valkealahti

Constructor Summary
ConfigurationFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  org.apache.hadoop.yarn.conf.YarnConfiguration createConfiguration(org.apache.hadoop.conf.Configuration existing)
          Creates a configuration instance potentially using the existing one (passed as an argument - which can be null).
 org.apache.hadoop.yarn.conf.YarnConfiguration getObject()
           
 java.lang.Class<?> getObjectType()
           
 boolean isSingleton()
           
protected  void postProcessConfiguration(org.apache.hadoop.conf.Configuration configuration)
           
 void setBeanClassLoader(java.lang.ClassLoader classLoader)
           
 void setConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration configuration)
          Sets the parent configuration.
 void setFileSystemUri(java.lang.String fsUri)
          Sets the File System ('fs.default.name') URI.
 void setInitialize(boolean initialize)
          Indicates whether the configuration object should be initialized (true) or not.
 void setProperties(java.util.Properties properties)
          Sets the configuration properties.
 void setRegisterUrlHandler(boolean register)
          Indicates whether the configuration should register an URL handler (for allowing urls to understand HDFS prefixes, such as hdfs) or not.
 void setResourceManagerAddress(java.lang.String rmAddress)
          Sets the Job Tracker ('mapred.jobtracker') URI.
 void setResources(java.util.Set<org.springframework.core.io.Resource> resources)
          Sets the configuration resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationFactoryBean

public ConfigurationFactoryBean()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

createConfiguration

protected org.apache.hadoop.yarn.conf.YarnConfiguration createConfiguration(org.apache.hadoop.conf.Configuration existing)
Creates a configuration instance potentially using the existing one (passed as an argument - which can be null).

Parameters:
existing -
Returns:
configuration instance

postProcessConfiguration

protected void postProcessConfiguration(org.apache.hadoop.conf.Configuration configuration)

getObject

public org.apache.hadoop.yarn.conf.YarnConfiguration getObject()
Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean<org.apache.hadoop.yarn.conf.YarnConfiguration>

getObjectType

public java.lang.Class<?> getObjectType()
Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean<org.apache.hadoop.yarn.conf.YarnConfiguration>

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean<org.apache.hadoop.yarn.conf.YarnConfiguration>

setBeanClassLoader

public void setBeanClassLoader(java.lang.ClassLoader classLoader)
Specified by:
setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAware

setConfiguration

public void setConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration configuration)
Sets the parent configuration.

Parameters:
configuration - The configuration to set.

setResources

public void setResources(java.util.Set<org.springframework.core.io.Resource> resources)
Sets the configuration resources.

Parameters:
resources - The resources to set.

setProperties

public void setProperties(java.util.Properties properties)
Sets the configuration properties.

Parameters:
properties - The properties to set.

setInitialize

public void setInitialize(boolean initialize)
Indicates whether the configuration object should be initialized (true) or not. This option should normally be set to true (the default) as it causes the jars, streams and resources set to be loaded - postponing the initializing might cause these to become unreadable.

Parameters:
initialize - whether to initialize or not.

setRegisterUrlHandler

public void setRegisterUrlHandler(boolean register)
Indicates whether the configuration should register an URL handler (for allowing urls to understand HDFS prefixes, such as hdfs) or not. As this operation impacts an entire VM and can be invoked at most once per JVM, by default it is false.

Parameters:
register - whether to register an URL handler or not

setFileSystemUri

public void setFileSystemUri(java.lang.String fsUri)
Sets the File System ('fs.default.name') URI.

Parameters:
fsUri -

setResourceManagerAddress

public void setResourceManagerAddress(java.lang.String rmAddress)
Sets the Job Tracker ('mapred.jobtracker') URI.

Parameters:
rmAddress -

Spring for Apache Hadoop