public class BaseLogParser extends Object implements LogParser
LogParser. It wraps a
SingleLineParser from the Configuration to parse a log
dir/file.| Constructor and Description |
|---|
BaseLogParser() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Release the resource used by the ParserUtil.
|
void |
init(org.apache.hadoop.conf.Configuration config,
HistorySkylineStore skylineStore)
Initializing the LogParser, including loading solver parameters from
configuration file.
|
void |
parseLine(String logLine,
Map<String,JobMetaData> jobMetas,
Map<RecurrenceId,List<ResourceSkyline>> skylineRecords) |
void |
parseStream(InputStream logs)
Parses each line in the log stream, and adds extracted
ResourceSkylines to the SkylineStore. |
public void init(org.apache.hadoop.conf.Configuration config,
HistorySkylineStore skylineStore)
throws ResourceEstimatorException
LogParserinit in interface LogParserconfig - Configuration for the LogParser.skylineStore - the HistorySkylineStore which stores recurring
pipeline's ResourceSkylines.ResourceEstimatorException - if initialization of a
SingleLineParser fails.public void parseLine(String logLine, Map<String,JobMetaData> jobMetas, Map<RecurrenceId,List<ResourceSkyline>> skylineRecords) throws DataFieldNotFoundException, ParseException
public final void parseStream(InputStream logs) throws SkylineStoreException, IOException
LogParserResourceSkylines to the SkylineStore.parseStream in interface LogParserlogs - the stream of input logs.SkylineStoreException - if it fails to addHistory extracted
ResourceSkylines to the SkylineStore.IOException - if it fails to read from the InputStream.public final void close()
close in interface AutoCloseableclose in interface LogParserCopyright © 2019 Apache Software Foundation. All Rights Reserved.