org.apache.pig.data
Class SortedSpillBag

java.lang.Object
  extended by org.apache.pig.data.DefaultAbstractBag
      extended by org.apache.pig.data.SortedSpillBag
All Implemented Interfaces:
Serializable, Comparable, Iterable<Tuple>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable, DataBag, Spillable
Direct Known Subclasses:
InternalDistinctBag, InternalSortedBag

public abstract class SortedSpillBag
extends DefaultAbstractBag

Common functionality for proactively spilling bags that need to keep the data sorted.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.pig.data.DefaultAbstractBag
DefaultAbstractBag.BagDelimiterTuple, DefaultAbstractBag.EndBag, DefaultAbstractBag.StartBag
 
Field Summary
 
Fields inherited from class org.apache.pig.data.DefaultAbstractBag
endBag, MAX_SPILL_FILES, mContents, mLastContentsSize, mMemSize, mSize, mSpillFiles, startBag
 
Constructor Summary
SortedSpillBag()
           
 
Method Summary
 long proactive_spill(Comparator<Tuple> comp)
          Sort contents of mContents and write them to disk
 
Methods inherited from class org.apache.pig.data.DefaultAbstractBag
add, addAll, addAll, clear, compareTo, equals, getMemorySize, getSpillFile, hashCode, incSpillCount, incSpillCount, markStale, readFields, reportProgress, size, toString, warn, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.pig.data.DataBag
isDistinct, isSorted, iterator
 
Methods inherited from interface org.apache.pig.impl.util.Spillable
spill
 

Constructor Detail

SortedSpillBag

public SortedSpillBag()
Method Detail

proactive_spill

public long proactive_spill(Comparator<Tuple> comp)
Sort contents of mContents and write them to disk

Parameters:
comp - Comparator to sort contents of mContents
Returns:
number of tuples spilled


Copyright © ${year} The Apache Software Foundation