Package alluxio.cli.bundler.command
Class AbstractCollectInfoCommand
- java.lang.Object
-
- alluxio.cli.bundler.command.AbstractCollectInfoCommand
-
- All Implemented Interfaces:
alluxio.cli.Command,java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
CollectConfigCommand,CollectJvmInfoCommand,CollectLogCommand,CollectMetricsCommand,ExecuteShellCollectInfoCommand
public abstract class AbstractCollectInfoCommand extends java.lang.Object implements alluxio.cli.CommandAbstraction of a command under CollectInfo.
-
-
Field Summary
Fields Modifier and Type Field Description protected alluxio.client.file.FileSystemContextmFsContextprotected java.lang.StringmWorkingDirPath
-
Constructor Summary
Constructors Constructor Description AbstractCollectInfoCommand(alluxio.client.file.FileSystemContext fsContext)Creates an instance ofAbstractCollectInfoCommand.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.FilegenerateOutputFile(java.lang.String workingDirPath, java.lang.String fileName)Generates the output file for the command to write printouts to.java.lang.StringgetWorkingDirectory(org.apache.commons.cli.CommandLine cl)Gets the directory that this command should output to.voidvalidateArgs(org.apache.commons.cli.CommandLine cl)
-
-
-
Constructor Detail
-
AbstractCollectInfoCommand
public AbstractCollectInfoCommand(alluxio.client.file.FileSystemContext fsContext)
Creates an instance ofAbstractCollectInfoCommand.- Parameters:
fsContext-FileSystemContextthe context to run in
-
-
Method Detail
-
validateArgs
public void validateArgs(org.apache.commons.cli.CommandLine cl) throws alluxio.exception.status.InvalidArgumentException- Specified by:
validateArgsin interfacealluxio.cli.Command- Throws:
alluxio.exception.status.InvalidArgumentException
-
getWorkingDirectory
public java.lang.String getWorkingDirectory(org.apache.commons.cli.CommandLine cl)
Gets the directory that this command should output to. Creates the directory if it does not exist.- Parameters:
cl- the parsedCommandLine- Returns:
- the directory path
-
generateOutputFile
public java.io.File generateOutputFile(java.lang.String workingDirPath, java.lang.String fileName) throws java.io.IOExceptionGenerates the output file for the command to write printouts to.- Parameters:
workingDirPath- the base directory this command should output tofileName- name of the output file- Returns:
- the output file
- Throws:
java.io.IOException
-
-