public class RegexLineRecordReader extends LineRecordReader
Pattern and Matcher.| Modifier and Type | Field and Description |
|---|---|
static String |
SKIP_NUM_LINES |
conf, inputSplit, lineIndex, locations, splitIndexlistenersAPPEND_LABEL, LABELS, NAME_SPACE| Constructor and Description |
|---|
RegexLineRecordReader(String regex,
int skipNumLines) |
| Modifier and Type | Method and Description |
|---|---|
void |
initialize(Configuration conf,
InputSplit split)
Called once at initialization.
|
List<Record> |
loadFromMetaData(List<RecordMetaData> recordMetaDatas)
Load multiple records from the given a list of
RecordMetaData instances |
Record |
loadFromMetaData(RecordMetaData recordMetaData)
Load a single record from the given
RecordMetaData instanceNote: that for data that isn't splittable (i.e., text data that needs to be scanned/split), it is more efficient to load multiple records at once using RecordReader.loadFromMetaData(List) |
List<Writable> |
next()
Get the next record
|
Record |
nextRecord()
Similar to
RecordReader.next(), but returns a Record object, that may include metadata such as the source
of the data |
List<Writable> |
record(URI uri,
DataInputStream dataInputStream)
Load the record from the given DataInputStream
Unlike
RecordReader.next() the internal state of the RecordReader is not modified
Implementations of this method should not close the DataInputStream |
void |
reset()
Reset record reader iterator
|
close, closeIfRequired, getConf, getIterator, getLabels, hasNext, initialize, onLocationOpen, setConfbatchesSupported, getListeners, invokeListeners, next, setListeners, setListenerspublic static final String SKIP_NUM_LINES
public RegexLineRecordReader(String regex, int skipNumLines)
public void initialize(Configuration conf, InputSplit split) throws IOException, InterruptedException
RecordReaderinitialize in interface RecordReaderinitialize in class LineRecordReaderconf - a configuration for initializationsplit - the split that defines the range of records to readIOExceptionInterruptedExceptionpublic List<Writable> next()
RecordReadernext in interface RecordReadernext in class LineRecordReaderpublic List<Writable> record(URI uri, DataInputStream dataInputStream) throws IOException
RecordReaderRecordReader.next() the internal state of the RecordReader is not modified
Implementations of this method should not close the DataInputStreamrecord in interface RecordReaderrecord in class LineRecordReaderIOException - if error occurs during reading from the input streampublic void reset()
RecordReaderreset in interface RecordReaderreset in class LineRecordReaderpublic Record nextRecord()
RecordReaderRecordReader.next(), but returns a Record object, that may include metadata such as the source
of the datanextRecord in interface RecordReadernextRecord in class LineRecordReaderpublic Record loadFromMetaData(RecordMetaData recordMetaData) throws IOException
RecordReaderRecordMetaData instanceRecordReader.loadFromMetaData(List)loadFromMetaData in interface RecordReaderloadFromMetaData in class LineRecordReaderrecordMetaData - Metadata for the record that we want to load fromIOException - If I/O error occurs during loadingpublic List<Record> loadFromMetaData(List<RecordMetaData> recordMetaDatas) throws IOException
RecordReaderRecordMetaData instancesloadFromMetaData in interface RecordReaderloadFromMetaData in class LineRecordReaderrecordMetaDatas - Metadata for the records that we want to load fromIOException - If I/O error occurs during loadingCopyright © 2017. All rights reserved.