public final class YarnConfigBuilder extends AbstractConfiguredAnnotationBuilder<org.apache.hadoop.yarn.conf.YarnConfiguration,YarnConfigConfigurer,YarnConfigBuilder> implements PropertiesConfigurerAware, ResourceConfigurerAware, SecurityConfigurerAware, YarnConfigConfigurer
AnnotationBuilder for YarnConfiguration.| Constructor and Description |
|---|
YarnConfigBuilder()
Instantiates a new yarn config builder.
|
YarnConfigBuilder(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
Instantiates a new yarn 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. |
YarnConfigConfigurer |
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. |
YarnConfigConfigurer |
loadDefaults(boolean loadDefaults)
Specify if Hadoop
Configuration is initially
based on default values. |
protected org.apache.hadoop.yarn.conf.YarnConfiguration |
performBuild()
Subclasses must implement this method to build the object that is being returned.
|
YarnConfigConfigurer |
resourceManagerAddress(java.lang.String address)
Specify a Yarn resource manager address.
|
YarnConfigConfigurer |
schedulerAddress(java.lang.String address)
Specify a Yarn resource manager scheduler address.
|
PropertiesConfigurer<YarnConfigConfigurer> |
withProperties()
Specify configuration options as properties with a
PropertiesConfigurer. |
ResourceConfigurer<YarnConfigConfigurer> |
withResources()
Specify configuration options as resource properties with a
ResourceConfigurer. |
SecurityConfigurer<YarnConfigConfigurer> |
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 YarnConfigBuilder()
public YarnConfigBuilder(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
objectPostProcessor - the object post processorprotected org.apache.hadoop.yarn.conf.YarnConfiguration performBuild()
throws java.lang.Exception
AbstractConfiguredAnnotationBuilderperformBuild in class AbstractConfiguredAnnotationBuilder<org.apache.hadoop.yarn.conf.YarnConfiguration,YarnConfigConfigurer,YarnConfigBuilder>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<YarnConfigConfigurer> withResources() throws java.lang.Exception
YarnConfigConfigurerResourceConfigurer.
public void configure(YarnConfigConfigure config) throws Exception {
Properties props = new Properties();
config
.withResources()
.resource("cfg-1.properties")
.resource("cfg-2.properties")
.and();
}
<yarn:configuration properties-location="cfg-1.properties, cfg-2.properties"/>
withResources in interface YarnConfigConfigurerResourceConfigurer for chainingjava.lang.Exception - if error occurredpublic PropertiesConfigurer<YarnConfigConfigurer> withProperties() throws java.lang.Exception
YarnConfigConfigurerPropertiesConfigurer.
public void configure(YarnConfigConfigure 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> <yarn:configuration properties-ref="props"/>
withProperties in interface YarnConfigConfigurerPropertiesConfigurer for chainingjava.lang.Exception - if error occurredpublic SecurityConfigurer<YarnConfigConfigurer> withSecurity() throws java.lang.Exception
YarnConfigConfigurerSecurityConfigurer.
public void configure(YarnConfigConfigure config) throws Exception {
config
.withSecurity()
.authMethod("kerberos")
.namenodePrincipal("hdfs/myhost@LOCALDOMAIN")
.rmManagerPrincipal("yarn/myhost@LOCALDOMAIN");
}
XML:
No equivalent
withSecurity in interface YarnConfigConfigurerSecurityConfigurer for chainingjava.lang.Exception - if error occurredpublic YarnConfigConfigurer fileSystemUri(java.lang.String uri)
YarnConfigConfigurer
public void configure(YarnConfigConfigure config) throws Exception {
config
.fileSystemUri("hdfs://myhost:8020");
}
<yarn:configuration fs-uri="hdfs://myhost:8020"/>
fileSystemUri in interface YarnConfigConfigureruri - The Hdfs uriYarnConfigConfigurer for chainingpublic YarnConfigConfigurer resourceManagerAddress(java.lang.String address)
YarnConfigConfigurer
public void configure(YarnConfigConfigure config) throws Exception {
config
.resourceManagerAddress("myRmHost:8032");
}
<yarn:configuration rm-address="myRmHost:8032"/>
resourceManagerAddress in interface YarnConfigConfigureraddress - The Yarn resource manager addressYarnConfigConfigurer for chainingpublic YarnConfigConfigurer schedulerAddress(java.lang.String address)
YarnConfigConfigurer
public void configure(YarnConfigConfigure config) throws Exception {
config
.schedulerAddress("myRmHost:8030");
}
<yarn:configuration scheduler-address="myRmHost:8030"/>
schedulerAddress in interface YarnConfigConfigureraddress - The Yarn resource manager scheduler addressYarnConfigConfigurer for chainingpublic YarnConfigConfigurer loadDefaults(boolean loadDefaults)
YarnConfigConfigurerConfiguration is initially
based on default values. Default is true.
public void configure(YarnConfigConfigure config) throws Exception {
config
.loadDefaults(true);
}
loadDefaults in interface YarnConfigConfigurerloadDefaults - The flag if defaults should be loadedYarnConfigConfigurer for chainingpublic java.util.Properties getProperties()
Properties.public java.util.Set<org.springframework.core.io.Resource> getResources()
Resources.public HadoopSecurity getSecurity()
HadoopSecurity.