@InterfaceAudience.Private @InterfaceStability.Evolving public class FixedLengthRecordReader extends RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>
Constructor and Description |
---|
FixedLengthRecordReader(int recordLength) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the record reader.
|
org.apache.hadoop.io.LongWritable |
getCurrentKey()
Get the current key
|
org.apache.hadoop.io.BytesWritable |
getCurrentValue()
Get the current value.
|
long |
getPos() |
float |
getProgress()
The current progress of the record reader through its data.
|
void |
initialize(org.apache.hadoop.conf.Configuration job,
long splitStart,
long splitLength,
org.apache.hadoop.fs.Path file) |
void |
initialize(InputSplit genericSplit,
TaskAttemptContext context)
Called once at initialization.
|
boolean |
nextKeyValue()
Read the next key, value pair.
|
public void initialize(InputSplit genericSplit, TaskAttemptContext context) throws IOException
RecordReader
initialize
in class RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>
genericSplit
- the split that defines the range of records to readcontext
- the information about the taskIOException
public void initialize(org.apache.hadoop.conf.Configuration job, long splitStart, long splitLength, org.apache.hadoop.fs.Path file) throws IOException
IOException
public boolean nextKeyValue() throws IOException
RecordReader
nextKeyValue
in class RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>
IOException
public org.apache.hadoop.io.LongWritable getCurrentKey()
RecordReader
getCurrentKey
in class RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>
public org.apache.hadoop.io.BytesWritable getCurrentValue()
RecordReader
getCurrentValue
in class RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>
public float getProgress() throws IOException
RecordReader
getProgress
in class RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>
IOException
public void close() throws IOException
RecordReader
close
in interface Closeable
close
in interface AutoCloseable
close
in class RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>
IOException
public long getPos()
Copyright © 2016 Apache Software Foundation. All Rights Reserved.