public abstract class AbstractLauncher
extends org.apache.hadoop.conf.Configured
| Modifier and Type | Field and Description |
|---|---|
static String |
CLASSPATH |
protected List<String> |
commands |
protected org.apache.hadoop.yarn.api.records.ContainerLaunchContext |
containerLaunchContext |
protected CoreFileSystem |
coreFileSystem
Filesystem to use for the launch
|
protected org.apache.hadoop.security.Credentials |
credentials |
protected MapOperations |
env |
protected Map<String,String> |
envVars
Env vars; set up at final launch stage
|
protected Map<String,org.apache.hadoop.yarn.api.records.LocalResource> |
localResources |
protected org.apache.hadoop.yarn.api.records.LogAggregationContext |
logAggregationContext |
static String |
MAPREDUCE_JOB_CREDENTIALS_BINARY |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractLauncher(org.apache.hadoop.conf.Configuration conf,
CoreFileSystem fs) |
protected |
AbstractLauncher(CoreFileSystem fs) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCommand(String cmd) |
void |
addCommandLine(CommandLineBuilder cmd)
Add a command line.
|
void |
addCommands(List<String> commandList)
Add a list of commands.
|
void |
addLocalResource(String subpath,
org.apache.hadoop.yarn.api.records.LocalResource resource) |
void |
addLocalResources(Map<String,org.apache.hadoop.yarn.api.records.LocalResource> resourceMap)
Add a set of local resources
|
org.apache.hadoop.yarn.api.records.ContainerLaunchContext |
completeContainerLaunch()
Complete the launch context (copy in env vars, etc).
|
boolean |
copyEnvVars(MapOperations options)
Important: the configuration must already be fully resolved
in order to pick up global options
Copy env vars into the launch context.
|
String[] |
dumpEnvToString() |
void |
extractAmRetryCount(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext submissionContext,
Map<String,String> map)
Extract the value for option
yarn.resourcemanager.am.retry-count-window-ms
and set it on the ApplicationSubmissionContext.
|
String |
extractLabelExpression(Map<String,String> map)
Return the label expression and if not set null
|
void |
extractLogAggregationContext(Map<String,String> map) |
void |
extractResourceRequirements(org.apache.hadoop.yarn.api.records.Resource resource,
Map<String,String> map)
Extract any resource requirements from this component's settings.
|
List<String> |
getCommands()
Get the launch commands.
|
String |
getCommandsAsString()
Get all commands as a string, separated by ";".
|
org.apache.hadoop.yarn.api.records.ContainerLaunchContext |
getContainerLaunchContext()
Get the container.
|
org.apache.hadoop.security.Credentials |
getCredentials()
Accessor to the credentials
|
MapOperations |
getEnv()
Get the env vars to work on
|
Map<String,org.apache.hadoop.yarn.api.records.LocalResource> |
getLocalResources()
Get the map of local resources.
|
Map<String,ByteBuffer> |
getServiceData() |
protected void |
propagateUsernameInInsecureCluster()
This is critical for an insecure cluster -it passes
down the username to YARN, and so gives the code running
in containers the rights it needs to work with
data.
|
void |
putEnv(Map<String,String> map) |
void |
setClasspath(ClasspathConstructor classpath)
Utility method to set up the classpath
|
void |
setEnv(String var,
String value) |
void |
submitDirectory(org.apache.hadoop.fs.Path srcDir,
String destRelativeDir)
Submit an entire directory
|
public static final String CLASSPATH
public static final String MAPREDUCE_JOB_CREDENTIALS_BINARY
protected final CoreFileSystem coreFileSystem
protected final MapOperations env
protected final org.apache.hadoop.yarn.api.records.ContainerLaunchContext containerLaunchContext
protected final Map<String,org.apache.hadoop.yarn.api.records.LocalResource> localResources
protected final org.apache.hadoop.security.Credentials credentials
protected org.apache.hadoop.yarn.api.records.LogAggregationContext logAggregationContext
protected AbstractLauncher(org.apache.hadoop.conf.Configuration conf,
CoreFileSystem fs)
protected AbstractLauncher(CoreFileSystem fs)
public org.apache.hadoop.yarn.api.records.ContainerLaunchContext getContainerLaunchContext()
public MapOperations getEnv()
public List<String> getCommands()
public Map<String,org.apache.hadoop.yarn.api.records.LocalResource> getLocalResources()
public void addLocalResource(String subpath, org.apache.hadoop.yarn.api.records.LocalResource resource)
public void addLocalResources(Map<String,org.apache.hadoop.yarn.api.records.LocalResource> resourceMap)
resourceMap - map of name:resource to addpublic Map<String,ByteBuffer> getServiceData()
public org.apache.hadoop.security.Credentials getCredentials()
public void addCommandLine(CommandLineBuilder cmd)
cmd - public void addCommand(String cmd)
public void addCommands(List<String> commandList)
commandList - list of commandspublic String getCommandsAsString()
public org.apache.hadoop.yarn.api.records.ContainerLaunchContext completeContainerLaunch()
throws IOException
IOExceptionprotected void propagateUsernameInInsecureCluster()
throws IOException
IOException - problems working with current userpublic void extractResourceRequirements(org.apache.hadoop.yarn.api.records.Resource resource,
Map<String,String> map)
resource - resource to configuremap - map of optionspublic void extractAmRetryCount(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext submissionContext,
Map<String,String> map)
submissionContext - map - public void setClasspath(ClasspathConstructor classpath)
classpath - classpath to usepublic boolean copyEnvVars(MapOperations options)
public String[] dumpEnvToString()
public void submitDirectory(org.apache.hadoop.fs.Path srcDir,
String destRelativeDir)
throws IOException
srcDir - src path in filesystemdestRelativeDir - relative path under destination local dirIOException - IO problemsCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.