public interface MasterContainerAllocatorConfigurer extends AnnotationConfigurerBuilder<YarnAppmasterConfigurer>
ContainerAllocator を構成するための AnnotationConfigurerBuilder。
@Configuration
@EnableYarn(enable=Enable.APPMASTER)
static class Config extends SpringYarnConfigurerAdapter {
@Override
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator();
}
}
| 修飾子と型 | インターフェースと説明 |
|---|---|
static interface | MasterContainerAllocatorConfigurer.MasterContainerAllocatorCollectionConfigurerMasterContainerAllocatorCollectionConfigurer は、識別されたコレクションとして MasterContainerAllocatorConfigurer パラメーターを構成するために使用される DefaultMasterContainerAllocatorCollectionConfigurer のインターフェースです。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
MasterContainerAllocatorConfigurer | labelExpression(java.lang.String labelExpression)ContainerAllocator のコンテナーラベル式を指定します。 |
MasterContainerAllocatorConfigurer | locality(boolean locality)ContainerAllocator の局所緩和を指定します。 |
MasterContainerAllocatorConfigurer | memory(int memory)ContainerAllocator のコンテナーメモリを指定します。 |
MasterContainerAllocatorConfigurer | memory(java.lang.String memory)ContainerAllocator のコンテナーメモリを指定します。 |
MasterContainerAllocatorConfigurer | priority(java.lang.Integer priority)ContainerAllocator のコンテナー優先度を指定します。 |
MasterContainerAllocatorConfigurer | virtualCores(java.lang.Integer virtualCores)ContainerAllocator のコンテナー仮想コアを指定します。 |
MasterContainerAllocatorConfigurer.MasterContainerAllocatorCollectionConfigurer | withCollection(java.lang.String id) コンテナーアロケータ属性のコレクションを指定します。 |
andMasterContainerAllocatorConfigurer priority(java.lang.Integer priority)
ContainerAllocator のコンテナー優先度を指定します。
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.priority(0);
}
<yarn:master> <yarn:container-allocator priority="0"/> </yarn:master>
priority - 優先順位 MasterContainerAllocatorConfigurerMasterContainerAllocatorConfigurer labelExpression(java.lang.String labelExpression)
ContainerAllocator のコンテナーラベル式を指定します。
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.labelExpression("expression");
}
labelExpression - ラベル表現 MasterContainerAllocatorConfigurerMasterContainerAllocatorConfigurer virtualCores(java.lang.Integer virtualCores)
ContainerAllocator のコンテナー仮想コアを指定します。
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.virtualCores(1);
}
<yarn:master> <yarn:container-allocator virtualcores="1"/> </yarn:master>
virtualCores - 仮想コア MasterContainerAllocatorConfigurerMasterContainerAllocatorConfigurer memory(java.lang.String memory)
ContainerAllocator のコンテナーメモリを指定します。値が単純な数値の場合、memory 引数は MegaBytes として指定されます。1G や 500M などのショートカットを使用できます。これらはそれぞれ 1024 と 500 に変換されます。 このメソッドは #memory(int) と同等なので、引数を String として指定できます。
注意 : 1000K や 1000B などの低すぎる設定は使用しないように注意してください。これらの設定は完全な MB に切り捨てられ、ゼロになります。また、値が高すぎると、リソース割り当ての動作が悪くなる可能性があります。
JavaConfig:
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.memory("1G");
}
<yarn:master> <yarn:container-allocator memory="1024"/> </yarn:master>
memory - 想い出 MasterContainerAllocatorConfigurerMasterContainerAllocatorConfigurer memory(int memory)
ContainerAllocator のコンテナーメモリを指定します。
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.memory(1024);
}
<yarn:master> <yarn:container-allocator memory="1024"/> </yarn:master>
memory - 想い出 MasterContainerAllocatorConfigurermemory(String)MasterContainerAllocatorConfigurer locality(boolean locality)
ContainerAllocator の局所性緩和を指定します。このフラグを true に設定すると、リソースリクエストで局所性緩和が使用されなくなります。このフラグのデフォルトは false です。
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.locality(false);
}
<yarn:master> <yarn:container-allocator locality="false"/> </yarn:master>
locality - リソース緩和のための地域フラグ MasterContainerAllocatorConfigurerMasterContainerAllocatorConfigurer.MasterContainerAllocatorCollectionConfigurer withCollection(java.lang.String id)
DefaultMasterContainerAllocatorConfigurer.DefaultMasterContainerAllocatorCollectionConfigurer を現在のコンフィギュレータに適用します。
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.withCollection("id")
.priority(0);
}
id - IDMasterContainerAllocatorConfigurer.MasterContainerAllocatorCollectionConfigurer