public class DefaultMasterContainerAllocatorConfigurer extends AnnotationConfigurerAdapter<YarnAppmaster,YarnAppmasterConfigurer,YarnAppmasterBuilder> implements MasterContainerAllocatorConfigurer
YarnAppmaster コンテナーアロケータの場合は AnnotationConfigurer。| 修飾子と型 | クラスと説明 |
|---|---|
class | DefaultMasterContainerAllocatorConfigurer.DefaultMasterContainerAllocatorCollectionConfigurer |
MasterContainerAllocatorConfigurer.MasterContainerAllocatorCollectionConfigurer| コンストラクターと説明 |
|---|
DefaultMasterContainerAllocatorConfigurer() |
| 修飾子と型 | メソッドと説明 |
|---|---|
void | configure(YarnAppmasterBuilder builder)AnnotationBuilder に必要なプロパティを設定して、AnnotationBuilder を構成します。 |
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) コンテナーアロケータ属性のコレクションを指定します。 |
addObjectPostProcessor, and, getBuilder, init, isAssignable, setBuilderclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitandpublic DefaultMasterContainerAllocatorConfigurer()
public void configure(YarnAppmasterBuilder builder) throws java.lang.Exception
AnnotationConfigurerAnnotationBuilder に必要なプロパティを設定して、AnnotationBuilder を構成します。AnnotationConfigurer<YarnAppmaster, YarnAppmasterBuilder> 内の configure AnnotationConfigurerAdapter<YarnAppmaster, YarnAppmasterConfigurer, YarnAppmasterBuilder> の configure builder - ビルダー java.lang.Exception - エラーが発生した場合 public MasterContainerAllocatorConfigurer priority(java.lang.Integer priority)
MasterContainerAllocatorConfigurerContainerAllocator のコンテナー優先度を指定します。
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.priority(0);
}
<yarn:master> <yarn:container-allocator priority="0"/> </yarn:master>
MasterContainerAllocatorConfigurer 内の priority priority - 優先順位 MasterContainerAllocatorConfigurerpublic MasterContainerAllocatorConfigurer labelExpression(java.lang.String labelExpression)
MasterContainerAllocatorConfigurerContainerAllocator のコンテナーラベル式を指定します。
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.labelExpression("expression");
}
MasterContainerAllocatorConfigurer 内の labelExpression labelExpression - ラベル表現 MasterContainerAllocatorConfigurerpublic MasterContainerAllocatorConfigurer virtualCores(java.lang.Integer virtualCores)
MasterContainerAllocatorConfigurerContainerAllocator のコンテナー仮想コアを指定します。
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.virtualCores(1);
}
<yarn:master> <yarn:container-allocator virtualcores="1"/> </yarn:master>
MasterContainerAllocatorConfigurer 内の virtualCores virtualCores - 仮想コア MasterContainerAllocatorConfigurerpublic MasterContainerAllocatorConfigurer memory(java.lang.String memory)
MasterContainerAllocatorConfigurerContainerAllocator のコンテナーメモリを指定します。値が単純な数値の場合、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>
MasterContainerAllocatorConfigurer 内の memory memory - 想い出 MasterContainerAllocatorConfigurerpublic 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>
MasterContainerAllocatorConfigurer 内の memory memory - 想い出 MasterContainerAllocatorConfigurerMasterContainerAllocatorConfigurer.memory(String)public MasterContainerAllocatorConfigurer locality(boolean locality)
MasterContainerAllocatorConfigurerContainerAllocator の局所性緩和を指定します。このフラグを true に設定すると、リソースリクエストで局所性緩和が使用されなくなります。このフラグのデフォルトは false です。
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.locality(false);
}
<yarn:master> <yarn:container-allocator locality="false"/> </yarn:master>
MasterContainerAllocatorConfigurer 内の locality locality - リソース緩和のための地域フラグ MasterContainerAllocatorConfigurerpublic MasterContainerAllocatorConfigurer.MasterContainerAllocatorCollectionConfigurer withCollection(java.lang.String id)
MasterContainerAllocatorConfigurerDefaultMasterContainerAllocatorConfigurer.DefaultMasterContainerAllocatorCollectionConfigurer を現在のコンフィギュレータに適用します。
public void configure(YarnAppmasterConfigure master) throws Exception {
master
.withContainerAllocator()
.withCollection("id")
.priority(0);
}
MasterContainerAllocatorConfigurer 内の withCollection id - IDMasterContainerAllocatorConfigurer.MasterContainerAllocatorCollectionConfigurer