- 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.DataParser
createParser(ParsingOptions options, CharsetEncoding charEncoding, String newline)
String
getFormatPrefix()
int
getGroupCount()
Gets the number of matching groups in the format pattern.int
getPatternFlags()
RecordTextSchema<?>
getSchema()
Gets the record schema of the source.RecordTokenType
getType()
Gets the record type associated with the format.protected void
refreshSchema()
Refresh and recalculate the schema.void
setFormatPrefix(String formatPrefix)
void
setPatternFlags(int patternFlags)
void
setSchema(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: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 classAbstractRegexLogFormat
- 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 classAbstractRegexLogFormat
-
createParser
public DataFormat.DataParser createParser(ParsingOptions options, CharsetEncoding charEncoding, String newline)
-
-