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<Object> objectPostProcessor) |
| Modifier and Type | Method and Description |
|---|---|
YarnAppmasterBuilder |
appmasterClass(Class<? extends YarnAppmaster> clazz)
Specify a
YarnAppmaster class. |
YarnAppmasterBuilder |
appmasterClass(String clazz)
Specify a
YarnAppmaster as a fully qualified class name. |
void |
configuration(Configuration configuration) |
YarnAppmasterBuilder |
containerCommands(String... commands)
Specify a raw array of commands used to start a container.
|
protected YarnAppmaster |
performBuild() |
void |
setContainerAllocator(ContainerAllocator containerAllocator) |
void |
setEnvironment(Map<String,String> environment) |
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<Object> objectPostProcessor)
protected YarnAppmaster performBuild() throws Exception
performBuild in class org.springframework.data.hadoop.config.common.annotation.AbstractConfiguredAnnotationBuilder<YarnAppmaster,YarnAppmasterConfigurer,YarnAppmasterBuilder>Exceptionpublic MasterContainerRunnerConfigurer withContainerRunner() throws 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 chainingException - exceptionpublic MasterContainerAllocatorConfigurer withContainerAllocator() throws 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 chainingException - exceptionpublic void configuration(Configuration configuration)
public void setResourceLocalizer(ResourceLocalizer resourceLocalizer)
public void setContainerAllocator(ContainerAllocator containerAllocator)
public YarnAppmasterBuilder appmasterClass(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(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(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 chaining