public class ReadLog extends AbstractTextReader
encodingProps
options, output
Constructor and Description |
---|
ReadLog()
Reads an empty source with default settings.
|
ReadLog(ByteSource source)
Reads the specified data source using default
options.
|
ReadLog(Path path)
Reads the file specified by the path as log text
using default options.
|
ReadLog(String pattern)
Reads all paths matching the specified pattern
as log text using default options.
|
Modifier and Type | Method and Description |
---|---|
ReadLog |
clone()
Creates a copy of the reader with identical settings.
|
protected DataFormat |
computeFormat(CompositionContext ctx)
Determines the data format for the source.
|
FormatAnalyzer.FormatAnalysis |
discoverMetadata(FileClient ctx) |
LogFormat |
getLogFormat()
Gets the log format class which should be used when parsing
the logs.
|
String |
getLogPattern()
Gets the formatting pattern to use when parsing the log.
|
SupportedLogType |
getLogType()
Gets the type of log this operator will read.
|
String |
getNewline()
Gets the newline characters to use when parsing the log.
|
void |
setAutoDiscoverFormat(boolean enabled)
In supported log types performs schema discovery if
logPattern is not set or additional information is required.
|
void |
setAutoDiscoverNewline(boolean enabled)
Configures whether the reader attempts to discover the
newline style (UNIX or DOS) used in the source.
|
void |
setLogFormat(LogFormat logFormat)
Sets the log format class which should be used when parsing
the logs.
|
void |
setLogPattern(String logPattern)
Sets the formatting pattern to use when parsing the log.
|
void |
setLogType(SupportedLogType logType)
Sets the type of log this operator will read.
|
void |
setNewline(String newline)
Sets the newline characters to use when parsing the log.
|
getCharset, getCharsetName, getDecodeBuffer, getEncoding, getErrorAction, getReplacement, setCharset, setCharsetName, setDecodeBuffer, setEncoding, setErrorAction, setReplacement
compose, getExtraFieldAction, getFieldErrorAction, getFieldLengthThreshold, getIncludeSourceInfo, getMissingFieldAction, getOutput, getParseOptions, getPessimisticSplitting, getReadBuffer, getReadOnClient, getRecordWarningThreshold, getSelectedFields, getSource, getSplitOptions, getUseMetadata, setExtraFieldAction, setFieldErrorAction, setFieldLengthThreshold, setIncludeSourceInfo, setMissingFieldAction, setParseErrorAction, setParseOptions, setPessimisticSplitting, setReadBuffer, setReadOnClient, setRecordWarningThreshold, setSelectedFields, setSelectedFields, setSource, setSource, setSource, setSplitOptions, setUseMetadata
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
disableParallelism, getInputPorts, getOutputPorts
public ReadLog()
AbstractReader.setSource(ByteSource)
public ReadLog(String pattern)
pattern
- a path-matching patternFileClient.matchPaths(String)
public ReadLog(Path path)
path
- the path to readpublic ReadLog(ByteSource source)
source
- the data source to readpublic ReadLog clone()
public SupportedLogType getLogType()
public void setLogType(SupportedLogType logType)
logType
- the type of log to readpublic LogFormat getLogFormat()
public void setLogFormat(LogFormat logFormat)
logFormat
- the log format class to usepublic String getLogPattern()
public void setLogPattern(String logPattern)
logPattern
- the format pattern to use for parsingpublic String getNewline()
public void setNewline(String newline)
newline
- the newline characters to use for parsingpublic void setAutoDiscoverFormat(boolean enabled)
enabled
- indicates whether to enable format discoverypublic void setAutoDiscoverNewline(boolean enabled)
enabled
- indicates whether to enable newline discoverypublic FormatAnalyzer.FormatAnalysis discoverMetadata(FileClient ctx)
protected DataFormat computeFormat(CompositionContext ctx)
AbstractReader
ReadSource
operator. If an
implementation supports schema discovery, it must be
performed in this method.computeFormat
in class AbstractReader
ctx
- the composition context for the current invocation
of AbstractReader.compose(CompositionContext)
Copyright © 2021 Actian Corporation. All rights reserved.