|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.data.hadoop.config.common.annotation.AbstractAnnotationBuilder<O>
org.springframework.data.hadoop.config.common.annotation.AbstractConfiguredAnnotationBuilder<Map<String,String>,YarnEnvironmentConfigurer,YarnEnvironmentBuilder>
org.springframework.yarn.config.annotation.builders.YarnEnvironmentBuilder
public final class YarnEnvironmentBuilder
AnnotationBuilder for Yarn environment.
| Constructor Summary | |
|---|---|
YarnEnvironmentBuilder()
Instantiates a new yarn environment builder. |
|
| Method Summary | |
|---|---|
void |
addClasspathEntries(ArrayList<String> classpathEntries)
Adds the classpath entries. |
void |
configuration(Configuration configuration)
Sets the yarn configuration. |
void |
configureProperties(Properties properties)
|
YarnEnvironmentConfigurer |
entry(String key,
String value)
Specify an environment variable. |
YarnEnvironmentConfigurer |
includeLocalSystemEnv(boolean includeLocalSystemEnv)
Specify if existing system environment variables should be included automatically. |
protected Map<String,String> |
performBuild()
|
YarnEnvironmentConfigurer |
propertiesLocation(String... locations)
Specify properties locations. |
void |
setDefaultYarnAppClasspath(String defaultYarnAppClasspath)
Sets the default yarn app classpath. |
void |
setDelimiter(String delimiter)
Sets the delimiter. |
void |
setIncludeBaseDirectory(boolean includeBaseDirectory)
Sets the include base directory. |
void |
setUseDefaultYarnClasspath(boolean useDefaultClasspath)
Sets the default classpath. |
EnvironmentClasspathConfigurer |
withClasspath()
Specify a classpath environment variable. |
org.springframework.data.hadoop.config.common.annotation.configurers.PropertiesConfigurer<YarnEnvironmentConfigurer> |
withProperties()
Specify properties with a PropertiesConfigurer. |
| Methods inherited from class org.springframework.data.hadoop.config.common.annotation.AbstractConfiguredAnnotationBuilder |
|---|
apply, apply, beforeConfigureMains, beforeConfigurePosts, beforeInit, doBuild, getConfigurer, getConfigurers, getOrApply, getOrBuild, getSharedObject, getSharedObjects, objectPostProcessor, postProcess, removeConfigurer, removeConfigurers, setSharedObject |
| Methods inherited from class org.springframework.data.hadoop.config.common.annotation.AbstractAnnotationBuilder |
|---|
build, getObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public YarnEnvironmentBuilder()
| Method Detail |
|---|
protected Map<String,String> performBuild()
throws Exception
performBuild in class org.springframework.data.hadoop.config.common.annotation.AbstractConfiguredAnnotationBuilder<Map<String,String>,YarnEnvironmentConfigurer,YarnEnvironmentBuilder>Exceptionpublic void configureProperties(Properties properties)
configureProperties in interface org.springframework.data.hadoop.config.common.annotation.configurers.PropertiesConfigurerAware
public EnvironmentClasspathConfigurer withClasspath()
throws Exception
YarnEnvironmentConfigurer
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-default-yarn-classpath="true" delimiter=":">
cpEntry1
cpEntry2
</yarn:classpath>
</yarn:environment>
withClasspath in interface YarnEnvironmentConfigurerDefaultEnvironmentClasspathConfigurer for classpath
Exception - if error occurred
public YarnEnvironmentConfigurer entry(String key,
String value)
YarnEnvironmentConfigurer
public void configure(YarnEnvironmentConfigure environment) throws Exception {
environment
.entry("myKey1","myValue1")
.entry("myKey2","myValue2");
}
<yarn:environment> myKey1=myValue1 myKey2=myValue2 </yarn:environment>
entry in interface YarnEnvironmentConfigurerkey - The environment keyvalue - The environment value
YarnEnvironmentConfigurer for chaining
public YarnEnvironmentConfigurer propertiesLocation(String... locations)
throws IOException
YarnEnvironmentConfigurer
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>
propertiesLocation in interface YarnEnvironmentConfigurerlocations - The properties file locations
YarnEnvironmentConfigurer for chaining
IOException - if error occurredpublic YarnEnvironmentConfigurer includeLocalSystemEnv(boolean includeLocalSystemEnv)
YarnEnvironmentConfigurer
public void configure(YarnEnvironmentConfigure environment) throws Exception {
environment
.includeLocalSystemEnv(false);
}
<yarn:environment include-local-system-env="false"/>
includeLocalSystemEnv in interface YarnEnvironmentConfigurerincludeLocalSystemEnv - if system env variables should be included
YarnEnvironmentConfigurer for chaining
public org.springframework.data.hadoop.config.common.annotation.configurers.PropertiesConfigurer<YarnEnvironmentConfigurer> withProperties()
throws Exception
YarnEnvironmentConfigurerPropertiesConfigurer.
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"/>
withProperties in interface YarnEnvironmentConfigurerPropertiesConfigurer for chaining
Exception - if error occurredpublic void addClasspathEntries(ArrayList<String> classpathEntries)
classpathEntries - the classpath entriespublic void configuration(Configuration configuration)
configuration - the yarn configurationpublic void setUseDefaultYarnClasspath(boolean useDefaultClasspath)
useDefaultClasspath - the new default classpathpublic void setIncludeBaseDirectory(boolean includeBaseDirectory)
includeBaseDirectory - the new include base directorypublic void setDelimiter(String delimiter)
delimiter - the new delimiterpublic void setDefaultYarnAppClasspath(String defaultYarnAppClasspath)
defaultYarnAppClasspath - the new default yarn app classpath
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||