public class CollectLogCommand extends AbstractCollectInfoCommand
Modifier and Type | Field and Description |
---|---|
static String |
ADDITIONAL_OPTION_NAME |
static String |
COMMAND_NAME |
static String |
EXCLUDE_OPTION_NAME |
static Set<String> |
FILE_NAMES_PREFIXES |
static String |
INCLUDE_OPTION_NAME |
static org.apache.commons.cli.Options |
OPTIONS |
mFsContext, mWorkingDirPath
Constructor and Description |
---|
CollectLogCommand(FileSystemContext fsContext)
Creates a new instance of
CollectLogCommand . |
Modifier and Type | Method and Description |
---|---|
String |
getCommandName()
Gets the command name as input from the shell.
|
String |
getDescription() |
String |
getUsage() |
boolean |
hasSubCommand()
If a command has sub-commands, the first argument should be the sub-command's name,
all arguments and options will be parsed for the sub-command.
|
static java.time.LocalDateTime |
inferFileStartTime(File f)
Infer the starting time of a log file by parsing the log entries from the beginning.
|
static java.time.LocalDateTime |
parseDateTime(String s)
Identifies the datetime from a certain piece of log by trying various known patterns.
|
int |
run(org.apache.commons.cli.CommandLine cl)
Runs the command.
|
generateOutputFile, getWorkingDirectory, validateArgs
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getOptions, getSubCommands, parseAndValidateArgs
public static final String COMMAND_NAME
public static final String INCLUDE_OPTION_NAME
public static final String EXCLUDE_OPTION_NAME
public static final String ADDITIONAL_OPTION_NAME
public static final org.apache.commons.cli.Options OPTIONS
public CollectLogCommand(FileSystemContext fsContext)
CollectLogCommand
.fsContext
- the FileSystemContext
to execute inpublic String getCommandName()
Command
public boolean hasSubCommand()
Command
public int run(org.apache.commons.cli.CommandLine cl) throws AlluxioException, IOException
Command
cl
- the parsed command line for the argumentsAlluxioException
IOException
public static java.time.LocalDateTime inferFileStartTime(File f) throws FileNotFoundException
f
- log fileFileNotFoundException
public String getUsage()
public String getDescription()
@Nullable public static java.time.LocalDateTime parseDateTime(String s)
s
- a log entryCopyright © 2023. All Rights Reserved.