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 YarnConfiguration 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<org.apache.hadoop.yarn.conf.YarnConfiguration> getObjectType()
           
 boolean isSingleton()
           
 void setBeanClassLoader(java.lang.ClassLoader classLoader)
           
 void setConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration configuration)
          Sets the parent configuration.
 void setFsUri(java.lang.String fsUri)
          Sets the File System ('fs.defaultFS') 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 setResources(java.util.Set<org.springframework.core.io.Resource> resources)
          Sets the configuration resources.
 void setRmAddress(java.lang.String rmAddress)
          Sets the Yarn ('yarn.resourcemanager.address') address.
 void setSchedulerAddress(java.lang.String schedulerAddress)
          Sets the Yarn ('yarn.resourcemanager.scheduler.address') address.
 
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

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<org.apache.hadoop.yarn.conf.YarnConfiguration> 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

afterPropertiesSet

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

setFsUri

public void setFsUri(java.lang.String fsUri)
Sets the File System ('fs.defaultFS') URI.

Parameters:
fsUri - the file system uri

setRmAddress

public void setRmAddress(java.lang.String rmAddress)
Sets the Yarn ('yarn.resourcemanager.address') address.

Parameters:
rmAddress - the resource manager address

setSchedulerAddress

public void setSchedulerAddress(java.lang.String schedulerAddress)
Sets the Yarn ('yarn.resourcemanager.scheduler.address') address.

Parameters:
schedulerAddress - the resource manager scheduler address

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

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 - the configuration
Returns:
configuration new or wrapped configuration

Spring for Apache Hadoop