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(java.lang.String key,
java.lang.String value)
Specify an environment variable.
|
YarnEnvironmentConfigurer |
entry(java.lang.String id,
java.lang.String key,
java.lang.String value)
Specify an environment variable using an identifier.
|
YarnEnvironmentConfigurer |
includeLocalSystemEnv(boolean includeLocalSystemEnv)
Specify if existing system environment variables should
be included automatically.
|
YarnEnvironmentConfigurer |
includeLocalSystemEnv(java.lang.String id,
boolean includeLocalSystemEnv)
Specify if existing system environment variables should
be included automatically with an identifier.
|
YarnEnvironmentConfigurer |
propertiesLocation(java.lang.String... locations)
Specify properties locations.
|
YarnEnvironmentConfigurer |
propertiesLocationId(java.lang.String id,
java.lang.String[] locations)
Specify properties locations with an identifier.
|
EnvironmentClasspathConfigurer |
withClasspath()
Specify a classpath environment variable.
|
EnvironmentClasspathConfigurer |
withClasspath(java.lang.String id)
Specify a classpath environment variable using an identifier.
|
PropertiesConfigurer<YarnEnvironmentConfigurer> |
withProperties()
Specify properties with a
PropertiesConfigurer . |
PropertiesConfigurer<YarnEnvironmentConfigurer> |
withProperties(java.lang.String id)
Specify properties with a
PropertiesConfigurer
with an identifier. |
EnvironmentClasspathConfigurer withClasspath() throws java.lang.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>
EnvironmentClasspathConfigurer
for classpathjava.lang.Exception
- if error occurredEnvironmentClasspathConfigurer withClasspath(java.lang.String id) throws java.lang.Exception
id
- the identifierEnvironmentClasspathConfigurer
for classpathjava.lang.Exception
- if error occurredwithClasspath()
YarnEnvironmentConfigurer entry(java.lang.String key, java.lang.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 entry(java.lang.String id, java.lang.String key, java.lang.String value)
id
- the identifierkey
- The environment keyvalue
- The environment valueYarnEnvironmentConfigurer
for chainingentry(String, String)
YarnEnvironmentConfigurer propertiesLocation(java.lang.String... locations) throws java.io.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 chainingjava.io.IOException
- if error occurredYarnEnvironmentConfigurer propertiesLocationId(java.lang.String id, java.lang.String[] locations) throws java.io.IOException
id
- the identifierlocations
- the properties file locationsYarnEnvironmentConfigurer
for chainingjava.io.IOException
- if error occurredpropertiesLocation(String...)
YarnEnvironmentConfigurer 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 chainingYarnEnvironmentConfigurer includeLocalSystemEnv(java.lang.String id, boolean includeLocalSystemEnv)
id
- the identifierincludeLocalSystemEnv
- if system env variables should be includedYarnEnvironmentConfigurer
for chainingincludeLocalSystemEnv(boolean)
PropertiesConfigurer<YarnEnvironmentConfigurer> withProperties() throws java.lang.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 chainingjava.lang.Exception
- if error occurredPropertiesConfigurer<YarnEnvironmentConfigurer> withProperties(java.lang.String id) throws java.lang.Exception
PropertiesConfigurer
with an identifier.id
- the identifierPropertiesConfigurer
for chainingjava.lang.Exception
- if error occurredwithProperties()