public class VideoRecordReader extends BaseRecordReader implements SequenceRecordReader
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
HEIGHT |
static java.lang.String |
IMAGE_LOADER |
protected InputSplit |
inputSplit |
static java.lang.String |
WIDTH |
listenersAPPEND_LABEL, LABELS, NAME_SPACE| Constructor and Description |
|---|
VideoRecordReader() |
VideoRecordReader(int height,
int width)
Load the record reader with the given height and width
|
VideoRecordReader(int height,
int width,
boolean appendLabel) |
VideoRecordReader(int height,
int width,
boolean appendLabel,
java.util.List<java.lang.String> labels) |
VideoRecordReader(int height,
int width,
java.util.List<java.lang.String> labels)
Load the record reader with the given height and width
|
| 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<SequenceRecord> |
loadSequenceFromMetaData(java.util.List<RecordMetaData> recordMetaDatas)
Load multiple sequence records from the given a list of
RecordMetaData instances |
SequenceRecord |
loadSequenceFromMetaData(RecordMetaData recordMetaData)
Load a single sequence 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 SequenceRecordReader.loadSequenceFromMetaData(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 |
SequenceRecord |
nextSequence()
Similar to
SequenceRecordReader.sequenceRecord(), 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
|
java.util.List<java.util.List<Writable>> |
sequenceRecord()
Returns a sequence record.
|
java.util.List<java.util.List<Writable>> |
sequenceRecord(java.net.URI uri,
java.io.DataInputStream dataInputStream)
Load a sequence 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 |
setConf(Configuration conf)
Set the configuration to be used by this object.
|
getListeners, invokeListeners, setListeners, setListenersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetListeners, setListeners, setListenerspublic static final java.lang.String HEIGHT
public static final java.lang.String WIDTH
public static final java.lang.String IMAGE_LOADER
protected InputSplit inputSplit
public VideoRecordReader()
public VideoRecordReader(int height,
int width,
java.util.List<java.lang.String> labels)
height - the height to loadwidth - the width loadpublic VideoRecordReader(int height,
int width,
boolean appendLabel,
java.util.List<java.lang.String> labels)
public VideoRecordReader(int height,
int width)
height - the height to loadwidth - the width loadpublic VideoRecordReader(int height,
int width,
boolean appendLabel)
public void initialize(InputSplit split) throws java.io.IOException, java.lang.InterruptedException
RecordReaderinitialize in interface RecordReadersplit - the split that defines the range of records to readjava.io.IOExceptionjava.lang.InterruptedExceptionpublic void initialize(Configuration conf, InputSplit split) throws java.io.IOException, java.lang.InterruptedException
RecordReaderinitialize in interface RecordReaderconf - a configuration for initializationsplit - the split that defines the range of records to readjava.io.IOExceptionjava.lang.InterruptedExceptionpublic java.util.List<Writable> next()
RecordReadernext in interface RecordReaderpublic boolean hasNext()
RecordReaderhasNext in interface RecordReaderpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic java.util.List<java.util.List<Writable>> sequenceRecord()
SequenceRecordReadersequenceRecord in interface SequenceRecordReaderpublic void setConf(Configuration conf)
ConfigurablesetConf in interface Configurablepublic Configuration getConf()
ConfigurablegetConf in interface Configurablepublic java.util.List<java.lang.String> getLabels()
RecordReadergetLabels in interface RecordReaderpublic void reset()
RecordReaderreset in interface RecordReaderpublic java.util.List<Writable> record(java.net.URI uri, java.io.DataInputStream dataInputStream) throws java.io.IOException
RecordReaderRecordReader.next() the internal state of the RecordReader is not modified
Implementations of this method should not close the DataInputStreamrecord in interface RecordReaderjava.io.IOException - if error occurs during reading from the input streampublic Record nextRecord()
RecordReaderRecordReader.next(), but returns a Record object, that may include metadata such as the source
of the datanextRecord in interface RecordReaderpublic Record loadFromMetaData(RecordMetaData recordMetaData) throws java.io.IOException
RecordReaderRecordMetaData instanceRecordReader.loadFromMetaData(List)loadFromMetaData in interface RecordReaderrecordMetaData - 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
RecordReaderRecordMetaData instancesloadFromMetaData in interface RecordReaderrecordMetaDatas - Metadata for the records that we want to load fromjava.io.IOException - If I/O error occurs during loadingpublic java.util.List<java.util.List<Writable>> sequenceRecord(java.net.URI uri, java.io.DataInputStream dataInputStream) throws java.io.IOException
SequenceRecordReaderRecordReader.next() the internal state of the RecordReader is not modified
Implementations of this method should not close the DataInputStreamsequenceRecord in interface SequenceRecordReaderjava.io.IOException - if error occurs during reading from the input streampublic SequenceRecord nextSequence()
SequenceRecordReaderSequenceRecordReader.sequenceRecord(), but returns a Record object, that may include metadata such as the source
of the datanextSequence in interface SequenceRecordReaderpublic SequenceRecord loadSequenceFromMetaData(RecordMetaData recordMetaData) throws java.io.IOException
SequenceRecordReaderRecordMetaData instanceSequenceRecordReader.loadSequenceFromMetaData(List)loadSequenceFromMetaData in interface SequenceRecordReaderrecordMetaData - Metadata for the sequence record that we want to load fromjava.io.IOException - If I/O error occurs during loadingpublic java.util.List<SequenceRecord> loadSequenceFromMetaData(java.util.List<RecordMetaData> recordMetaDatas) throws java.io.IOException
SequenceRecordReaderRecordMetaData instancesloadSequenceFromMetaData in interface SequenceRecordReaderrecordMetaDatas - Metadata for the records that we want to load fromjava.io.IOException - If I/O error occurs during loading