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 int
buffer
protected String
newline
protected TokenParser[]
parsers
protected Pattern
pattern
protected StringBuilder
recordBuffer
protected Pattern
startPattern
-
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 void
bindOutput(RecordSettable target)
Called to provide the target port onto which parsed records are pushed.void
parseSplit(SplitParsingContext ctx)
Called to convert an input split into records.protected void
processRecord(SplitParsingContext ctx)
void
release()
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.DataParser
Called 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:
bindOutput
in interfaceDataFormat.DataParser
- Parameters:
target
- the output port which receives parsed records
-
parseSplit
public void parseSplit(SplitParsingContext ctx)
Description copied from interface:DataFormat.DataParser
Called 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:
parseSplit
in interfaceDataFormat.DataParser
-
processRecord
protected void processRecord(SplitParsingContext ctx)
-
release
public void release()
Description copied from interface:DataFormat.DataParser
Called 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:
release
in interfaceDataFormat.DataParser
-
-