Class CollectLogCommand

  • All Implemented Interfaces:
    alluxio.cli.Command, java.io.Closeable, java.lang.AutoCloseable

    public class CollectLogCommand
    extends AbstractCollectInfoCommand
    Command to collect Alluxio logs.
    • Field Detail

      • FILE_NAMES_PREFIXES

        public static final java.util.Set<java.lang.String> FILE_NAMES_PREFIXES
      • INCLUDE_OPTION_NAME

        public static final java.lang.String INCLUDE_OPTION_NAME
        See Also:
        Constant Field Values
      • EXCLUDE_OPTION_NAME

        public static final java.lang.String EXCLUDE_OPTION_NAME
        See Also:
        Constant Field Values
      • ADDITIONAL_OPTION_NAME

        public static final java.lang.String ADDITIONAL_OPTION_NAME
        See Also:
        Constant Field Values
      • OPTIONS

        public static final org.apache.commons.cli.Options OPTIONS
    • Constructor Detail

      • CollectLogCommand

        public CollectLogCommand​(alluxio.client.file.FileSystemContext fsContext)
        Creates a new instance of CollectLogCommand.
        Parameters:
        fsContext - the FileSystemContext to execute in
    • Method Detail

      • getCommandName

        public java.lang.String getCommandName()
      • run

        public int run​(org.apache.commons.cli.CommandLine cl)
                throws alluxio.exception.AlluxioException,
                       java.io.IOException
        Throws:
        alluxio.exception.AlluxioException
        java.io.IOException
      • inferFileStartTime

        public static java.time.LocalDateTime inferFileStartTime​(java.io.File f)
                                                          throws java.io.FileNotFoundException
        Infer the starting time of a log file by parsing the log entries from the beginning. It will try the first certain lines with various known datetime patterns.
        Parameters:
        f - log file
        Returns:
        the parsed datetime
        Throws:
        java.io.FileNotFoundException
      • getUsage

        public java.lang.String getUsage()
      • getDescription

        public java.lang.String getDescription()
      • parseDateTime

        @Nullable
        public static java.time.LocalDateTime parseDateTime​(java.lang.String s)
        Identifies the datetime from a certain piece of log by trying various known patterns. Returns null if unable to identify a datetime.
        Parameters:
        s - a log entry
        Returns:
        identified datetime