|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.data.hadoop.config.common.annotation.AbstractAnnotationBuilder<O> org.springframework.data.hadoop.config.common.annotation.AbstractConfiguredAnnotationBuilder<YarnClient,YarnClientConfigurer,YarnClientBuilder> org.springframework.yarn.config.annotation.builders.YarnClientBuilder
public class YarnClientBuilder
AnnotationBuilder
for YarnClient
.
Constructor Summary | |
---|---|
YarnClientBuilder()
Instantiates a new yarn client builder. |
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. |
void |
configuration(org.apache.hadoop.conf.Configuration configuration)
|
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. |
protected YarnClient |
performBuild()
Subclasses must implement this method to build the object that is being returned. |
YarnClientConfigurer |
priority(java.lang.Integer priority)
Specify a yarn application priority. |
YarnClientConfigurer |
queue(java.lang.String queue)
Specify a yarn application submission queue. |
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)
Specify a yarn application virtual core resource count. |
DefaultClientMasterRunnerConfigurer |
withMasterRunner()
Add commands for starting YarnAppmaster . |
Methods inherited from class org.springframework.data.hadoop.config.common.annotation.AbstractConfiguredAnnotationBuilder |
---|
apply, apply, beforeConfigureMains, beforeConfigurePosts, beforeInit, doBuild, getConfigurer, getConfigurers, getOrApply, getOrBuild, getSharedObject, getSharedObjects, objectPostProcessor, postProcess, removeConfigurer, removeConfigurers, setSharedObject |
Methods inherited from class org.springframework.data.hadoop.config.common.annotation.AbstractAnnotationBuilder |
---|
build, getObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public YarnClientBuilder()
Method Detail |
---|
protected YarnClient performBuild() throws java.lang.Exception
AbstractConfiguredAnnotationBuilder
performBuild
in class AbstractConfiguredAnnotationBuilder<YarnClient,YarnClientConfigurer,YarnClientBuilder>
java.lang.Exception
public DefaultClientMasterRunnerConfigurer withMasterRunner() throws java.lang.Exception
YarnAppmaster
.
withMasterRunner
in interface YarnClientConfigurer
java.lang.Exception
- the exceptionpublic YarnClientConfigurer appName(java.lang.String appName)
YarnClientConfigurer
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .appName("myAppName"); }
XML:
<yarn:client app-name="myAppName"/>
appName
in interface YarnClientConfigurer
appName
- The Yarn application name
YarnClientConfigurer
for chainingpublic YarnClientConfigurer appType(java.lang.String appType)
YarnClientConfigurer
MAPREDUCE
and other
applications defaults to YARN
.
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .appType("BOOT"); }
XML:
No equivalent
appType
in interface YarnClientConfigurer
appType
- The Yarn application type
YarnClientConfigurer
for chainingpublic YarnClientConfigurer masterCommands(java.lang.String... commands)
YarnClientConfigurer
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>
masterCommands
in interface YarnClientConfigurer
commands
- The Yarn container commands
YarnAppmasterConfigurer
for chainingpublic YarnClientConfigurer priority(java.lang.Integer priority)
YarnClientConfigurer
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .priority(0); }
XML:
<yarn:client priority="0"/>
priority
in interface YarnClientConfigurer
priority
- The Yarn application priority
YarnClientConfigurer
for chainingpublic YarnClientConfigurer queue(java.lang.String queue)
YarnClientConfigurer
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .queue("default"); }
XML:
<yarn:client queue="default"/>
queue
in interface YarnClientConfigurer
queue
- The Yarn application submission queue
YarnClientConfigurer
for chainingpublic YarnClientConfigurer memory(int memory)
YarnClientConfigurer
memory
argument is given as MegaBytes.
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .memory(1024); }
XML:
<yarn:client memory="1024"/>
memory
in interface YarnClientConfigurer
memory
- The Yarn application containers memory reservation
YarnClientConfigurer
for chainingYarnClientConfigurer.memory(String)
public YarnClientConfigurer memory(java.lang.String memory)
YarnClientConfigurer
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
in interface YarnClientConfigurer
memory
- The Yarn application containers memory reservation
YarnClientConfigurer
for chainingpublic YarnClientConfigurer virtualCores(java.lang.Integer virtualCores)
YarnClientConfigurer
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .virtualCores(1); }
XML:
<yarn:client virtualcores="1"/>
virtualCores
in interface YarnClientConfigurer
virtualCores
- The Yarn application virtual core resource count
YarnClientConfigurer
for chainingpublic YarnClientConfigurer clientClass(java.lang.Class<? extends YarnClient> clazz)
YarnClientConfigurer
YarnClient
class.
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .clientClass(MyYarnClient.class); }
XML:
No equivalent
clientClass
in interface YarnClientConfigurer
clazz
- The Yarn client class
YarnClientConfigurer
for chainingpublic YarnClientConfigurer clientClass(java.lang.String clazz)
YarnClientConfigurer
YarnClient
as a fully qualified class name.
JavaConfig:
public void configure(YarnClientConfigure client) throws Exception { client .clientClass("com.example.MyYarnClient"); }
XML:
No equivalent
clientClass
in interface YarnClientConfigurer
clazz
- The Yarn client class
YarnClientConfigurer
for chainingpublic 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)
|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |