public class YarnClientBuilder extends AbstractConfiguredAnnotationBuilder<YarnClient,YarnClientConfigurer,YarnClientBuilder> implements YarnClientConfigurer
YarnClient の場合は AnnotationBuilder。| コンストラクターと説明 |
|---|
YarnClientBuilder() 新しい yarn クライアントビルダーをインスタンス化します。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
YarnClientConfigurer | appName(java.lang.String appName)yarn アプリケーション名を指定します。 |
YarnClientConfigurer | appType(java.lang.String appType) 糸の適用型を指定します。 |
YarnClientConfigurer | clientClass(java.lang.Class<? extends YarnClient> clazz)YarnClient クラスを指定します。 |
YarnClientConfigurer | clientClass(java.lang.String clazz) 完全修飾クラス名として YarnClient を指定します。 |
void | configuration(org.apache.hadoop.conf.Configuration configuration) |
YarnClientConfigurer | labelExpression(java.lang.String labelExpression)yarn アプリケーションの送信ラベル式を指定します。 |
YarnClientConfigurer | masterCommands(java.lang.String... commands) アプリケーションマスターを起動するために使用されるコマンドの生の配列を指定します。 |
YarnClientConfigurer | memory(int memory)Yarn アプリケーションコンテナーのメモリ予約を指定します。 |
YarnClientConfigurer | memory(java.lang.String memory)Yarn アプリケーションコンテナーのメモリ予約を指定します。 |
protected YarnClient | performBuild() サブクラスはこのメソッドを実装して、返されるオブジェクトを構築する必要があります。 |
YarnClientConfigurer | priority(java.lang.Integer priority) 糸の適用優先度を指定します。 |
YarnClientConfigurer | queue(java.lang.String queue)yarn アプリケーションの送信キューを指定します。 |
void | setCommands(java.lang.String... commands) |
void | setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment) |
void | setResourceLocalizer(ResourceLocalizer resourceLocalizer) |
YarnClientConfigurer | virtualCores(java.lang.Integer virtualCores)Yarn アプリケーションの仮想コアリソース数を指定します。 |
DefaultClientMasterRunnerConfigurer | withMasterRunner()YarnAppmaster を起動するためのコマンドを追加します。 |
apply, apply, beforeConfigureMains, beforeConfigurePosts, beforeInit, doBuild, getConfigurer, getConfigurers, getOrApply, getOrBuild, getSharedObject, getSharedObjects, objectPostProcessor, postProcess, removeConfigurer, removeConfigurers, setSharedObjectbuild, getObjectprotected YarnClient performBuild() throws java.lang.Exception
AbstractConfiguredAnnotationBuilderAbstractConfiguredAnnotationBuilder<YarnClient, YarnClientConfigurer, YarnClientBuilder> の performBuild java.lang.Exception - エラー時 public DefaultClientMasterRunnerConfigurer withMasterRunner() throws java.lang.Exception
YarnAppmaster を起動するためのコマンドを追加します。YarnClientConfigurer 内の withMasterRunner java.lang.Exception - 例外 public YarnClientConfigurer appName(java.lang.String appName)
YarnClientConfigurer
public void configure(YarnClientConfigure client) throws Exception {
client
.appName("myAppName");
}
<yarn:client app-name="myAppName"/>
YarnClientConfigurer 内の appName appName - Yarn アプリケーション名 YarnClientConfigurerpublic YarnClientConfigurer appType(java.lang.String appType)
YarnClientConfigurerMAPREDUCE を使用しており、他のアプリケーションはデフォルトで YARN になります。
public void configure(YarnClientConfigure client) throws Exception {
client
.appType("BOOT");
}
YarnClientConfigurer 内の appType appType - Yarn アプリケーション型 YarnClientConfigurerpublic YarnClientConfigurer masterCommands(java.lang.String... commands)
YarnClientConfigurer
public void configure(YarnClientConfigure client) throws Exception {
client
.masterCommands("java -jar MyApp.jar", "1><LOG_DIR>/Appmaster.stdout", "2><LOG_DIR>/Appmaster.stderr");
}
<yarn:client>
<yarn:master-command>
<![CDATA[
java -jar MyApp.jar
1><LOG_DIR>/Appmaster.stdout
2><LOG_DIR>/Appmaster.stderr
]]>
</yarn:master-command>
</yarn:client>
YarnClientConfigurer 内の masterCommands commands - Yarn コンテナーコマンド YarnAppmasterConfigurerpublic YarnClientConfigurer priority(java.lang.Integer priority)
YarnClientConfigurer
public void configure(YarnClientConfigure client) throws Exception {
client
.priority(0);
}
<yarn:client priority="0"/>
YarnClientConfigurer 内の priority priority - Yarn の申請優先順位 YarnClientConfigurerpublic YarnClientConfigurer queue(java.lang.String queue)
YarnClientConfigurer
public void configure(YarnClientConfigure client) throws Exception {
client
.queue("default");
}
<yarn:client queue="default"/>
YarnClientConfigurer 内の queue queue - Yarn アプリケーション提出キュー YarnClientConfigurerpublic YarnClientConfigurer labelExpression(java.lang.String labelExpression)
YarnClientConfigurer
public void configure(YarnClientConfigure client) throws Exception {
client
.labelExpression("expression");
}
YarnClientConfigurer 内の labelExpression labelExpression - Yarn アプリケーションラベル式 YarnClientConfigurerpublic YarnClientConfigurer memory(int memory)
YarnClientConfigurermemory 引数は MegaBytes として指定されます。
public void configure(YarnClientConfigure client) throws Exception {
client
.memory(1024);
}
<yarn:client memory="1024"/>
YarnClientConfigurer 内の memory memory - Yarn アプリケーションコンテナーのメモリ予約 YarnClientConfigurerYarnClientConfigurer.memory(String)public YarnClientConfigurer memory(java.lang.String memory)
YarnClientConfigurermemory 引数は MegaBytes として指定されます。1G や 500M などのショートカットを使用できます。これらはそれぞれ 1024 と 500 に変換されます。 このメソッドは #memory(int) と同等なので、引数を String として指定できます。
注意 : 1000K や 1000B などの低すぎる設定は使用しないように注意してください。これらの設定は完全な MB に切り捨てられ、ゼロになります。また、値が高すぎると、リソース割り当ての動作が悪くなる可能性があります。
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception {
client
.memory("1G");
}
<yarn:client memory="1024"/>
YarnClientConfigurer 内の memory memory - Yarn アプリケーションコンテナーのメモリ予約 YarnClientConfigurerpublic YarnClientConfigurer virtualCores(java.lang.Integer virtualCores)
YarnClientConfigurer
public void configure(YarnClientConfigure client) throws Exception {
client
.virtualCores(1);
}
<yarn:client virtualcores="1"/>
YarnClientConfigurer 内の virtualCores virtualCores - Yarn アプリケーションの仮想コアリソース数 YarnClientConfigurerpublic YarnClientConfigurer clientClass(java.lang.Class<? extends YarnClient> clazz)
YarnClientConfigurerYarnClient クラスを指定します。
public void configure(YarnClientConfigure client) throws Exception {
client
.clientClass(MyYarnClient.class);
}
YarnClientConfigurer 内の clientClass clazz - Yarn クライアントクラス YarnClientConfigurerpublic YarnClientConfigurer clientClass(java.lang.String clazz)
YarnClientConfigurerYarnClient を指定します。
public void configure(YarnClientConfigure client) throws Exception {
client
.clientClass("com.example.MyYarnClient");
}
YarnClientConfigurer 内の clientClass clazz - Yarn クライアントクラス YarnClientConfigurerpublic void configuration(org.apache.hadoop.conf.Configuration configuration)
public void setCommands(java.lang.String... commands)
public void setResourceLocalizer(ResourceLocalizer resourceLocalizer)
public void setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)