public abstract class BaseCodecRecordReader extends FileRecordReader implements SequenceRecordReader
| Modifier and Type | Field and Description |
|---|---|
protected int |
cols |
static java.lang.String |
COLUMNS |
protected double |
framesPerSecond |
static java.lang.String |
NAME_SPACE |
protected int |
numFrames |
protected boolean |
ravel |
static java.lang.String |
RAVEL |
protected int |
rows |
static java.lang.String |
ROWS |
static java.lang.String |
START_FRAME |
protected int |
startFrame |
static java.lang.String |
TIME_SLICE |
static java.lang.String |
TOTAL_FRAMES |
protected int |
totalFrames |
static java.lang.String |
VIDEO_DURATION |
protected double |
videoLength |
appendLabel, conf, currentFile, inputSplit, iter, labelslistenersAPPEND_LABEL, LABELS| Constructor and Description |
|---|
BaseCodecRecordReader() |
| Modifier and Type | Method and Description |
|---|---|
Configuration |
getConf()
Return the configuration used by this object.
|
boolean |
hasNext()
Whether there are anymore records
|
void |
initialize(Configuration conf,
InputSplit split)
Called once at initialization.
|
protected abstract java.util.List<java.util.List<Writable>> |
loadData(java.io.File file,
java.io.InputStream inputStream) |
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
|
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 |
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.
|
close, doInitialize, getCurrentLabel, getLabels, initialize, loadFromMetaData, loadFromMetaData, nextRecord, reset, setLabelsgetListeners, invokeListeners, setListeners, setListenersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLabels, getListeners, initialize, loadFromMetaData, loadFromMetaData, nextRecord, reset, setListeners, setListenersprotected int startFrame
protected int numFrames
protected int totalFrames
protected double framesPerSecond
protected double videoLength
protected int rows
protected int cols
protected boolean ravel
public static final java.lang.String NAME_SPACE
public static final java.lang.String ROWS
public static final java.lang.String COLUMNS
public static final java.lang.String START_FRAME
public static final java.lang.String TOTAL_FRAMES
public static final java.lang.String TIME_SLICE
public static final java.lang.String RAVEL
public static final java.lang.String VIDEO_DURATION
public java.util.List<java.util.List<Writable>> sequenceRecord()
SequenceRecordReadersequenceRecord in interface SequenceRecordReaderpublic 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 streamprotected abstract java.util.List<java.util.List<Writable>> loadData(java.io.File file, java.io.InputStream inputStream) throws java.io.IOException
java.io.IOExceptionpublic void initialize(Configuration conf, InputSplit split) throws java.io.IOException, java.lang.InterruptedException
RecordReaderinitialize in interface RecordReaderinitialize in class FileRecordReaderconf - 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 RecordReadernext in class FileRecordReaderpublic 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 RecordReaderrecord in class FileRecordReaderjava.io.IOException - if error occurs during reading from the input streampublic boolean hasNext()
RecordReaderhasNext in interface RecordReaderhasNext in class FileRecordReaderpublic void setConf(Configuration conf)
ConfigurablesetConf in interface ConfigurablesetConf in class FileRecordReaderpublic Configuration getConf()
ConfigurablegetConf in interface ConfigurablegetConf in class FileRecordReaderpublic 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