public interface YarnEnvironmentConfigurer
YarnEnvironmentBuilder used from
a SpringYarnConfigurerAdapter.
Typically configuration is used as shown below.
@Configuration
@EnableYarn
static class Config extends SpringYarnConfigurerAdapter {
@Override
public void configure(YarnEnvironmentBuilder environment) throws Exception {
environment
.withClasspath()
.entry("cpEntry1")
.entry("cpEntry2")
.useDefaultYarnClasspath(true);
}
}
| Modifier and Type | Method and Description |
|---|---|
YarnEnvironmentConfigurer |
entry(String key,
String value)
Specify an environment variable.
|
YarnEnvironmentConfigurer |
includeLocalSystemEnv(boolean includeLocalSystemEnv)
Specify if existing system environment variables should
be included automatically.
|
YarnEnvironmentConfigurer |
propertiesLocation(String... locations)
Specify properties locations.
|
EnvironmentClasspathConfigurer |
withClasspath()
Specify a classpath environment variable.
|
org.springframework.data.hadoop.config.common.annotation.configurers.PropertiesConfigurer<YarnEnvironmentConfigurer> |
withProperties()
Specify properties with a
PropertiesConfigurer. |
EnvironmentClasspathConfigurer withClasspath() throws Exception
Applies a new DefaultEnvironmentClasspathConfigurer into current
builder. Equivalents between JavaConfig and XML are shown below.
JavaConfig:
public void configure(YarnEnvironmentBuilder environment) throws Exception {
environment
.withClasspath()
.entry("cpEntry1")
.entry("cpEntry2")
.useDefaultYarnClasspath(true);
}
<yarn:environment>
<yarn:classpath use-yarn-app-classpath="true" delimiter=":">
cpEntry1
cpEntry2
</yarn:classpath>
</yarn:environment>
DefaultEnvironmentClasspathConfigurer for classpathException - if error occurredYarnEnvironmentConfigurer entry(String key, String value)
public void configure(YarnEnvironmentConfigure environment) throws Exception {
environment
.entry("myKey1","myValue1")
.entry("myKey2","myValue2");
}
<yarn:environment> myKey1=myValue1 myKey2=myValue2 </yarn:environment>
key - The environment keyvalue - The environment valueYarnEnvironmentConfigurer for chainingYarnEnvironmentConfigurer propertiesLocation(String... locations) throws IOException
public void configure(YarnEnvironmentConfigure environment) throws Exception {
environment
.entry("myKey1","myValue1")
.entry("myKey2","myValue2")
.propertiesLocation("cfg-1.properties", "cfg-2.properties");
}
<yarn:environment properties-location="cfg-1.properties, cfg-2.properties"> myKey1=myValue1 myKey2=myValue2 </yarn:environment>
locations - The properties file locationsYarnEnvironmentConfigurer for chainingIOException - if error occurredYarnEnvironmentConfigurer includeLocalSystemEnv(boolean includeLocalSystemEnv)
public void configure(YarnEnvironmentConfigure environment) throws Exception {
environment
.includeLocalSystemEnv(false);
}
<yarn:environment include-local-system-env="false"/>
includeLocalSystemEnv - if system env variables should be includedYarnEnvironmentConfigurer for chainingorg.springframework.data.hadoop.config.common.annotation.configurers.PropertiesConfigurer<YarnEnvironmentConfigurer> withProperties() throws Exception
PropertiesConfigurer.
public void configure(YarnEnvironmentConfigure environment) throws Exception {
Properties props = new Properties();
environment
.withProperties()
.properties(props)
.property("myKey1", ",myValue1")
.and();
}
<util:properties id="props" location="props.properties"/> <prop key="myKey1">myValue1</prop> </util:properties> <yarn:environment properties-ref="props"/>
PropertiesConfigurer for chainingException - if error occurred