org.apache.tez.runtime.library.common.sort.impl
Class ExternalSorter

java.lang.Object
  extended by org.apache.tez.runtime.library.common.sort.impl.ExternalSorter
Direct Known Subclasses:
DefaultSorter, PipelinedSorter

public abstract class ExternalSorter
extends Object


Nested Class Summary
static class ExternalSorter.MapBufferTooSmallException
          Exception indicating that the allocated sort buffer is insufficient to hold the current record.
 
Field Summary
protected  org.apache.tez.common.counters.TezCounter additionalSpillBytesRead
           
protected  org.apache.tez.common.counters.TezCounter additionalSpillBytesWritten
           
protected  int availableMemoryMb
           
protected  org.apache.hadoop.io.compress.CompressionCodec codec
           
protected  Combiner combiner
           
protected  org.apache.hadoop.io.RawComparator comparator
           
protected  org.apache.hadoop.conf.Configuration conf
           
protected  org.apache.tez.common.counters.TezCounter fileOutputByteCounter
           
protected  int ifileBufferSize
           
protected  boolean ifileReadAhead
           
protected  int ifileReadAheadLength
           
protected  Class keyClass
           
protected  org.apache.hadoop.io.serializer.Serializer keySerializer
           
protected  org.apache.tez.common.counters.TezCounter mapOutputByteCounter
           
protected  TezTaskOutput mapOutputFile
           
protected  org.apache.tez.common.counters.TezCounter mapOutputRecordCounter
           
protected  org.apache.hadoop.util.Progressable nullProgressable
           
protected  org.apache.tez.common.counters.TezCounter numAdditionalSpills
           
protected  org.apache.tez.common.counters.TezCounter outputBytesWithOverheadCounter
           
protected  org.apache.tez.runtime.api.TezOutputContext outputContext
           
protected  Partitioner partitioner
           
protected  int partitions
           
protected  org.apache.hadoop.fs.FileSystem rfs
           
protected  org.apache.hadoop.io.serializer.SerializationFactory serializationFactory
           
protected  org.apache.hadoop.util.IndexedSorter sorter
           
protected  org.apache.tez.common.counters.TezCounter spilledRecordsCounter
           
protected  Class valClass
           
protected  org.apache.hadoop.io.serializer.Serializer valSerializer
           
 
Constructor Summary
ExternalSorter(org.apache.tez.runtime.api.TezOutputContext outputContext, org.apache.hadoop.conf.Configuration conf, int numOutputs, long initialMemoryAvailable)
           
 
Method Summary
abstract  void close()
           
abstract  void flush()
           
static long getInitialMemoryRequirement(org.apache.hadoop.conf.Configuration conf, long maxAvailableTaskMemory)
           
 TezTaskOutput getMapOutput()
           
 ShuffleHeader getShuffleHeader(int reduce)
           
 InputStream getSortedStream(int partition)
           
protected  void runCombineProcessor(TezRawKeyValueIterator kvIter, IFile.Writer writer)
           
protected  void sameVolRename(org.apache.hadoop.fs.Path srcPath, org.apache.hadoop.fs.Path dstPath)
          Rename srcPath to dstPath on the same volume.
abstract  void write(Object key, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nullProgressable

protected final org.apache.hadoop.util.Progressable nullProgressable

outputContext

protected final org.apache.tez.runtime.api.TezOutputContext outputContext

combiner

protected final Combiner combiner

partitioner

protected final Partitioner partitioner

conf

protected final org.apache.hadoop.conf.Configuration conf

rfs

protected final org.apache.hadoop.fs.FileSystem rfs

mapOutputFile

protected final TezTaskOutput mapOutputFile

partitions

protected final int partitions

keyClass

protected final Class keyClass

valClass

protected final Class valClass

comparator

protected final org.apache.hadoop.io.RawComparator comparator

serializationFactory

protected final org.apache.hadoop.io.serializer.SerializationFactory serializationFactory

keySerializer

protected final org.apache.hadoop.io.serializer.Serializer keySerializer

valSerializer

protected final org.apache.hadoop.io.serializer.Serializer valSerializer

ifileReadAhead

protected final boolean ifileReadAhead

ifileReadAheadLength

protected final int ifileReadAheadLength

ifileBufferSize

protected final int ifileBufferSize

availableMemoryMb

protected final int availableMemoryMb

sorter

protected final org.apache.hadoop.util.IndexedSorter sorter

codec

protected final org.apache.hadoop.io.compress.CompressionCodec codec

mapOutputByteCounter

protected final org.apache.tez.common.counters.TezCounter mapOutputByteCounter

mapOutputRecordCounter

protected final org.apache.tez.common.counters.TezCounter mapOutputRecordCounter

outputBytesWithOverheadCounter

protected final org.apache.tez.common.counters.TezCounter outputBytesWithOverheadCounter

fileOutputByteCounter

protected final org.apache.tez.common.counters.TezCounter fileOutputByteCounter

spilledRecordsCounter

protected final org.apache.tez.common.counters.TezCounter spilledRecordsCounter

additionalSpillBytesWritten

protected final org.apache.tez.common.counters.TezCounter additionalSpillBytesWritten

additionalSpillBytesRead

protected final org.apache.tez.common.counters.TezCounter additionalSpillBytesRead

numAdditionalSpills

protected final org.apache.tez.common.counters.TezCounter numAdditionalSpills
Constructor Detail

ExternalSorter

public ExternalSorter(org.apache.tez.runtime.api.TezOutputContext outputContext,
                      org.apache.hadoop.conf.Configuration conf,
                      int numOutputs,
                      long initialMemoryAvailable)
               throws IOException
Throws:
IOException
Method Detail

close

public abstract void close()
                    throws IOException
Throws:
IOException

flush

public abstract void flush()
                    throws IOException
Throws:
IOException

write

public abstract void write(Object key,
                           Object value)
                    throws IOException
Throws:
IOException

getMapOutput

@InterfaceAudience.Private
public TezTaskOutput getMapOutput()

runCombineProcessor

protected void runCombineProcessor(TezRawKeyValueIterator kvIter,
                                   IFile.Writer writer)
                            throws IOException
Throws:
IOException

sameVolRename

protected void sameVolRename(org.apache.hadoop.fs.Path srcPath,
                             org.apache.hadoop.fs.Path dstPath)
                      throws IOException
Rename srcPath to dstPath on the same volume. This is the same as RawLocalFileSystem's rename method, except that it will not fall back to a copy, and it will create the target directory if it doesn't exist.

Throws:
IOException

getSortedStream

public InputStream getSortedStream(int partition)

getShuffleHeader

public ShuffleHeader getShuffleHeader(int reduce)

getInitialMemoryRequirement

public static long getInitialMemoryRequirement(org.apache.hadoop.conf.Configuration conf,
                                               long maxAvailableTaskMemory)


Copyright © 2014 Apache Software Foundation. All rights reserved.