|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.streaming.StreamBaseRecordReader
public abstract class StreamBaseRecordReader
Shared functionality for hadoopStreaming formats. A custom reader can be defined to be a RecordReader with the constructor below and is selected with the option bin/hadoopStreaming -inputreader ...
StreamLineRecordReader
,
StreamXmlRecordReader
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
LOG
|
Constructor Summary | |
---|---|
StreamBaseRecordReader(FSDataInputStream in,
FileSplit split,
Reporter reporter,
JobConf job,
FileSystem fs)
|
Method Summary | |
---|---|
void |
close()
Close this to future operations. |
WritableComparable |
createKey()
Create an object of the appropriate type to be used as a key. |
Writable |
createValue()
Create an object of the appropriate type to be used as the value. |
long |
getPos()
Returns the current position in the input. |
float |
getProgress()
How far has the reader gone through the input. |
abstract boolean |
next(Writable key,
Writable value)
Read a record. |
abstract void |
seekNextRecordBoundary()
Implementation should seek forward in_ to the first byte of the next record. |
void |
validateInput(JobConf job)
This implementation always returns true. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log LOG
Constructor Detail |
---|
public StreamBaseRecordReader(FSDataInputStream in, FileSplit split, Reporter reporter, JobConf job, FileSystem fs) throws IOException
IOException
Method Detail |
---|
public abstract boolean next(Writable key, Writable value) throws IOException
next
in interface RecordReader
key
- the key to read data intovalue
- the value to read data into
IOException
Writable.readFields(DataInput)
public void validateInput(JobConf job) throws IOException
IOException
public long getPos() throws IOException
getPos
in interface RecordReader
IOException
public void close() throws IOException
close
in interface RecordReader
IOException
public float getProgress() throws IOException
RecordReader
getProgress
in interface RecordReader
IOException
public WritableComparable createKey()
RecordReader
createKey
in interface RecordReader
public Writable createValue()
RecordReader
createValue
in interface RecordReader
public abstract void seekNextRecordBoundary() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |