Class GenericLogFormat

java.lang.Object
com.pervasive.datarush.operators.io.textfile.AbstractRegexLogFormat
com.pervasive.datarush.operators.io.textfile.GenericLogFormat
All Implemented Interfaces:
LogFormat

public class GenericLogFormat extends AbstractRegexLogFormat
Describes the format of a generic log that can be parsed using a regular expression. The format pattern defines the regular expression used to parse the log.
  • Field Details

  • Constructor Details

    • GenericLogFormat

      public GenericLogFormat()
      Create a generic log format to read data using a regular expression.
    • GenericLogFormat

      public GenericLogFormat(String formatPattern)
      Create a generic log format to read data using a regular expression
      Parameters:
      formatPattern - the regular expression used in parsing
  • Method Details

    • setSchema

      public void setSchema(RecordTextSchema<?> schema)
      Sets the record schema of the source. Must match the regular expression used for parsing.
      Parameters:
      schema - the expected record schema of the source
    • getGroupCount

      public int getGroupCount()
      Gets the number of matching groups in the format pattern.
      Returns:
      the number of matching groups
    • getPatternFlags

      public int getPatternFlags()
    • setPatternFlags

      public void setPatternFlags(int patternFlags)
    • getFormatPrefix

      public String getFormatPrefix()
    • setFormatPrefix

      public void setFormatPrefix(String formatPrefix)
    • getType

      public RecordTokenType getType()
      Description copied from interface: LogFormat
      Gets the record type associated with the format. Records produced by the associated parser or consumed by the associated formatter will be of this type.

      For many formats, this may be derived from a schema object describing the format layout.

      Returns:
      the format's record type
    • getSchema

      public RecordTextSchema<?> getSchema()
      Description copied from class: AbstractRegexLogFormat
      Gets the record schema of the source.
      Specified by:
      getSchema in class AbstractRegexLogFormat
      Returns:
      the record schema of the source
    • refreshSchema

      protected void refreshSchema()
      Description copied from class: AbstractRegexLogFormat
      Refresh and recalculate the schema. This is usually done after changing a setting.
      Specified by:
      refreshSchema in class AbstractRegexLogFormat
    • createParser

      public DataFormat.DataParser createParser(ParsingOptions options, CharsetEncoding charEncoding, String newline)