- 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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.pervasive.datarush.operators.io.textfile.AbstractRegexLogFormat
AbstractRegexLogFormat.RegexParser
-
-
Field Summary
Fields Modifier and Type Field Description protected RecordTextSchema<?>schema-
Fields inherited from class com.pervasive.datarush.operators.io.textfile.AbstractRegexLogFormat
formatPattern, logType
-
-
Constructor Summary
Constructors Constructor Description GenericLogFormat()Create a generic log format to read data using a regular expression.GenericLogFormat(String formatPattern)Create a generic log format to read data using a regular expression
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataFormat.DataParsercreateParser(ParsingOptions options, CharsetEncoding charEncoding, String newline)StringgetFormatPrefix()intgetGroupCount()Gets the number of matching groups in the format pattern.intgetPatternFlags()RecordTextSchema<?>getSchema()Gets the record schema of the source.RecordTokenTypegetType()Gets the record type associated with the format.protected voidrefreshSchema()Refresh and recalculate the schema.voidsetFormatPrefix(String formatPrefix)voidsetPatternFlags(int patternFlags)voidsetSchema(RecordTextSchema<?> schema)Sets the record schema of the source.-
Methods inherited from class com.pervasive.datarush.operators.io.textfile.AbstractRegexLogFormat
analyzeFormat, getFormatPattern, getLogType, isSplittable, setAnalysis, setFormatPattern
-
-
-
-
Field Detail
-
schema
protected RecordTextSchema<?> schema
-
-
Constructor Detail
-
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 Detail
-
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:LogFormatGets 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:AbstractRegexLogFormatGets the record schema of the source.- Specified by:
getSchemain classAbstractRegexLogFormat- Returns:
- the record schema of the source
-
refreshSchema
protected void refreshSchema()
Description copied from class:AbstractRegexLogFormatRefresh and recalculate the schema. This is usually done after changing a setting.- Specified by:
refreshSchemain classAbstractRegexLogFormat
-
createParser
public DataFormat.DataParser createParser(ParsingOptions options, CharsetEncoding charEncoding, String newline)
-
-