@InterfaceAudience.Private @InterfaceStability.Unstable public static class IFile.Reader<K,V> extends Object
IFile.Reader
to read intermediate map-outputs.Modifier and Type | Field and Description |
---|---|
protected byte[] |
buffer |
protected int |
bufferSize |
long |
bytesRead |
protected int |
currentKeyLength |
protected int |
currentValueLength |
protected DataInputStream |
dataIn |
protected boolean |
eof |
protected long |
fileLength |
protected int |
recNo |
Constructor and Description |
---|
IFile.Reader(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path file,
org.apache.hadoop.io.compress.CompressionCodec codec,
Counters.Counter readsCounter)
Construct an IFile Reader.
|
IFile.Reader(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FSDataInputStream in,
long length,
org.apache.hadoop.io.compress.CompressionCodec codec,
Counters.Counter readsCounter)
Construct an IFile Reader.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
disableChecksumValidation() |
long |
getLength() |
long |
getPosition() |
boolean |
nextRawKey(org.apache.hadoop.io.DataInputBuffer key) |
void |
nextRawValue(org.apache.hadoop.io.DataInputBuffer value) |
protected boolean |
positionToNextRecord(DataInput dIn) |
void |
reset(int offset) |
public long bytesRead
protected final long fileLength
protected boolean eof
protected byte[] buffer
protected int bufferSize
protected DataInputStream dataIn
protected int recNo
protected int currentKeyLength
protected int currentValueLength
public IFile.Reader(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path file, org.apache.hadoop.io.compress.CompressionCodec codec, Counters.Counter readsCounter) throws IOException
conf
- Configuration Filefs
- FileSystemfile
- Path of the file to be opened. This file should have
checksum bytes for the data at the end of the file.codec
- codecreadsCounter
- Counter for records read from diskIOException
public IFile.Reader(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FSDataInputStream in, long length, org.apache.hadoop.io.compress.CompressionCodec codec, Counters.Counter readsCounter) throws IOException
conf
- Configuration Filein
- The input streamlength
- Length of the data in the stream, including the checksum
bytes.codec
- codecreadsCounter
- Counter for records read from diskIOException
public long getLength()
public long getPosition() throws IOException
IOException
protected boolean positionToNextRecord(DataInput dIn) throws IOException
IOException
public boolean nextRawKey(org.apache.hadoop.io.DataInputBuffer key) throws IOException
IOException
public void nextRawValue(org.apache.hadoop.io.DataInputBuffer value) throws IOException
IOException
public void close() throws IOException
IOException
public void reset(int offset)
public void disableChecksumValidation()
Copyright © 2017 Apache Software Foundation. All Rights Reserved.