public interface YarnAppmasterConfigurer
YarnAppmasterConfigure is an interface for YarnAppmasterBuilder which is
exposed to user via SpringYarnConfigurerAdapter.
Typically configuration is shown below.
@Configuration
@EnableYarn(enable=Enable.APPMASTER)
static class Config extends SpringYarnConfigurerAdapter {
@Override
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.appmasterClass(MyAppmaster.class)
.withContainerRunner();
}
}
| Modifier and Type | Method and Description |
|---|---|
YarnAppmasterConfigurer |
appmasterClass(Class<? extends YarnAppmaster> clazz)
Specify a
YarnAppmaster class. |
YarnAppmasterConfigurer |
appmasterClass(String clazz)
Specify a
YarnAppmaster as a fully qualified class name. |
YarnAppmasterConfigurer |
containerCommands(String[] commands)
Specify a raw array of commands used to start a container.
|
YarnAppmasterConfigurer |
containerCommands(String id,
String[] commands)
Specify a raw array of commands used to start a container.
|
MasterContainerAllocatorConfigurer |
withContainerAllocator()
Specify a container allocator for Appmaster.
|
MasterContainerRunnerConfigurer |
withContainerRunner()
Specify a container runner for Appmaster.
|
MasterContainerRunnerConfigurer withContainerRunner() throws Exception
DefaultMasterContainerRunnerConfigurer 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>
MasterContainerRunnerConfigurer for chainingException - exceptionMasterContainerAllocatorConfigurer withContainerAllocator() throws Exception
DefaultMasterContainerAllocatorConfigurer 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>
MasterContainerAllocatorConfigurer for chainingException - exceptionYarnAppmasterConfigurer containerCommands(String[] commands)
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>
commands - The Yarn container commandsYarnAppmasterConfigurer for chainingYarnAppmasterConfigurer containerCommands(String id, String[] commands)
id - the commands identifiercommands - The Yarn container commandsYarnAppmasterConfigurer for chainingcontainerCommands(String[])YarnAppmasterConfigurer appmasterClass(Class<? extends YarnAppmaster> clazz)
YarnAppmaster class.
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.appmasterClass(MyYarnAppmaster.class);
}
<yarn:master appmaster-class="com.example.MyYarnAppmaster"/>
clazz - The Yarn appmaster classYarnAppmasterConfigurer for chainingYarnAppmasterConfigurer appmasterClass(String clazz)
YarnAppmaster as a fully qualified class name.
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.appmasterClass(MyYarnAppmaster.class);
}
clazz - The Yarn appmaster classYarnAppmasterConfigurer for chaining