|
Spring for Apache Hadoop | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface MasterContainerAllocatorConfigurer
AnnotationConfigurerBuilder for configuring ContainerAllocator.
Typically configuration is shown below.
@Configuration
@EnableYarn(enable=Enable.APPMASTER)
static class Config extends SpringYarnConfigurerAdapter {
@Override
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator();
}
}
| Method Summary | |
|---|---|
MasterContainerAllocatorConfigurer |
memory(int memory)
Specify a container memory for ContainerAllocator. |
MasterContainerAllocatorConfigurer |
memory(java.lang.String memory)
Specify a container memory for ContainerAllocator. |
MasterContainerAllocatorConfigurer |
priority(java.lang.Integer priority)
Specify a container priority for ContainerAllocator. |
MasterContainerAllocatorConfigurer |
virtualCores(java.lang.Integer virtualCores)
Specify a container virtual cores for ContainerAllocator. |
| Methods inherited from interface org.springframework.data.hadoop.config.common.annotation.AnnotationConfigurerBuilder |
|---|
and |
| Method Detail |
|---|
MasterContainerAllocatorConfigurer priority(java.lang.Integer priority)
ContainerAllocator.
JavaConfig:
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.priority(0);
}
XML:
<yarn:master> <yarn:container-allocator priority="0"/> </yarn:master>
priority - the priority
MasterContainerAllocatorConfigurer for chainingMasterContainerAllocatorConfigurer virtualCores(java.lang.Integer virtualCores)
ContainerAllocator.
JavaConfig:
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.virtualCores(1);
}
XML:
<yarn:master> <yarn:container-allocator virtualcores="1"/> </yarn:master>
virtualCores - the virtual cores
MasterContainerAllocatorConfigurer for chainingMasterContainerAllocatorConfigurer memory(java.lang.String memory)
ContainerAllocator.
The memory argument is given as MegaBytes if
value is a plain number. Shortcuts like 1G and
500M can be used which translates to 1024
and 500 respectively.
This method is equivalent to #memory(int) so that
argument can be given as a String.
NOTE: be careful not to use a too low settings like
1000K or 1000B because those are rounded
down to full MBs and thus becomes a zero. Also too
high values may make resource allocation to behave badly.
JavaConfig:
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.memory("1G");
}
XML:
<yarn:master> <yarn:container-allocator memory="1024"/> </yarn:master>
memory - the memory
MasterContainerAllocatorConfigurer for chainingMasterContainerAllocatorConfigurer memory(int memory)
ContainerAllocator.
JavaConfig:
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.memory(1024);
}
XML:
<yarn:master> <yarn:container-allocator memory="1024"/> </yarn:master>
memory - the memory
MasterContainerAllocatorConfigurer for chainingmemory(String)
|
Spring for Apache Hadoop | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||