public final class YarnAppmasterBuilder extends org.springframework.data.hadoop.config.common.annotation.AbstractConfiguredAnnotationBuilder<YarnAppmaster,YarnAppmasterConfigurer,YarnAppmasterBuilder> implements YarnAppmasterConfigurer
| Constructor and Description |
|---|
YarnAppmasterBuilder() |
YarnAppmasterBuilder(org.springframework.data.hadoop.config.common.annotation.ObjectPostProcessor<java.lang.Object> objectPostProcessor) |
| Modifier and Type | Method and Description |
|---|---|
YarnAppmasterBuilder |
appmasterClass(java.lang.Class<? extends YarnAppmaster> clazz)
Specify a
YarnAppmaster class. |
YarnAppmasterBuilder |
appmasterClass(java.lang.String clazz)
Specify a
YarnAppmaster as a fully qualified class name. |
void |
configuration(Configuration configuration) |
YarnAppmasterBuilder |
containerCommands(java.lang.String[] commands)
Specify a raw array of commands used to start a container.
|
YarnAppmasterBuilder |
containerCommands(java.lang.String id,
java.lang.String[] commands)
Specify a raw array of commands used to start a container.
|
protected YarnAppmaster |
performBuild() |
void |
setContainerAllocator(ContainerAllocator containerAllocator) |
void |
setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment) |
void |
setEnvironments(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> environments) |
void |
setResourceLocalizer(ResourceLocalizer resourceLocalizer) |
MasterContainerAllocatorConfigurer |
withContainerAllocator()
Specify a container allocator for Appmaster.
|
MasterContainerRunnerConfigurer |
withContainerRunner()
Specify a container runner for Appmaster.
|
apply, apply, beforeConfigureMains, beforeConfigurePosts, beforeInit, doBuild, getConfigurer, getConfigurers, getOrApply, getOrBuild, getSharedObject, getSharedObjects, objectPostProcessor, postProcess, removeConfigurer, removeConfigurers, setSharedObjectpublic YarnAppmasterBuilder()
public YarnAppmasterBuilder(org.springframework.data.hadoop.config.common.annotation.ObjectPostProcessor<java.lang.Object> objectPostProcessor)
protected YarnAppmaster performBuild() throws java.lang.Exception
performBuild in class org.springframework.data.hadoop.config.common.annotation.AbstractConfiguredAnnotationBuilder<YarnAppmaster,YarnAppmasterConfigurer,YarnAppmasterBuilder>java.lang.Exceptionpublic MasterContainerRunnerConfigurer withContainerRunner() throws java.lang.Exception
YarnAppmasterConfigurerDefaultMasterContainerRunnerConfigurer into a current builder.
public void configure(YarnAppmasterConfigure master) throws Exception {
Properties properties = new Properties();
properties.setProperty("foo1", "bar1");
master
.withContainerRunner()
.arguments(properties)
.argument("foo2", "bar2");
}
<util:properties id="arguments"> <prop key="foo1">bar1</prop> <prop key="foo2">bar2</prop> </util:properties> <yarn:master> <yarn:container-runner arguments="arguments"/> </yarn:master>
withContainerRunner in interface YarnAppmasterConfigurerMasterContainerRunnerConfigurer for chainingjava.lang.Exception - exceptionpublic MasterContainerAllocatorConfigurer withContainerAllocator() throws java.lang.Exception
YarnAppmasterConfigurerDefaultMasterContainerAllocatorConfigurer into a current builder.
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.priority(0)
.virtualCores(1)
.memory(1024);
}
<yarn:master> <yarn:container-allocator priority="0" virtualcores="1" memory="1024"/> </yarn:master>
withContainerAllocator in interface YarnAppmasterConfigurerMasterContainerAllocatorConfigurer for chainingjava.lang.Exception - exceptionpublic void configuration(Configuration configuration)
public void setResourceLocalizer(ResourceLocalizer resourceLocalizer)
public void setContainerAllocator(ContainerAllocator containerAllocator)
public void setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
public void setEnvironments(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> environments)
public YarnAppmasterBuilder appmasterClass(java.lang.Class<? extends YarnAppmaster> clazz)
YarnAppmasterConfigurerYarnAppmaster class.
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.appmasterClass(MyYarnAppmaster.class);
}
<yarn:master appmaster-class="com.example.MyYarnAppmaster"/>
appmasterClass in interface YarnAppmasterConfigurerclazz - The Yarn appmaster classYarnAppmasterConfigurer for chainingpublic YarnAppmasterBuilder appmasterClass(java.lang.String clazz)
YarnAppmasterConfigurerYarnAppmaster as a fully qualified class name.
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.appmasterClass(MyYarnAppmaster.class);
}
appmasterClass in interface YarnAppmasterConfigurerclazz - The Yarn appmaster classYarnAppmasterConfigurer for chainingpublic YarnAppmasterBuilder containerCommands(java.lang.String[] commands)
YarnAppmasterConfigurer
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.containerCommands("date", "1><LOG_DIR>/Container.stdout", "2><LOG_DIR>/Container.stderr");
}
<yarn:master>
<yarn:container-command>
<![CDATA[
date
1><LOG_DIR>/Container.stdout
2><LOG_DIR>/Container.stderr
]]>
</yarn:container-command>
</yarn:master>
containerCommands in interface YarnAppmasterConfigurercommands - The Yarn container commandsYarnAppmasterConfigurer for chainingpublic YarnAppmasterBuilder containerCommands(java.lang.String id, java.lang.String[] commands)
YarnAppmasterConfigurercontainerCommands in interface YarnAppmasterConfigurerid - the commands identifiercommands - The Yarn container commandsYarnAppmasterConfigurer for chainingYarnAppmasterConfigurer.containerCommands(String[])