public class InternalSortedBag extends SortedSpillBag
SelfSpillBag.MemoryLimits
DefaultAbstractBag.BagDelimiterTuple, DefaultAbstractBag.EndBag, DefaultAbstractBag.StartBag
memLimit
endBag, MAX_SPILL_FILES, mContents, mSize, mSpillFiles, startBag
Constructor and Description |
---|
InternalSortedBag() |
InternalSortedBag(java.util.Comparator<Tuple> comp) |
InternalSortedBag(int bagCount,
java.util.Comparator<Tuple> comp) |
InternalSortedBag(int bagCount,
float percent,
java.util.Comparator<Tuple> comp) |
Modifier and Type | Method and Description |
---|---|
void |
add(Tuple t)
Add a tuple to the bag.
|
boolean |
isDistinct()
Find out if the bag is distinct.
|
boolean |
isSorted()
Find out if the bag is sorted.
|
java.util.Iterator<Tuple> |
iterator()
Get an iterator to the bag.
|
long |
proactive_spill(java.util.Comparator<Tuple> comp)
Sort contents of mContents and write them to disk
|
long |
spill()
Instructs an object to spill whatever it can to disk and release
references to any data structures it spills.
|
addAll, addAll, addAll, clear, compareTo, equals, getMemorySize, getSpillFile, hashCode, incSpillCount, incSpillCount, markSpillableIfNecessary, markStale, readFields, reportProgress, sampleContents, size, toString, warn, write
public InternalSortedBag()
public InternalSortedBag(java.util.Comparator<Tuple> comp)
public InternalSortedBag(int bagCount, java.util.Comparator<Tuple> comp)
public InternalSortedBag(int bagCount, float percent, java.util.Comparator<Tuple> comp)
public void add(Tuple t)
DefaultAbstractBag
add
in interface DataBag
add
in class DefaultAbstractBag
t
- tuple to add.public boolean isSorted()
DataBag
public boolean isDistinct()
DataBag
public java.util.Iterator<Tuple> iterator()
DataBag
public long spill()
Spillable
public long proactive_spill(java.util.Comparator<Tuple> comp)
SortedSpillBag
proactive_spill
in class SortedSpillBag
comp
- Comparator to sort contents of mContentsCopyright © 2007-2012 The Apache Software Foundation