public final class YarnAppmasterBuilder extends AbstractConfiguredAnnotationBuilder<YarnAppmaster,YarnAppmasterConfigurer,YarnAppmasterBuilder> implements YarnAppmasterConfigurer
Constructor and Description |
---|
YarnAppmasterBuilder() |
YarnAppmasterBuilder(ObjectPostProcessor<java.lang.Object> objectPostProcessor) |
Modifier and Type | Method and Description |
---|---|
YarnAppmasterBuilder |
appmasterClass(java.lang.Class<? extends YarnAppmaster> clazz)
Specify a
YarnAppmaster class. |
YarnAppmasterBuilder |
appmasterClass(java.lang.String clazz)
Specify a
YarnAppmaster as a fully qualified class name. |
void |
configuration(org.apache.hadoop.conf.Configuration configuration) |
YarnAppmasterBuilder |
containerCommands(java.lang.String[] commands)
Specify a raw array of commands used to start a container.
|
YarnAppmasterBuilder |
containerCommands(java.lang.String id,
java.lang.String[] commands)
Specify a raw array of commands used to start a container.
|
protected YarnAppmaster |
performBuild()
Subclasses must implement this method to build the object that is being returned.
|
void |
setContainerAllocator(ContainerAllocator containerAllocator) |
void |
setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment) |
void |
setEnvironments(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> environments) |
void |
setResourceLocalizer(ResourceLocalizer resourceLocalizer) |
MasterContainerAllocatorConfigurer |
withContainerAllocator()
Specify a container allocator for Appmaster.
|
MasterContainerRunnerConfigurer |
withContainerRunner()
Specify a container runner for Appmaster.
|
apply, apply, beforeConfigureMains, beforeConfigurePosts, beforeInit, doBuild, getConfigurer, getConfigurers, getOrApply, getOrBuild, getSharedObject, getSharedObjects, objectPostProcessor, postProcess, removeConfigurer, removeConfigurers, setSharedObject
build, getObject
public YarnAppmasterBuilder()
public YarnAppmasterBuilder(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
protected YarnAppmaster performBuild() throws java.lang.Exception
AbstractConfiguredAnnotationBuilder
performBuild
in class AbstractConfiguredAnnotationBuilder<YarnAppmaster,YarnAppmasterConfigurer,YarnAppmasterBuilder>
java.lang.Exception
public MasterContainerRunnerConfigurer withContainerRunner() throws java.lang.Exception
YarnAppmasterConfigurer
DefaultMasterContainerRunnerConfigurer
into a current builder.
public void configure(YarnAppmasterConfigure master) throws Exception { Properties properties = new Properties(); properties.setProperty("foo1", "bar1"); master .withContainerRunner() .arguments(properties) .argument("foo2", "bar2"); }
<util:properties id="arguments"> <prop key="foo1">bar1</prop> <prop key="foo2">bar2</prop> </util:properties> <yarn:master> <yarn:container-runner arguments="arguments"/> </yarn:master>
withContainerRunner
in interface YarnAppmasterConfigurer
MasterContainerRunnerConfigurer
for chainingjava.lang.Exception
- exceptionpublic MasterContainerAllocatorConfigurer withContainerAllocator() throws java.lang.Exception
YarnAppmasterConfigurer
DefaultMasterContainerAllocatorConfigurer
into a current builder.
public void configure(YarnAppmasterConfigure master) throws Exception { master .withContainerAllocator() .priority(0) .virtualCores(1) .memory(1024); }
<yarn:master> <yarn:container-allocator priority="0" virtualcores="1" memory="1024"/> </yarn:master>
withContainerAllocator
in interface YarnAppmasterConfigurer
MasterContainerAllocatorConfigurer
for chainingjava.lang.Exception
- exceptionpublic void configuration(org.apache.hadoop.conf.Configuration configuration)
public void setResourceLocalizer(ResourceLocalizer resourceLocalizer)
public void setContainerAllocator(ContainerAllocator containerAllocator)
public void setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
public void setEnvironments(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> environments)
public YarnAppmasterBuilder appmasterClass(java.lang.Class<? extends YarnAppmaster> clazz)
YarnAppmasterConfigurer
YarnAppmaster
class.
public void configure(YarnAppmasterConfigure master) throws Exception { master .appmasterClass(MyYarnAppmaster.class); }
<yarn:master appmaster-class="com.example.MyYarnAppmaster"/>
appmasterClass
in interface YarnAppmasterConfigurer
clazz
- The Yarn appmaster classYarnAppmasterConfigurer
for chainingpublic YarnAppmasterBuilder appmasterClass(java.lang.String clazz)
YarnAppmasterConfigurer
YarnAppmaster
as a fully qualified class name.
public void configure(YarnAppmasterConfigure master) throws Exception { master .appmasterClass(MyYarnAppmaster.class); }
appmasterClass
in interface YarnAppmasterConfigurer
clazz
- The Yarn appmaster classYarnAppmasterConfigurer
for chainingpublic YarnAppmasterBuilder containerCommands(java.lang.String[] commands)
YarnAppmasterConfigurer
public void configure(YarnAppmasterConfigure master) throws Exception { master .containerCommands("date", "1><LOG_DIR>/Container.stdout", "2><LOG_DIR>/Container.stderr"); }
<yarn:master> <yarn:container-command> <![CDATA[ date 1><LOG_DIR>/Container.stdout 2><LOG_DIR>/Container.stderr ]]> </yarn:container-command> </yarn:master>
containerCommands
in interface YarnAppmasterConfigurer
commands
- The Yarn container commandsYarnAppmasterConfigurer
for chainingpublic YarnAppmasterBuilder containerCommands(java.lang.String id, java.lang.String[] commands)
YarnAppmasterConfigurer
containerCommands
in interface YarnAppmasterConfigurer
id
- the commands identifiercommands
- The Yarn container commandsYarnAppmasterConfigurer
for chainingYarnAppmasterConfigurer.containerCommands(String[])