Package org.apache.druid.data.input.impl
Class LinesReader
java.lang.Object
org.apache.druid.data.input.IntermediateRowParsingReader<T>
org.apache.druid.data.input.TextReader<String>
org.apache.druid.data.input.TextReader.Strings
org.apache.druid.data.input.impl.LinesReader
- All Implemented Interfaces:
InputEntityReader
Reader for
LinesInputFormat.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.druid.data.input.TextReader
TextReader.Bytes, TextReader.Strings -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of header lines to skip.booleanReturns true if the file format needs to process a header line.parseInputRows(String intermediateRow) Parses the given line into a list ofInputRows.voidprocessHeaderLine(String line) Processes a header line.Converts the given intermediate row into aMap.Methods inherited from class org.apache.druid.data.input.TextReader.Strings
makeSourceIteratorMethods inherited from class org.apache.druid.data.input.TextReader
findOrCreateInputRowSignature, getInputRowSchema, intermediateRowIteratorWithMetadata, sourceMethods inherited from class org.apache.druid.data.input.IntermediateRowParsingReader
intermediateRowAsString, intermediateRowIterator, read, sample
-
Method Details
-
parseInputRows
Description copied from class:TextReaderParses the given line into a list ofInputRows. Note that some file formats can explode a single line of input into multiple inputRows. This method will be called afterTextReader.getNumHeaderLinesToSkip()andTextReader.processHeaderLine(T).- Specified by:
parseInputRowsin classTextReader<String>- Throws:
ParseException- if it cannot parse the given intermediateRow properly
-
toMap
Description copied from class:IntermediateRowParsingReaderConverts the given intermediate row into aMap. The returned JSON will be used by InputSourceSampler. Implementations can use any method to convert the given row into a Map. This should return a non-empty list with the same size of the list returned byIntermediateRowParsingReader.parseInputRows(T)or the returned objects will be discarded- Specified by:
toMapin classIntermediateRowParsingReader<String>
-
getNumHeaderLinesToSkip
public int getNumHeaderLinesToSkip()Description copied from class:TextReaderReturns the number of header lines to skip.TextReader.processHeaderLine(T)will be called as many times as the returned number.- Specified by:
getNumHeaderLinesToSkipin classTextReader<String>
-
needsToProcessHeaderLine
public boolean needsToProcessHeaderLine()Description copied from class:TextReaderReturns true if the file format needs to process a header line. This method will be called after skipping lines as many asTextReader.getNumHeaderLinesToSkip().- Specified by:
needsToProcessHeaderLinein classTextReader<String>
-
processHeaderLine
Description copied from class:TextReaderProcesses a header line. This will be called ifTextReader.needsToProcessHeaderLine()= true.- Specified by:
processHeaderLinein classTextReader<String>
-