@ThreadSafe @PublicApi public final class DuCommand extends AbstractFileSystemCommand
mFileSystem, mFsContext
Constructor and Description |
---|
DuCommand(FileSystemContext fsContext) |
Modifier and Type | Method and Description |
---|---|
String |
getCommandName()
Gets the command name as input from the shell.
|
String |
getDescription() |
org.apache.commons.cli.Options |
getOptions() |
protected static void |
getSizeInfo(AlluxioURI path,
List<URIStatus> statuses,
boolean readable,
boolean summarize,
boolean addMemory)
Gets and prints the size information of the input path according to options.
|
String |
getUsage() |
protected void |
processHeader(org.apache.commons.cli.CommandLine cl)
Processes the header of the command.
|
int |
run(org.apache.commons.cli.CommandLine cl)
Runs the command.
|
protected void |
runPlainPath(AlluxioURI path,
org.apache.commons.cli.CommandLine cl)
Runs the command for a particular URI that does not contain wildcard in its path.
|
void |
validateArgs(org.apache.commons.cli.CommandLine cl)
Checks if the arguments are valid or throw InvalidArgumentException.
|
runWildCardCmd
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getSubCommands, hasSubCommand, parseAndValidateArgs
public DuCommand(FileSystemContext fsContext)
fsContext
- the filesystem of Alluxiopublic String getCommandName()
Command
protected void processHeader(org.apache.commons.cli.CommandLine cl)
AbstractFileSystemCommand
processHeader
in class AbstractFileSystemCommand
cl
- object containing the original commandLineprotected void runPlainPath(AlluxioURI path, org.apache.commons.cli.CommandLine cl) throws AlluxioException, IOException
AbstractFileSystemCommand
runPlainPath
in class AbstractFileSystemCommand
path
- an AlluxioURI that does not contain wildcardcl
- object containing the original commandLineAlluxioException
IOException
protected static void getSizeInfo(AlluxioURI path, List<URIStatus> statuses, boolean readable, boolean summarize, boolean addMemory)
path
- the path to get size info ofstatuses
- the statuses of files and foldersreadable
- whether to print info of human readable formatsummarize
- whether to display the aggregate summary lengthsaddMemory
- whether to display the memory size and percentage informationpublic String getUsage()
public String getDescription()
public void validateArgs(org.apache.commons.cli.CommandLine cl) throws InvalidArgumentException
Command
cl
- the parsed command line for the argumentsInvalidArgumentException
- when arguments are not validpublic org.apache.commons.cli.Options getOptions()
Options
of the commandpublic int run(org.apache.commons.cli.CommandLine cl) throws AlluxioException, IOException
Command
cl
- the parsed command line for the argumentsAlluxioException
IOException
Copyright © 2023. All Rights Reserved.