public class JacksonRecordReader extends Object implements RecordReader
FieldSelection. This complicates configuration for simple structures
(user has to specify every field to load), however this allows us to parse files where:
a: b: c: d: someValuePathLabelGeneratorAPPEND_LABEL, LABELS, NAME_SPACE| Constructor and Description |
|---|
JacksonRecordReader(FieldSelection selection,
com.fasterxml.jackson.databind.ObjectMapper mapper) |
JacksonRecordReader(FieldSelection selection,
com.fasterxml.jackson.databind.ObjectMapper mapper,
boolean shuffle) |
JacksonRecordReader(FieldSelection selection,
com.fasterxml.jackson.databind.ObjectMapper mapper,
boolean shuffle,
long rngSeed,
PathLabelGenerator labelGenerator) |
JacksonRecordReader(FieldSelection selection,
com.fasterxml.jackson.databind.ObjectMapper mapper,
boolean shuffle,
long rngSeed,
PathLabelGenerator labelGenerator,
int labelPosition) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Configuration |
getConf()
Return the configuration used by this object.
|
List<String> |
getLabels()
List of label strings
|
boolean |
hasNext()
Whether there are anymore records
|
void |
initialize(Configuration conf,
InputSplit split)
Called once at initialization.
|
void |
initialize(InputSplit split)
Called once at initialization.
|
Collection<Writable> |
next()
Get the next record
|
Collection<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
|
void |
setConf(Configuration conf)
Set the configuration to be used by this object.
|
public JacksonRecordReader(FieldSelection selection, com.fasterxml.jackson.databind.ObjectMapper mapper)
public JacksonRecordReader(FieldSelection selection, com.fasterxml.jackson.databind.ObjectMapper mapper, boolean shuffle)
public JacksonRecordReader(FieldSelection selection, com.fasterxml.jackson.databind.ObjectMapper mapper, boolean shuffle, long rngSeed, PathLabelGenerator labelGenerator)
public JacksonRecordReader(FieldSelection selection, com.fasterxml.jackson.databind.ObjectMapper mapper, boolean shuffle, long rngSeed, PathLabelGenerator labelGenerator, int labelPosition)
public void initialize(InputSplit split) throws IOException, InterruptedException
RecordReaderinitialize in interface RecordReadersplit - the split that defines the range of records to readIOExceptionInterruptedExceptionpublic void initialize(Configuration conf, InputSplit split) throws IOException, InterruptedException
RecordReaderinitialize in interface RecordReaderconf - a configuration for initializationsplit - the split that defines the range of records to readIOExceptionInterruptedExceptionpublic Collection<Writable> next()
RecordReadernext in interface RecordReaderpublic boolean hasNext()
RecordReaderhasNext in interface RecordReaderpublic List<String> getLabels()
RecordReadergetLabels in interface RecordReaderpublic void reset()
RecordReaderreset in interface RecordReaderpublic Collection<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 RecordReaderIOException - if error occurs during reading from the input streampublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void setConf(Configuration conf)
ConfigurablesetConf in interface Configurablepublic Configuration getConf()
ConfigurablegetConf in interface ConfigurableCopyright © 2016. All rights reserved.