public static class WowMoveCommands.Rename extends WowFsCommand
| Modifier and Type | Class and Description |
|---|---|
protected static class |
WowCommandWithDestination.FileAttribute |
| Modifier and Type | Field and Description |
|---|---|
static String |
DESCRIPTION |
protected org.apache.hadoop.fs.shell.PathData |
dst |
static String |
NAME |
static String |
USAGE |
basePath| Constructor and Description |
|---|
Rename(org.apache.hadoop.conf.Configuration conf,
String basePath,
PrintStream out,
PrintStream error) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
copyFileToTarget(org.apache.hadoop.fs.shell.PathData src,
org.apache.hadoop.fs.shell.PathData target)
Copies the source file to the target.
|
protected void |
copyStreamToTarget(InputStream in,
org.apache.hadoop.fs.shell.PathData target)
Copies the stream contents to a temporary file.
|
protected void |
getLocalDestination(LinkedList<String> args)
The last arg is expected to be a local path, if only one argument is
given then the destination will be the current directory
|
protected void |
getRemoteDestination(LinkedList<String> args)
The last arg is expected to be a remote path, if only one argument is
given then the destination will be the remote user's directory
|
protected org.apache.hadoop.fs.shell.PathData |
getTargetPath(org.apache.hadoop.fs.shell.PathData src) |
protected void |
preserve(WowCommandWithDestination.FileAttribute fileAttribute)
Add file attributes that need to be preserved.
|
protected void |
preserveAttributes(org.apache.hadoop.fs.shell.PathData src,
org.apache.hadoop.fs.shell.PathData target,
boolean preserveRawXAttrs)
Preserve the attributes of the source to the target.
|
protected void |
processArguments(LinkedList<org.apache.hadoop.fs.shell.PathData> args) |
protected void |
processOptions(LinkedList<String> args) |
protected void |
processPath(org.apache.hadoop.fs.shell.PathData src) |
protected void |
processPath(org.apache.hadoop.fs.shell.PathData src,
org.apache.hadoop.fs.shell.PathData target)
Called with a source and target destination pair
|
protected void |
processPathArgument(org.apache.hadoop.fs.shell.PathData src) |
protected void |
recursePath(org.apache.hadoop.fs.shell.PathData src) |
protected void |
setLazyPersist(boolean flag) |
protected void |
setOverwrite(boolean flag)
This method is used to enable the force(-f) option while copying the files.
|
protected void |
setPreserve(boolean preserve)
If true, the last modified time, last access time,
owner, group and permission information of the source
file will be preserved as far as target
FileSystem
implementation allows. |
protected void |
setVerifyChecksum(boolean flag) |
protected void |
setWriteChecksum(boolean flag) |
cleanPath, getCommandName, redefineBaseDir, registerCommands, run, runAlldisplayError, displayError, displayWarning, exitCodeForError, expandArgument, expandArguments, getDepth, getDescription, getName, getReplacementCommand, getUsage, isDeprecated, isRecursive, postProcessPath, processArgument, processNonexistentPath, processPaths, processRawArguments, run, setName, setRecursivepublic static final String NAME
public static final String USAGE
public static final String DESCRIPTION
protected org.apache.hadoop.fs.shell.PathData dst
public Rename(org.apache.hadoop.conf.Configuration conf,
String basePath,
PrintStream out,
PrintStream error)
protected void processOptions(LinkedList<String> args) throws IOException
processOptions in class org.apache.hadoop.fs.shell.CommandIOExceptionprotected void processPath(org.apache.hadoop.fs.shell.PathData src,
org.apache.hadoop.fs.shell.PathData target)
throws IOException
src - for the operationtarget - for the operationIOException - if anything goes wrongprotected void setOverwrite(boolean flag)
flag - true/falseprotected void setLazyPersist(boolean flag)
protected void setVerifyChecksum(boolean flag)
protected void setWriteChecksum(boolean flag)
protected void setPreserve(boolean preserve)
FileSystem
implementation allows.protected void preserve(WowCommandWithDestination.FileAttribute fileAttribute)
fileAttribute - - Attribute to add, one at a timeprotected void getLocalDestination(LinkedList<String> args) throws IOException
args - is the list of argumentsIOExceptionprotected void getRemoteDestination(LinkedList<String> args) throws IOException
args - is the list of argumentsorg.apache.hadoop.fs.PathIOException - if path doesn't exist or matches too many timesIOExceptionprotected void processArguments(LinkedList<org.apache.hadoop.fs.shell.PathData> args) throws IOException
processArguments in class org.apache.hadoop.fs.shell.CommandIOExceptionprotected void processPathArgument(org.apache.hadoop.fs.shell.PathData src)
throws IOException
processPathArgument in class org.apache.hadoop.fs.shell.CommandIOExceptionprotected void processPath(org.apache.hadoop.fs.shell.PathData src)
throws IOException
processPath in class org.apache.hadoop.fs.shell.CommandIOExceptionprotected void recursePath(org.apache.hadoop.fs.shell.PathData src)
throws IOException
recursePath in class org.apache.hadoop.fs.shell.CommandIOExceptionprotected org.apache.hadoop.fs.shell.PathData getTargetPath(org.apache.hadoop.fs.shell.PathData src)
throws IOException
IOExceptionprotected void copyFileToTarget(org.apache.hadoop.fs.shell.PathData src,
org.apache.hadoop.fs.shell.PathData target)
throws IOException
src - item to copytarget - where to copy the itemIOException - if copy failsprotected void copyStreamToTarget(InputStream in, org.apache.hadoop.fs.shell.PathData target) throws IOException
in - the input stream for the copytarget - where to store the contents of the streamIOException - if copy failsprotected void preserveAttributes(org.apache.hadoop.fs.shell.PathData src,
org.apache.hadoop.fs.shell.PathData target,
boolean preserveRawXAttrs)
throws IOException
shouldPreserve(FileAttribute) to check what
attribute to preserve.src - source to preservetarget - where to preserve attributespreserveRawXAttrs - true if raw.* xattrs should be preservedIOException - if fails to preserve attributesCopyright © 2021. All rights reserved.