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
Resource s. |
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
Resource s. |
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, setSharedObject
build, getObject
public YarnConfigBuilder()
public YarnConfigBuilder(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
objectPostProcessor
- the object post processorprotected org.apache.hadoop.yarn.conf.YarnConfiguration performBuild() throws java.lang.Exception
AbstractConfiguredAnnotationBuilder
performBuild
in class AbstractConfiguredAnnotationBuilder<org.apache.hadoop.yarn.conf.YarnConfiguration,YarnConfigConfigurer,YarnConfigBuilder>
java.lang.Exception
- on errorpublic 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<YarnConfigConfigurer> withResources() throws java.lang.Exception
YarnConfigConfigurer
ResourceConfigurer
.
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 YarnConfigConfigurer
ResourceConfigurer
for chainingjava.lang.Exception
- if error occurredpublic PropertiesConfigurer<YarnConfigConfigurer> withProperties() throws java.lang.Exception
YarnConfigConfigurer
PropertiesConfigurer
.
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 YarnConfigConfigurer
PropertiesConfigurer
for chainingjava.lang.Exception
- if error occurredpublic SecurityConfigurer<YarnConfigConfigurer> withSecurity() throws java.lang.Exception
YarnConfigConfigurer
SecurityConfigurer
.
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 YarnConfigConfigurer
SecurityConfigurer
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 YarnConfigConfigurer
uri
- 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 YarnConfigConfigurer
address
- 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 YarnConfigConfigurer
address
- The Yarn resource manager scheduler addressYarnConfigConfigurer
for chainingpublic YarnConfigConfigurer loadDefaults(boolean loadDefaults)
YarnConfigConfigurer
Configuration
is initially
based on default values. Default is true
.
public void configure(YarnConfigConfigure config) throws Exception { config .loadDefaults(true); }
loadDefaults
in interface YarnConfigConfigurer
loadDefaults
- The flag if defaults should be loadedYarnConfigConfigurer
for chainingpublic java.util.Properties getProperties()
Properties
.public java.util.Set<org.springframework.core.io.Resource> getResources()
Resource
s.public HadoopSecurity getSecurity()
HadoopSecurity
.