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, setSharedObject
build, getObject
protected YarnClient performBuild() throws java.lang.Exception
AbstractConfiguredAnnotationBuilder
AbstractConfiguredAnnotationBuilder<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 アプリケーション名 YarnClientConfigurer
public YarnClientConfigurer appType(java.lang.String appType)
YarnClientConfigurer
MAPREDUCE
を使用しており、他のアプリケーションはデフォルトで YARN
になります。public void configure(YarnClientConfigure client) throws Exception { client .appType("BOOT"); }
YarnClientConfigurer
の appType
appType
- Yarn アプリケーション型 YarnClientConfigurer
public 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 コンテナーコマンド YarnAppmasterConfigurer
public 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 の申請優先順位 YarnClientConfigurer
public 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 アプリケーション提出キュー YarnClientConfigurer
public YarnClientConfigurer labelExpression(java.lang.String labelExpression)
YarnClientConfigurer
public void configure(YarnClientConfigure client) throws Exception { client .labelExpression("expression"); }
YarnClientConfigurer
の labelExpression
labelExpression
- Yarn アプリケーションラベル式 YarnClientConfigurer
public YarnClientConfigurer memory(int memory)
YarnClientConfigurer
memory
引数は MegaBytes として指定されます。public void configure(YarnClientConfigure client) throws Exception { client .memory(1024); }
<yarn:client memory="1024"/>
YarnClientConfigurer
の memory
memory
- Yarn アプリケーションコンテナーのメモリ予約 YarnClientConfigurer
YarnClientConfigurer.memory(String)
public YarnClientConfigurer memory(java.lang.String memory)
YarnClientConfigurer
memory
引数は 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 アプリケーションコンテナーのメモリ予約 YarnClientConfigurer
public 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 アプリケーションの仮想コアリソース数 YarnClientConfigurer
public YarnClientConfigurer clientClass(java.lang.Class<? extends YarnClient> clazz)
YarnClientConfigurer
YarnClient
クラスを指定します。public void configure(YarnClientConfigure client) throws Exception { client .clientClass(MyYarnClient.class); }
YarnClientConfigurer
の clientClass
clazz
- Yarn クライアントクラス YarnClientConfigurer
public YarnClientConfigurer clientClass(java.lang.String clazz)
YarnClientConfigurer
YarnClient
を指定します。public void configure(YarnClientConfigure client) throws Exception { client .clientClass("com.example.MyYarnClient"); }
YarnClientConfigurer
の clientClass
clazz
- Yarn クライアントクラス YarnClientConfigurer
public 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)