|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface YarnEnvironmentConfigurer
Interface for 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); } }
Method Summary | |
---|---|
YarnEnvironmentConfigurer |
entry(java.lang.String key,
java.lang.String value)
Specify an environment variable. |
YarnEnvironmentConfigurer |
includeLocalSystemEnv(boolean includeLocalSystemEnv)
Specify if existing system environment variables should be included automatically. |
YarnEnvironmentConfigurer |
propertiesLocation(java.lang.String... locations)
Specify properties locations. |
EnvironmentClasspathConfigurer |
withClasspath()
Specify a classpath environment variable. |
PropertiesConfigurer<YarnEnvironmentConfigurer> |
withProperties()
Specify properties with a PropertiesConfigurer . |
Method Detail |
---|
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); }
XML:
<yarn:environment> <yarn:classpath use-default-yarn-classpath="true" delimiter=":"> cpEntry1 cpEntry2 </yarn:classpath> </yarn:environment>
DefaultEnvironmentClasspathConfigurer
for classpath
java.lang.Exception
- if error occurredYarnEnvironmentConfigurer entry(java.lang.String key, java.lang.String value)
JavaConfig:
public void configure(YarnEnvironmentConfigure environment) throws Exception { environment .entry("myKey1","myValue1") .entry("myKey2","myValue2"); }
XML:
<yarn:environment> myKey1=myValue1 myKey2=myValue2 </yarn:environment>
key
- The environment keyvalue
- The environment value
YarnEnvironmentConfigurer
for chainingYarnEnvironmentConfigurer propertiesLocation(java.lang.String... locations) throws java.io.IOException
JavaConfig:
public void configure(YarnEnvironmentConfigure environment) throws Exception { environment .entry("myKey1","myValue1") .entry("myKey2","myValue2") .propertiesLocation("cfg-1.properties", "cfg-2.properties"); }
XML:
<yarn:environment properties-location="cfg-1.properties, cfg-2.properties"> myKey1=myValue1 myKey2=myValue2 </yarn:environment>
locations
- The properties file locations
YarnEnvironmentConfigurer
for chaining
java.io.IOException
- if error occurredYarnEnvironmentConfigurer includeLocalSystemEnv(boolean includeLocalSystemEnv)
JavaConfig:
public void configure(YarnEnvironmentConfigure environment) throws Exception { environment .includeLocalSystemEnv(false); }
XML:
<yarn:environment include-local-system-env="false"/>
includeLocalSystemEnv
- if system env variables should be included
YarnEnvironmentConfigurer
for chainingPropertiesConfigurer<YarnEnvironmentConfigurer> withProperties() throws java.lang.Exception
PropertiesConfigurer
.
JavaConfig:
public void configure(YarnEnvironmentConfigure environment) throws Exception { Properties props = new Properties(); environment .withProperties() .properties(props) .property("myKey1", ",myValue1") .and(); }
XML:
<util:properties id="props" location="props.properties"/>myValue1 </util:properties> <yarn:environment properties-ref="props"/>
PropertiesConfigurer
for chaining
java.lang.Exception
- if error occurred
|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |