|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface YarnClientConfigurer
YarnClientConfigure
is an interface for YarnClientBuilder
which is
exposed to user via SpringYarnConfigurerAdapter
.
Typically configuration is shown below.
@Configuration @EnableYarn(enable=Enable.CLIENT) static class Config extends SpringYarnConfigurerAdapter { @Override public void configure(YarnClientConfigure client) throws Exception { client .appName("myAppName") .withMasterRunner() .contextClass(MyAppmasterConfiguration.class); } }
XML:
<yarn:client app-name="myAppName"> <yarn:master-runner /> </yarn:client>
Method Summary | |
---|---|
YarnClientConfigurer |
appName(java.lang.String appName)
Specify a yarn application name. |
YarnClientConfigurer |
appType(java.lang.String appType)
Specify a yarn application type. |
YarnClientConfigurer |
clientClass(java.lang.Class<? extends YarnClient> clazz)
Specify a YarnClient class. |
YarnClientConfigurer |
clientClass(java.lang.String clazz)
Specify a YarnClient as a fully qualified class name. |
YarnClientConfigurer |
masterCommands(java.lang.String... commands)
Specify a raw array of commands used to start an application master. |
YarnClientConfigurer |
memory(int memory)
Specify a yarn application containers memory reservation. |
YarnClientConfigurer |
memory(java.lang.String memory)
Specify a yarn application containers memory reservation. |
YarnClientConfigurer |
priority(java.lang.Integer priority)
Specify a yarn application priority. |
YarnClientConfigurer |
queue(java.lang.String queue)
Specify a yarn application submission queue. |
YarnClientConfigurer |
virtualCores(java.lang.Integer virtualCores)
Specify a yarn application virtual core resource count. |
ClientMasterRunnerConfigurer |
withMasterRunner()
Specify a runner for Appmaster. |
Method Detail |
---|
ClientMasterRunnerConfigurer withMasterRunner() throws java.lang.Exception
DefaultClientMasterRunnerConfigurer
into current builder.
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .withMasterRunner() .contextClass(MyAppmasterConfiguration.class); }
XML:
<yarn:client> <yarn:master-runner /> </yarn:client>
ClientMasterRunnerConfigurer
for chaining
java.lang.Exception
YarnClientConfigurer appName(java.lang.String appName)
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .appName("myAppName"); }
XML:
<yarn:client app-name="myAppName"/>
appName
- The Yarn application name
YarnClientConfigurer
for chainingYarnClientConfigurer appType(java.lang.String appType)
MAPREDUCE
and other
applications defaults to YARN
.
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .appType("BOOT"); }
XML:
No equivalent
appType
- The Yarn application type
YarnClientConfigurer
for chainingYarnClientConfigurer masterCommands(java.lang.String... commands)
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .masterCommands("java -jar MyApp.jar", "1>/Appmaster.stdout", "2> /Appmaster.stderr"); }
XML:
<yarn:client> <yarn:master-command> <![CDATA[ java -jar MyApp.jar 1>/Appmaster.stdout 2> /Appmaster.stderr ]]> </yarn:master-command> </yarn:client>
commands
- The Yarn container commands
YarnAppmasterConfigurer
for chainingYarnClientConfigurer priority(java.lang.Integer priority)
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .priority(0); }
XML:
<yarn:client priority="0"/>
priority
- The Yarn application priority
YarnClientConfigurer
for chainingYarnClientConfigurer virtualCores(java.lang.Integer virtualCores)
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .virtualCores(1); }
XML:
<yarn:client virtualcores="1"/>
virtualCores
- The Yarn application virtual core resource count
YarnClientConfigurer
for chainingYarnClientConfigurer memory(java.lang.String memory)
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 MB
s and thus becomes a zero. Also too
high values may make resource allocation to behave badly.
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .memory("1G"); }
XML:
<yarn:client memory="1024"/>
memory
- The Yarn application containers memory reservation
YarnClientConfigurer
for chainingYarnClientConfigurer memory(int memory)
memory
argument is given as MegaBytes.
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .memory(1024); }
XML:
<yarn:client memory="1024"/>
memory
- The Yarn application containers memory reservation
YarnClientConfigurer
for chainingmemory(String)
YarnClientConfigurer queue(java.lang.String queue)
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .queue("default"); }
XML:
<yarn:client queue="default"/>
queue
- The Yarn application submission queue
YarnClientConfigurer
for chainingYarnClientConfigurer clientClass(java.lang.Class<? extends YarnClient> clazz)
YarnClient
class.
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .clientClass(MyYarnClient.class); }
XML:
No equivalent
clazz
- The Yarn client class
YarnClientConfigurer
for chainingYarnClientConfigurer clientClass(java.lang.String clazz)
YarnClient
as a fully qualified class name.
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .clientClass("com.example.MyYarnClient"); }
XML:
No equivalent
clazz
- The Yarn client class
YarnClientConfigurer
for chaining
|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |