Class AbstractRegexLogFormat.RegexParser
- All Implemented Interfaces:
DataFormat.DataParser
- Enclosing class:
- AbstractRegexLogFormat
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected final Stringprotected TokenParser[]protected Patternprotected StringBuilderprotected Pattern -
Constructor Summary
ConstructorsConstructorDescriptionRegexParser(ParsingOptions options, CharsetEncoding charEncoding, String newline, Pattern pattern, Pattern startPattern) -
Method Summary
Modifier and TypeMethodDescriptionvoidbindOutput(RecordSettable target) Called to provide the target port onto which parsed records are pushed.voidCalled to convert an input split into records.protected voidvoidrelease()Called to signal that parsing is complete.
-
Field Details
-
pattern
-
startPattern
-
recordBuffer
-
parsers
-
buffer
protected final int buffer -
newline
-
-
Constructor Details
-
RegexParser
public RegexParser(ParsingOptions options, CharsetEncoding charEncoding, String newline, Pattern pattern, Pattern startPattern)
-
-
Method Details
-
bindOutput
Description copied from interface:DataFormat.DataParserCalled to provide the target port onto which parsed records are pushed.This method is called once, before any any calls to
DataFormat.DataParser.parseSplit(SplitParsingContext)are made. Any one-time initialization for the parser should be performed within the implementation of this method.- Specified by:
bindOutputin interfaceDataFormat.DataParser- Parameters:
target- the output port which receives parsed records
-
parseSplit
Description copied from interface:DataFormat.DataParserCalled to convert an input split into records.This method may be called one or more times, once for each split needing to be parsed. The implementation is expected to publish all records found within the split to the output passed to
DataFormat.DataParser.bindOutput(RecordSettable). Parsing errors and exceptions should be reported through the provided context.- Specified by:
parseSplitin interfaceDataFormat.DataParser
-
processRecord
-
release
public void release()Description copied from interface:DataFormat.DataParserCalled to signal that parsing is complete.This method is called once, after the last call to
DataFormat.DataParser.parseSplit(DataSplit). Any allocated resources which need to be released should be handled within the implementation of this method.- Specified by:
releasein interfaceDataFormat.DataParser
-