public abstract static class ContainerLaunch.ShellScriptBuilder extends Object
Modifier and Type | Field and Description |
---|---|
protected static String |
ENV_PRELAUNCH_STDERR |
protected static String |
ENV_PRELAUNCH_STDOUT |
Constructor and Description |
---|
ShellScriptBuilder() |
Modifier and Type | Method and Description |
---|---|
protected void |
buildCommand(String... command) |
abstract void |
command(List<String> command) |
abstract void |
copyDebugInformation(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst)
Method to copy files that are useful for debugging container failures.
|
static ContainerLaunch.ShellScriptBuilder |
create() |
static ContainerLaunch.ShellScriptBuilder |
create(org.apache.hadoop.util.Shell.OSType osType) |
abstract void |
echo(String echoStr) |
abstract void |
env(String key,
String value) |
Set<String> |
getEnvDependencies(String envVal)
Parse an environment value and returns all environment keys it uses.
|
protected void |
line(String... command) |
protected void |
linebreak(String... command) |
protected abstract void |
link(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst) |
abstract void |
listDebugInformation(org.apache.hadoop.fs.Path output)
Method to dump debug information to a target file.
|
protected abstract void |
mkdir(org.apache.hadoop.fs.Path path) |
Map<String,String> |
orderEnvByDependencies(Map<String,String> envs)
Returns a dependency ordered version of
envs . |
void |
setExitOnFailure() |
protected abstract void |
setStdErr(org.apache.hadoop.fs.Path stdout) |
protected abstract void |
setStdOut(org.apache.hadoop.fs.Path stdout) |
void |
stderr(org.apache.hadoop.fs.Path stderrDir,
String stdErrFile)
Set stderr for the shell script
|
void |
stdout(org.apache.hadoop.fs.Path stdoutDir,
String stdOutFile)
Set stdout for the shell script
|
void |
symlink(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst) |
String |
toString() |
abstract void |
whitelistedEnv(String key,
String value) |
void |
write(PrintStream out) |
protected static final String ENV_PRELAUNCH_STDOUT
protected static final String ENV_PRELAUNCH_STDERR
public static ContainerLaunch.ShellScriptBuilder create()
public static ContainerLaunch.ShellScriptBuilder create(org.apache.hadoop.util.Shell.OSType osType)
public abstract void command(List<String> command) throws IOException
IOException
public final void stdout(org.apache.hadoop.fs.Path stdoutDir, String stdOutFile) throws IOException
stdoutDir
- stdout must be an absolute pathstdOutFile
- stdout file nameIOException
- thrown when stdout path is not absolutepublic final void stderr(org.apache.hadoop.fs.Path stderrDir, String stdErrFile) throws IOException
stderrDir
- stderr must be an absolute pathstdErrFile
- stderr file nameIOException
- thrown when stderr path is not absoluteprotected abstract void setStdOut(org.apache.hadoop.fs.Path stdout) throws IOException
IOException
protected abstract void setStdErr(org.apache.hadoop.fs.Path stdout) throws IOException
IOException
public abstract void env(String key, String value) throws IOException
IOException
public abstract void whitelistedEnv(String key, String value) throws IOException
IOException
public abstract void echo(String echoStr) throws IOException
IOException
public final void symlink(org.apache.hadoop.fs.Path src, org.apache.hadoop.fs.Path dst) throws IOException
IOException
public abstract void copyDebugInformation(org.apache.hadoop.fs.Path src, org.apache.hadoop.fs.Path dst) throws IOException
src
- path to the source filedst
- path to the destination file - should be absoluteIOException
public abstract void listDebugInformation(org.apache.hadoop.fs.Path output) throws IOException
output
- the file to which debug information is to be writtenIOException
public final void write(PrintStream out) throws IOException
IOException
protected final void buildCommand(String... command)
protected final void linebreak(String... command)
protected final void line(String... command)
public void setExitOnFailure()
protected abstract void link(org.apache.hadoop.fs.Path src, org.apache.hadoop.fs.Path dst) throws IOException
IOException
protected abstract void mkdir(org.apache.hadoop.fs.Path path) throws IOException
IOException
public Set<String> getEnvDependencies(String envVal)
envVal
- an environment variable's valueenvVal
.Copyright © 2008–2023 Apache Software Foundation. All rights reserved.