protected class AbstractRegexLogFormat.RegexParser extends Object implements DataFormat.DataParser
Modifier and Type | Field and Description |
---|---|
protected int |
buffer |
protected String |
newline |
protected TokenParser[] |
parsers |
protected Pattern |
pattern |
protected StringBuilder |
recordBuffer |
protected Pattern |
startPattern |
Constructor and Description |
---|
RegexParser(ParsingOptions options,
CharsetEncoding charEncoding,
String newline,
Pattern pattern,
Pattern startPattern) |
Modifier and Type | Method and 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.
|
protected Pattern pattern
protected Pattern startPattern
protected StringBuilder recordBuffer
protected TokenParser[] parsers
protected final int buffer
protected final String newline
public RegexParser(ParsingOptions options, CharsetEncoding charEncoding, String newline, Pattern pattern, Pattern startPattern)
public void bindOutput(RecordSettable target)
DataFormat.DataParser
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.
bindOutput
in interface DataFormat.DataParser
target
- the output port which receives
parsed recordspublic void parseSplit(SplitParsingContext ctx)
DataFormat.DataParser
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.
parseSplit
in interface DataFormat.DataParser
protected void processRecord(SplitParsingContext ctx)
public void release()
DataFormat.DataParser
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.
release
in interface DataFormat.DataParser
Copyright © 2016 Actian Corporation. All rights reserved.