|
Spring for Apache Hadoop | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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();
}
}
| Method Summary | |
|---|---|
YarnAppmasterConfigurer |
appmasterClass(java.lang.Class<? extends YarnAppmaster> clazz)
Specify a YarnAppmaster class. |
YarnAppmasterConfigurer |
appmasterClass(java.lang.String clazz)
Specify a YarnAppmaster as a fully qualified class name. |
YarnAppmasterConfigurer |
containerCommands(java.lang.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. |
| Method Detail |
|---|
MasterContainerRunnerConfigurer withContainerRunner()
throws java.lang.Exception
DefaultMasterContainerRunnerConfigurer into a current builder.
JavaConfig:
public void configure(YarnAppmasterConfigure master) throws Exception {
Properties properties = new Properties();
properties.setProperty("foo1", "bar1");
master
.withContainerRunner()
.arguments(properties)
.argument("foo2", "bar2");
}
XML:
<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 chaining
java.lang.Exception
MasterContainerAllocatorConfigurer withContainerAllocator()
throws java.lang.Exception
DefaultMasterContainerAllocatorConfigurer into a current builder.
JavaConfig:
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.priority(0)
.virtualCores(1)
.memory(1024);
}
XML:
<yarn:master> <yarn:container-allocator priority="0" virtualcores="1" memory="1024"/> </yarn:master>
MasterContainerAllocatorConfigurer for chaining
java.lang.ExceptionYarnAppmasterConfigurer containerCommands(java.lang.String... commands)
JavaConfig:
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.containerCommands("date", "1>/Container.stdout", "2>/Container.stderr");
}
XML:
<yarn:master>
<yarn:container-command>
<![CDATA[
date
1>/Container.stdout
2>/Container.stderr
]]>
</yarn:container-command>
</yarn:master>
commands - The Yarn container commands
YarnAppmasterConfigurer for chainingYarnAppmasterConfigurer appmasterClass(java.lang.Class<? extends YarnAppmaster> clazz)
YarnAppmaster class.
JavaConfig:
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.appmasterClass(MyYarnAppmaster.class);
}
XML:
<yarn:master appmaster-class="com.example.MyYarnAppmaster"/>
clazz - The Yarn appmaster class
YarnAppmasterConfigurer for chainingYarnAppmasterConfigurer appmasterClass(java.lang.String clazz)
YarnAppmaster as a fully qualified class name.
JavaConfig:
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.appmasterClass(MyYarnAppmaster.class);
}
XML:
No equivalent
clazz - The Yarn appmaster class
YarnAppmasterConfigurer for chaining
|
Spring for Apache Hadoop | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||