Class AbstractRegexLogFormat

java.lang.Object
com.pervasive.datarush.operators.io.textfile.AbstractRegexLogFormat
All Implemented Interfaces:
LogFormat
Direct Known Subclasses:
CLFLogFormat, CombinedLogFormat, GenericLogFormat, GlassfishLogFormat, Log4jLogFormat, SyslogLogFormat

public abstract class AbstractRegexLogFormat extends Object implements LogFormat
Skeleton implementation of a regular expression based LogFormat class. Provides basic members, accessors, and a regular expression based parser.
  • Field Details

  • Constructor Details

    • AbstractRegexLogFormat

      public AbstractRegexLogFormat()
  • Method Details

    • getLogType

      public SupportedLogType getLogType()
      Description copied from interface: LogFormat
      Get the SupportedLogType of this format.
      Specified by:
      getLogType in interface LogFormat
      Returns:
      the SupportedLogType this format implements
    • getFormatPattern

      public String getFormatPattern()
      Get the value used for the log format pattern
      Specified by:
      getFormatPattern in interface LogFormat
      Returns:
      the text value of the format pattern
    • setFormatPattern

      public void setFormatPattern(String formatPattern)
      Set the value used for the log format pattern
      Specified by:
      setFormatPattern in interface LogFormat
      Parameters:
      formatPattern - the value to use as the format pattern
    • getSchema

      public abstract RecordTextSchema<?> getSchema()
      Gets the record schema of the source.
      Returns:
      the record schema of the source
    • isSplittable

      public boolean isSplittable()
      Description copied from interface: LogFormat
      Indicates if the format supports parsing of subsections of a file.

      A format should only return true if it can, at least in some situations, support this sort of parsing. If a format requires reading the entire file, it must return false.

      If a format is not splittable, a file in the format cannot be parsed in parallel; however, individual files can still be parsed independently in parallel, as when reading the contents of a directory or using a file globbing pattern.

      Specified by:
      isSplittable in interface LogFormat
      Returns:
      true if the format supports parsing only a portion of the file, false otherwise
    • analyzeFormat

      public FormatAnalyzer.FormatAnalysis analyzeFormat(Reader input) throws IOException, ParseException
      Description copied from interface: LogFormat
      Creates the analysis object based on the provided input.
      Specified by:
      analyzeFormat in interface LogFormat
      Parameters:
      input - the input source to analyze
      Returns:
      the analysis object
      Throws:
      IOException
      ParseException
    • setAnalysis

      public LogFormat setAnalysis(FormatAnalyzer.FormatAnalysis analysis)
      Description copied from interface: LogFormat
      Sets the analysis object to use to determine meta-data.
      Specified by:
      setAnalysis in interface LogFormat
      Parameters:
      analysis - the analysis object
    • refreshSchema

      protected abstract void refreshSchema()
      Refresh and recalculate the schema. This is usually done after changing a setting.