public interface YarnConfigConfigurer
YarnConfigConfigure is an interface for YarnConfigBuilder which is
exposed to user via SpringYarnConfigurerAdapter.
Typically configuration is shown below.
@Configuration
@EnableYarn
static class Config extends SpringYarnConfigurerAdapter {
@Override
public void configure(YarnConfigConfigure config) throws Exception {
config
.fileSystemUri("hdfs://foo.uri")
.withResources()
.resource("classpath:/test-site-1.xml")
.resource("classpath:/test-site-2.xml")
.and()
.withProperties()
.property("foo", "jee");
}
}
| Modifier and Type | Method and Description |
|---|---|
YarnConfigConfigurer |
fileSystemUri(java.lang.String uri)
Specify a Hdfs file system uri.
|
YarnConfigConfigurer |
loadDefaults(boolean loadDefaults)
Specify if Hadoop
Configuration is initially
based on default values. |
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. |
ResourceConfigurer<YarnConfigConfigurer> withResources() throws java.lang.Exception
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"/>
ResourceConfigurer for chainingjava.lang.Exception - if error occurredPropertiesConfigurer<YarnConfigConfigurer> withProperties() throws java.lang.Exception
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"/>
PropertiesConfigurer for chainingjava.lang.Exception - if error occurredYarnConfigConfigurer fileSystemUri(java.lang.String uri)
public void configure(YarnConfigConfigure config) throws Exception {
config
.fileSystemUri("hdfs://myhost:8020");
}
<yarn:configuration fs-uri="hdfs://myhost:8020"/>
uri - The Hdfs uriYarnConfigConfigurer for chainingYarnConfigConfigurer resourceManagerAddress(java.lang.String address)
public void configure(YarnConfigConfigure config) throws Exception {
config
.resourceManagerAddress("myRmHost:8032");
}
<yarn:configuration rm-address="myRmHost:8032"/>
address - The Yarn resource manager addressYarnConfigConfigurer for chainingYarnConfigConfigurer schedulerAddress(java.lang.String address)
public void configure(YarnConfigConfigure config) throws Exception {
config
.schedulerAddress("myRmHost:8030");
}
<yarn:configuration scheduler-address="myRmHost:8030"/>
address - The Yarn resource manager scheduler addressYarnConfigConfigurer for chainingYarnConfigConfigurer loadDefaults(boolean loadDefaults)
Configuration is initially
based on default values. Default is true.
public void configure(YarnConfigConfigure config) throws Exception {
config
.loadDefaults(true);
}
loadDefaults - The flag if defaults should be loadedYarnConfigConfigurer for chaining