|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.data.hadoop.config.common.annotation.AnnotationConfigurerAdapter<YarnAppmaster,YarnAppmasterConfigurer,YarnAppmasterBuilder>
org.springframework.yarn.config.annotation.configurers.DefaultMasterContainerAllocatorConfigurer
public class DefaultMasterContainerAllocatorConfigurer
| Constructor Summary | |
|---|---|
DefaultMasterContainerAllocatorConfigurer()
|
|
| Method Summary | |
|---|---|
void |
configure(YarnAppmasterBuilder builder)
|
MasterContainerAllocatorConfigurer |
locality(boolean locality)
Specify a locality relaxing for ContainerAllocator. |
MasterContainerAllocatorConfigurer |
memory(int memory)
Specify a container memory for ContainerAllocator. |
MasterContainerAllocatorConfigurer |
memory(String memory)
Specify a container memory for ContainerAllocator. |
MasterContainerAllocatorConfigurer |
priority(Integer priority)
Specify a container priority for ContainerAllocator. |
MasterContainerAllocatorConfigurer |
virtualCores(Integer virtualCores)
Specify a container virtual cores for ContainerAllocator. |
| Methods inherited from class org.springframework.data.hadoop.config.common.annotation.AnnotationConfigurerAdapter |
|---|
addObjectPostProcessor, and, getBuilder, init, isAssignable, setBuilder |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.springframework.data.hadoop.config.common.annotation.AnnotationConfigurerBuilder |
|---|
and |
| Constructor Detail |
|---|
public DefaultMasterContainerAllocatorConfigurer()
| Method Detail |
|---|
public void configure(YarnAppmasterBuilder builder)
throws Exception
configure in interface org.springframework.data.hadoop.config.common.annotation.AnnotationConfigurer<YarnAppmaster,YarnAppmasterBuilder>configure in class org.springframework.data.hadoop.config.common.annotation.AnnotationConfigurerAdapter<YarnAppmaster,YarnAppmasterConfigurer,YarnAppmasterBuilder>Exceptionpublic MasterContainerAllocatorConfigurer priority(Integer priority)
MasterContainerAllocatorConfigurerContainerAllocator.
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.priority(0);
}
<yarn:master> <yarn:container-allocator priority="0"/> </yarn:master>
priority in interface MasterContainerAllocatorConfigurerpriority - the priority
MasterContainerAllocatorConfigurer for chainingpublic MasterContainerAllocatorConfigurer virtualCores(Integer virtualCores)
MasterContainerAllocatorConfigurerContainerAllocator.
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.virtualCores(1);
}
<yarn:master> <yarn:container-allocator virtualcores="1"/> </yarn:master>
virtualCores in interface MasterContainerAllocatorConfigurervirtualCores - the virtual cores
MasterContainerAllocatorConfigurer for chainingpublic MasterContainerAllocatorConfigurer memory(String memory)
MasterContainerAllocatorConfigurerContainerAllocator.
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");
}
<yarn:master> <yarn:container-allocator memory="1024"/> </yarn:master>
memory in interface MasterContainerAllocatorConfigurermemory - the memory
MasterContainerAllocatorConfigurer for chainingpublic MasterContainerAllocatorConfigurer memory(int memory)
MasterContainerAllocatorConfigurerContainerAllocator.
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.memory(1024);
}
<yarn:master> <yarn:container-allocator memory="1024"/> </yarn:master>
memory in interface MasterContainerAllocatorConfigurermemory - the memory
MasterContainerAllocatorConfigurer for chainingMasterContainerAllocatorConfigurer.memory(String)public MasterContainerAllocatorConfigurer locality(boolean locality)
MasterContainerAllocatorConfigurerContainerAllocator. Setting
this flag true means that resource requests will
not use locality relaxing. Default for this flag is false.
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.locality(false);
}
<yarn:master> <yarn:container-allocator locality="false"/> </yarn:master>
locality in interface MasterContainerAllocatorConfigurerlocality - the locality flag for resource relaxing
MasterContainerAllocatorConfigurer for chaining
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||