@InterfaceAudience.Private @InterfaceStability.Evolving public class FixedLengthRecordReader extends Object implements RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>
Constructor and Description |
---|
FixedLengthRecordReader(org.apache.hadoop.conf.Configuration job,
FileSplit split,
int recordLength) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this
InputSplit to future operations. |
org.apache.hadoop.io.LongWritable |
createKey()
Create an object of the appropriate type to be used as a key.
|
org.apache.hadoop.io.BytesWritable |
createValue()
Create an object of the appropriate type to be used as a value.
|
long |
getPos()
Returns the current position in the input.
|
float |
getProgress()
How much of the input has the
RecordReader consumed i.e. |
boolean |
next(org.apache.hadoop.io.LongWritable key,
org.apache.hadoop.io.BytesWritable value)
Reads the next key/value pair from the input for processing.
|
public FixedLengthRecordReader(org.apache.hadoop.conf.Configuration job, FileSplit split, int recordLength) throws IOException
IOException
public org.apache.hadoop.io.LongWritable createKey()
RecordReader
createKey
in interface RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>
public org.apache.hadoop.io.BytesWritable createValue()
RecordReader
createValue
in interface RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>
public boolean next(org.apache.hadoop.io.LongWritable key, org.apache.hadoop.io.BytesWritable value) throws IOException
RecordReader
next
in interface RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>
key
- the key to read data intovalue
- the value to read data intoIOException
public float getProgress() throws IOException
RecordReader
RecordReader
consumed i.e.
has been processed by?getProgress
in interface RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>
0.0
to 1.0
.IOException
public long getPos() throws IOException
RecordReader
getPos
in interface RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>
IOException
public void close() throws IOException
RecordReader
InputSplit
to future operations.close
in interface RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>
IOException
Copyright © 2017 Apache Software Foundation. All Rights Reserved.