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 |
listeners
APPEND_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, setListeners
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getListeners, setListeners, setListeners
public 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
RecordReader
initialize
in interface 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
initialize
in interface 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
next
in interface RecordReader
public boolean hasNext()
RecordReader
hasNext
in interface RecordReader
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public java.util.List<java.util.List<Writable>> sequenceRecord()
SequenceRecordReader
sequenceRecord
in interface SequenceRecordReader
public void setConf(Configuration conf)
Configurable
setConf
in interface Configurable
public Configuration getConf()
Configurable
getConf
in interface Configurable
public java.util.List<java.lang.String> getLabels()
RecordReader
getLabels
in interface RecordReader
public void reset()
RecordReader
reset
in interface 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 DataInputStreamrecord
in interface RecordReader
java.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 datanextRecord
in interface RecordReader
public Record loadFromMetaData(RecordMetaData recordMetaData) throws java.io.IOException
RecordReader
RecordMetaData
instanceRecordReader.loadFromMetaData(List)
loadFromMetaData
in interface RecordReader
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
instancesloadFromMetaData
in interface RecordReader
recordMetaDatas
- 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
SequenceRecordReader
RecordReader.next()
the internal state of the RecordReader is not modified
Implementations of this method should not close the DataInputStreamsequenceRecord
in interface SequenceRecordReader
java.io.IOException
- if error occurs during reading from the input streampublic SequenceRecord nextSequence()
SequenceRecordReader
SequenceRecordReader.sequenceRecord()
, but returns a Record
object, that may include metadata such as the source
of the datanextSequence
in interface SequenceRecordReader
public SequenceRecord loadSequenceFromMetaData(RecordMetaData recordMetaData) throws java.io.IOException
SequenceRecordReader
RecordMetaData
instanceSequenceRecordReader.loadSequenceFromMetaData(List)
loadSequenceFromMetaData
in interface SequenceRecordReader
recordMetaData
- 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
SequenceRecordReader
RecordMetaData
instancesloadSequenceFromMetaData
in interface SequenceRecordReader
recordMetaDatas
- Metadata for the records that we want to load fromjava.io.IOException
- If I/O error occurs during loading