org.apache.tez.runtime.library.common.sort.impl
Class IFile.Reader

java.lang.Object
  extended by org.apache.tez.runtime.library.common.sort.impl.IFile.Reader
Direct Known Subclasses:
InMemoryReader
Enclosing class:
IFile

@InterfaceAudience.Private
@InterfaceStability.Unstable
public static class IFile.Reader
extends Object

IFile.Reader to read intermediate map-outputs.


Nested Class Summary
static class IFile.Reader.KeyState
           
 
Field Summary
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 prevKeyLength
           
protected  int recNo
           
 
Constructor Summary
IFile.Reader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path file, org.apache.hadoop.io.compress.CompressionCodec codec, org.apache.tez.common.counters.TezCounter readsCounter, org.apache.tez.common.counters.TezCounter bytesReadCounter, boolean ifileReadAhead, int ifileReadAheadLength, int bufferSize)
          Construct an IFile Reader.
IFile.Reader(InputStream in, long length, org.apache.hadoop.io.compress.CompressionCodec codec, org.apache.tez.common.counters.TezCounter readsCounter, org.apache.tez.common.counters.TezCounter bytesReadCounter, boolean readAhead, int readAheadLength, int bufferSize)
          Construct an IFile Reader.
 
Method Summary
 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)
           
 IFile.Reader.KeyState readRawKey(org.apache.hadoop.io.DataInputBuffer key)
           
 void reset(int offset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bytesRead

public long bytesRead

fileLength

protected final long fileLength

eof

protected boolean eof

buffer

protected byte[] buffer

bufferSize

protected int bufferSize

dataIn

protected DataInputStream dataIn

recNo

protected int recNo

prevKeyLength

protected int prevKeyLength

currentKeyLength

protected int currentKeyLength

currentValueLength

protected int currentValueLength
Constructor Detail

IFile.Reader

public IFile.Reader(org.apache.hadoop.fs.FileSystem fs,
                    org.apache.hadoop.fs.Path file,
                    org.apache.hadoop.io.compress.CompressionCodec codec,
                    org.apache.tez.common.counters.TezCounter readsCounter,
                    org.apache.tez.common.counters.TezCounter bytesReadCounter,
                    boolean ifileReadAhead,
                    int ifileReadAheadLength,
                    int bufferSize)
             throws IOException
Construct an IFile Reader.

Parameters:
fs - FileSystem
file - Path of the file to be opened. This file should have checksum bytes for the data at the end of the file.
codec - codec
readsCounter - Counter for records read from disk
Throws:
IOException

IFile.Reader

public IFile.Reader(InputStream in,
                    long length,
                    org.apache.hadoop.io.compress.CompressionCodec codec,
                    org.apache.tez.common.counters.TezCounter readsCounter,
                    org.apache.tez.common.counters.TezCounter bytesReadCounter,
                    boolean readAhead,
                    int readAheadLength,
                    int bufferSize)
             throws IOException
Construct an IFile Reader.

Parameters:
in - The input stream
length - Length of the data in the stream, including the checksum bytes.
codec - codec
readsCounter - Counter for records read from disk
Throws:
IOException
Method Detail

getLength

public long getLength()

getPosition

public long getPosition()
                 throws IOException
Throws:
IOException

positionToNextRecord

protected boolean positionToNextRecord(DataInput dIn)
                                throws IOException
Throws:
IOException

nextRawKey

public boolean nextRawKey(org.apache.hadoop.io.DataInputBuffer key)
                   throws IOException
Throws:
IOException

readRawKey

public IFile.Reader.KeyState readRawKey(org.apache.hadoop.io.DataInputBuffer key)
                                 throws IOException
Throws:
IOException

nextRawValue

public void nextRawValue(org.apache.hadoop.io.DataInputBuffer value)
                  throws IOException
Throws:
IOException

close

public void close()
           throws IOException
Throws:
IOException

reset

public void reset(int offset)

disableChecksumValidation

public void disableChecksumValidation()


Copyright © 2014 Apache Software Foundation. All rights reserved.