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
Resources. |
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
Resources. |
HadoopSecurity |
getSecurity()
Gets the
HadoopSecurity. |
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, setSharedObjectbuild, getObjectpublic HadoopConfigBuilder()
public HadoopConfigBuilder(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
objectPostProcessor - the object post processorprotected org.apache.hadoop.conf.Configuration performBuild()
throws java.lang.Exception
AbstractConfiguredAnnotationBuilderperformBuild in class AbstractConfiguredAnnotationBuilder<org.apache.hadoop.conf.Configuration,HadoopConfigConfigurer,HadoopConfigBuilder>java.lang.Exceptionpublic void configureProperties(java.util.Properties properties)
PropertiesConfigurerAwareProperties.configureProperties in interface PropertiesConfigurerAwareproperties - the propertiespublic void configureResources(java.util.Set<org.springframework.core.io.Resource> resources)
ResourceConfigurerAwareResources.configureResources in interface ResourceConfigurerAwareresources - the resourcespublic void configureSecurity(HadoopSecurity hadoopSecurity)
SecurityConfigurerAwareHadoopSecurity.configureSecurity in interface SecurityConfigurerAwarehadoopSecurity - the hadoop securitypublic ResourceConfigurer<HadoopConfigConfigurer> withResources() throws java.lang.Exception
HadoopConfigConfigurerResourceConfigurer.
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 HadoopConfigConfigurerResourceConfigurer for chainingjava.lang.Exception - if error occurredpublic PropertiesConfigurer<HadoopConfigConfigurer> withProperties() throws java.lang.Exception
HadoopConfigConfigurerPropertiesConfigurer.
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 HadoopConfigConfigurerPropertiesConfigurer for chainingjava.lang.Exception - if error occurredpublic SecurityConfigurer<HadoopConfigConfigurer> withSecurity() throws java.lang.Exception
HadoopConfigConfigurerSecurityConfigurer.
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 HadoopConfigConfigurerSecurityConfigurer 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");
}
<yarn:configuration fs-uri="hdfs://myhost:8020"/>
fileSystemUri in interface HadoopConfigConfigureruri - The Hdfs uriHadoopConfigConfigurer for chainingpublic HadoopConfigConfigurer resourceManagerAddress(java.lang.String address)
HadoopConfigConfigurer
public void configure(HadoopConfigConfigurer config) throws Exception {
config
.resourceManagerAddress("myRmHost:8032");
}
<yarn:configuration rm-address="myRmHost:8032"/>
resourceManagerAddress in interface HadoopConfigConfigureraddress - The Yarn resource manager addressHadoopConfigConfigurer for chainingpublic HadoopConfigConfigurer loadDefaults(boolean loadDefaults)
HadoopConfigConfigurerConfiguration is initially
based on default values. Default is true.
public void configure(HadoopConfigConfigurer config) throws Exception {
config
.loadDefaults(true);
}
loadDefaults in interface HadoopConfigConfigurerloadDefaults - The flag if defaults should be loadedHadoopConfigConfigurer for chainingpublic java.util.Properties getProperties()
Properties.public java.util.Set<org.springframework.core.io.Resource> getResources()
Resources.public HadoopSecurity getSecurity()
HadoopSecurity.