@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
RecordReaderinitialize 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 taskIOExceptionpublic void initialize(org.apache.hadoop.conf.Configuration job,
long splitStart,
long splitLength,
org.apache.hadoop.fs.Path file)
throws IOException
IOExceptionpublic boolean nextKeyValue()
throws IOException
RecordReadernextKeyValue in class RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>IOExceptionpublic org.apache.hadoop.io.LongWritable getCurrentKey()
RecordReadergetCurrentKey in class RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>public org.apache.hadoop.io.BytesWritable getCurrentValue()
RecordReadergetCurrentValue in class RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>public float getProgress()
throws IOException
RecordReadergetProgress in class RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>IOExceptionpublic void close()
throws IOException
RecordReaderclose in interface Closeableclose in interface AutoCloseableclose in class RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.BytesWritable>IOExceptionpublic long getPos()
Copyright © 2022 Apache Software Foundation. All rights reserved.