public final class HadoopConfigBuilder extends AbstractConfiguredAnnotationBuilder<org.apache.hadoop.conf.Configuration,HadoopConfigConfigurer,HadoopConfigBuilder> implements PropertiesConfigurerAware, ResourceConfigurerAware, SecurityConfigurerAware, HadoopConfigConfigurer
AnnotationBuilder
for Configuration
.Constructor and Description |
---|
HadoopConfigBuilder()
Instantiates a new yarn config builder.
|
HadoopConfigBuilder(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
Instantiates a new hadoop config builder.
|
Modifier and Type | Method and Description |
---|---|
void |
configureProperties(java.util.Properties properties)
Configure
Properties . |
void |
configureResources(java.util.Set<org.springframework.core.io.Resource> resources)
Configure
Resource s. |
void |
configureSecurity(HadoopSecurity hadoopSecurity)
Configure
HadoopSecurity . |
HadoopConfigConfigurer |
fileSystemUri(java.lang.String uri)
Specify a Hdfs file system uri.
|
java.util.Properties |
getProperties()
Gets the
Properties . |
java.util.Set<org.springframework.core.io.Resource> |
getResources()
Gets the
Resource s. |
HadoopSecurity |
getSecurity()
Gets the
HadoopSecurity . |
HadoopConfigConfigurer |
jobHistoryAddress(java.lang.String jobHistoryAddress)
Specify a MapReduce job history address.
|
HadoopConfigConfigurer |
loadDefaults(boolean loadDefaults)
Specify if Hadoop
Configuration is initially
based on default values. |
protected org.apache.hadoop.conf.Configuration |
performBuild()
Subclasses must implement this method to build the object that is being returned.
|
HadoopConfigConfigurer |
resourceManagerAddress(java.lang.String address)
Specify a Yarn resource manager address.
|
PropertiesConfigurer<HadoopConfigConfigurer> |
withProperties()
Specify configuration options as properties with a
PropertiesConfigurer . |
ResourceConfigurer<HadoopConfigConfigurer> |
withResources()
Specify configuration options as resource properties with a
ResourceConfigurer . |
SecurityConfigurer<HadoopConfigConfigurer> |
withSecurity()
Specify security options with a
SecurityConfigurer . |
apply, apply, beforeConfigureMains, beforeConfigurePosts, beforeInit, doBuild, getConfigurer, getConfigurers, getOrApply, getOrBuild, getSharedObject, getSharedObjects, objectPostProcessor, postProcess, removeConfigurer, removeConfigurers, setSharedObject
build, getObject
public HadoopConfigBuilder()
public HadoopConfigBuilder(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
objectPostProcessor
- the object post processorprotected org.apache.hadoop.conf.Configuration performBuild() throws java.lang.Exception
AbstractConfiguredAnnotationBuilder
performBuild
in class AbstractConfiguredAnnotationBuilder<org.apache.hadoop.conf.Configuration,HadoopConfigConfigurer,HadoopConfigBuilder>
java.lang.Exception
public void configureProperties(java.util.Properties properties)
PropertiesConfigurerAware
Properties
.configureProperties
in interface PropertiesConfigurerAware
properties
- the propertiespublic void configureResources(java.util.Set<org.springframework.core.io.Resource> resources)
ResourceConfigurerAware
Resource
s.configureResources
in interface ResourceConfigurerAware
resources
- the resourcespublic void configureSecurity(HadoopSecurity hadoopSecurity)
SecurityConfigurerAware
HadoopSecurity
.configureSecurity
in interface SecurityConfigurerAware
hadoopSecurity
- the hadoop securitypublic ResourceConfigurer<HadoopConfigConfigurer> withResources() throws java.lang.Exception
HadoopConfigConfigurer
ResourceConfigurer
.
public void configure(HadoopConfigConfigurer config) throws Exception { Properties props = new Properties(); config .withResources() .resource("cfg-1.properties") .resource("cfg-2.properties") .and(); }
<hadoop:configuration properties-location="cfg-1.properties, cfg-2.properties"/>
withResources
in interface HadoopConfigConfigurer
ResourceConfigurer
for chainingjava.lang.Exception
- if error occurredpublic PropertiesConfigurer<HadoopConfigConfigurer> withProperties() throws java.lang.Exception
HadoopConfigConfigurer
PropertiesConfigurer
.
public void configure(HadoopConfigConfigurer config) throws Exception { Properties props = new Properties(); config .withProperties() .properties(props) .property("myKey1", ",myValue1") .and(); }
<util:properties id="props" location="props.properties"/> <prop key="myKey1">myValue1</prop> </util:properties> <hadoop:configuration properties-ref="props"/>
withProperties
in interface HadoopConfigConfigurer
PropertiesConfigurer
for chainingjava.lang.Exception
- if error occurredpublic SecurityConfigurer<HadoopConfigConfigurer> withSecurity() throws java.lang.Exception
HadoopConfigConfigurer
SecurityConfigurer
.
JavaConfig:
public void configure(HadoopConfigConfigurer config) throws Exception { config .withSecurity() .authMethod("kerberos") .namenodePrincipal("hdfs/myhost@LOCALDOMAIN") .rmManagerPrincipal("yarn/myhost@LOCALDOMAIN"); }
XML:
No equivalent
withSecurity
in interface HadoopConfigConfigurer
SecurityConfigurer
for chainingjava.lang.Exception
- if error occurredpublic HadoopConfigConfigurer fileSystemUri(java.lang.String uri)
HadoopConfigConfigurer
public void configure(HadoopConfigConfigurer config) throws Exception { config .fileSystemUri("hdfs://myhost:8020"); }
<hadoop:configuration file-system-uri="hdfs://myhost:8020"/>
fileSystemUri
in interface HadoopConfigConfigurer
uri
- The Hdfs uriHadoopConfigConfigurer
for chainingpublic HadoopConfigConfigurer resourceManagerAddress(java.lang.String address)
HadoopConfigConfigurer
public void configure(HadoopConfigConfigurer config) throws Exception { config .resourceManagerAddress("myRmHost:8032"); }
<hadoop:configuration rm-manager-uri="myRmHost:8032"/>
resourceManagerAddress
in interface HadoopConfigConfigurer
address
- The Yarn resource manager addressHadoopConfigConfigurer
for chainingpublic HadoopConfigConfigurer jobHistoryAddress(java.lang.String jobHistoryAddress)
HadoopConfigConfigurer
public void configure(HadoopConfigConfigurer config) throws Exception { config .jobHistoryAddress("myJobHistoryHost:10020"); }
<hadoop:configuration job-history-uri="myJobHistoryHost:10020"/>
jobHistoryAddress
in interface HadoopConfigConfigurer
jobHistoryAddress
- The Yarn resource manager addressHadoopConfigConfigurer
for chainingpublic HadoopConfigConfigurer loadDefaults(boolean loadDefaults)
HadoopConfigConfigurer
Configuration
is initially
based on default values. Default is true
.
public void configure(HadoopConfigConfigurer config) throws Exception { config .loadDefaults(true); }
loadDefaults
in interface HadoopConfigConfigurer
loadDefaults
- The flag if defaults should be loadedHadoopConfigConfigurer
for chainingpublic java.util.Properties getProperties()
Properties
.public java.util.Set<org.springframework.core.io.Resource> getResources()
Resource
s.public HadoopSecurity getSecurity()
HadoopSecurity
.