java.lang.Object
com.pervasive.datarush.operators.io.textfile.AbstractRegexLogFormat
com.pervasive.datarush.operators.io.textfile.GenericLogFormat
- All Implemented Interfaces:
LogFormat
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
FieldsFields inherited from class com.pervasive.datarush.operators.io.textfile.AbstractRegexLogFormat
formatPattern, logType -
Constructor Summary
ConstructorsConstructorDescriptionCreate 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
Modifier and TypeMethodDescriptioncreateParser(ParsingOptions options, CharsetEncoding charEncoding, String newline) intGets the number of matching groups in the format pattern.intGets the record schema of the source.getType()Gets the record type associated with the format.protected voidRefresh 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 Details
-
schema
-
-
Constructor Details
-
GenericLogFormat
public GenericLogFormat()Create a generic log format to read data using a regular expression. -
GenericLogFormat
Create a generic log format to read data using a regular expression- Parameters:
formatPattern- the regular expression used in parsing
-
-
Method Details
-
setSchema
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
-
setFormatPrefix
-
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
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)
-