@InterfaceAudience.Private
public class DfsTask
extends org.apache.tools.ant.Task
FsShell
wrapper for ant Task.Modifier and Type | Field and Description |
---|---|
protected LinkedList<String> |
argv |
protected String |
cmd |
protected org.apache.tools.ant.AntClassLoader |
confloader |
protected OutputStream |
err |
protected String |
errprop |
protected boolean |
failonerror |
protected OutputStream |
out |
protected String |
outprop |
Constructor and Description |
---|
DfsTask() |
Modifier and Type | Method and Description |
---|---|
void |
execute()
Invoke
FsShell.main(java.lang.String[]) after a
few cursory checks of the configuration. |
protected void |
popContext()
Create the appropriate output properties with their respective output,
restore System.out, System.err and release any resources from created
ClassLoaders to aid garbage collection.
|
protected int |
postCmd(int exit_code) |
protected void |
pushContext()
Save the current values of System.out, System.err and configure output
streams for FsShell.
|
void |
setArgs(String args)
Sets the argument list from a String of comma-separated values.
|
void |
setCmd(String cmd)
Sets the command to run in
FsShell . |
void |
setConf(String confpath)
Sets the path for the parent-last ClassLoader, intended to be used for
Configuration . |
void |
setErr(String errprop)
Sets the property into which System.err will be written.
|
void |
setFailonerror(boolean failonerror)
Sets a property controlling whether or not a
BuildException will be thrown
if the command returns a value less than zero or throws an exception. |
void |
setOut(String outprop)
Sets the property into which System.out will be written.
|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
protected org.apache.tools.ant.AntClassLoader confloader
protected OutputStream out
protected OutputStream err
protected String cmd
protected final LinkedList<String> argv
protected String outprop
protected String errprop
protected boolean failonerror
public void setCmd(String cmd)
FsShell
.cmd
- A valid command to FsShell, sans "-".public void setArgs(String args)
args
- A String of comma-separated arguments to FsShell.public void setOut(String outprop)
outprop
- The name of the property into which System.out is written.
If the property is defined before this task is executed, it will not be updated.public void setErr(String errprop)
errprop
- The name of the property into which System.err is written.
If the property is defined before this task is executed, it will not be updated.public void setConf(String confpath)
Configuration
.confpath
- The path to search for resources, classes, etc. before
parent ClassLoaders.public void setFailonerror(boolean failonerror)
BuildException
will be thrown
if the command returns a value less than zero or throws an exception.failonerror
- If true, throw a BuildException on error.protected void pushContext()
protected void popContext()
protected int postCmd(int exit_code)
public void execute() throws org.apache.tools.ant.BuildException
FsShell.main(java.lang.String[])
after a
few cursory checks of the configuration.execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
Copyright © 2019 Apache Software Foundation. All Rights Reserved.