public class ComposableRecordReader extends BaseRecordReader
listeners
APPEND_LABEL, LABELS, NAME_SPACE
Constructor and Description |
---|
ComposableRecordReader(RecordReader... readers) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
Configuration |
getConf()
Return the configuration used by this object.
|
java.util.List<java.lang.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.
|
java.util.List<Record> |
loadFromMetaData(java.util.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) |
java.util.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 |
java.util.List<Writable> |
record(java.net.URI uri,
java.io.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.
|
getListeners, invokeListeners, setListeners, setListeners
public ComposableRecordReader(RecordReader... readers)
public void initialize(InputSplit split) throws java.io.IOException, java.lang.InterruptedException
RecordReader
split
- the split that defines the range of records to readjava.io.IOException
java.lang.InterruptedException
public void initialize(Configuration conf, InputSplit split) throws java.io.IOException, java.lang.InterruptedException
RecordReader
conf
- a configuration for initializationsplit
- the split that defines the range of records to readjava.io.IOException
java.lang.InterruptedException
public java.util.List<Writable> next()
RecordReader
public boolean hasNext()
RecordReader
public java.util.List<java.lang.String> getLabels()
RecordReader
public void close() throws java.io.IOException
java.io.IOException
public void setConf(Configuration conf)
Configurable
public Configuration getConf()
Configurable
public void reset()
RecordReader
public java.util.List<Writable> record(java.net.URI uri, java.io.DataInputStream dataInputStream) throws java.io.IOException
RecordReader
RecordReader.next()
the internal state of the RecordReader is not modified
Implementations of this method should not close the DataInputStreamjava.io.IOException
- if error occurs during reading from the input streampublic Record nextRecord()
RecordReader
RecordReader.next()
, but returns a Record
object, that may include metadata such as the source
of the datapublic Record loadFromMetaData(RecordMetaData recordMetaData) throws java.io.IOException
RecordReader
RecordMetaData
instanceRecordReader.loadFromMetaData(List)
recordMetaData
- Metadata for the record that we want to load fromjava.io.IOException
- If I/O error occurs during loadingpublic java.util.List<Record> loadFromMetaData(java.util.List<RecordMetaData> recordMetaDatas) throws java.io.IOException
RecordReader
RecordMetaData
instancesrecordMetaDatas
- Metadata for the records that we want to load fromjava.io.IOException
- If I/O error occurs during loading