Module datarush.library
Class AbstractRegexLogFormat.RegexParser
- java.lang.Object
-
- com.pervasive.datarush.operators.io.textfile.AbstractRegexLogFormat.RegexParser
-
- All Implemented Interfaces:
DataFormat.DataParser
- Enclosing class:
- AbstractRegexLogFormat
protected class AbstractRegexLogFormat.RegexParser extends Object implements DataFormat.DataParser
-
-
Field Summary
Fields Modifier and Type Field Description protected intbufferprotected Stringnewlineprotected TokenParser[]parsersprotected Patternpatternprotected StringBuilderrecordBufferprotected PatternstartPattern
-
Constructor Summary
Constructors Constructor Description RegexParser(ParsingOptions options, CharsetEncoding charEncoding, String newline, Pattern pattern, Pattern startPattern)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbindOutput(RecordSettable target)Called to provide the target port onto which parsed records are pushed.voidparseSplit(SplitParsingContext ctx)Called to convert an input split into records.protected voidprocessRecord(SplitParsingContext ctx)voidrelease()Called to signal that parsing is complete.
-
-
-
Field Detail
-
pattern
protected Pattern pattern
-
startPattern
protected Pattern startPattern
-
recordBuffer
protected StringBuilder recordBuffer
-
parsers
protected TokenParser[] parsers
-
buffer
protected final int buffer
-
newline
protected final String newline
-
-
Constructor Detail
-
RegexParser
public RegexParser(ParsingOptions options, CharsetEncoding charEncoding, String newline, Pattern pattern, Pattern startPattern)
-
-
Method Detail
-
bindOutput
public void bindOutput(RecordSettable target)
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
public void parseSplit(SplitParsingContext ctx)
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
protected void processRecord(SplitParsingContext ctx)
-
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
#parseSplit(DataSplit). Any allocated resources which need to be released should be handled within the implementation of this method.- Specified by:
releasein interfaceDataFormat.DataParser
-
-