public class LimitedSortedDataBag extends Object implements DataBag
| Constructor and Description | 
|---|
| LimitedSortedDataBag(Comparator<Tuple> comp,
                    long limit) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | add(Tuple t)Add a tuple to the bag. | 
| void | addAll(DataBag b)Add contents of a bag to the bag. | 
| void | clear()Clear out the contents of the bag, both on disk and in memory. | 
| int | compareTo(Object other) | 
| long | getMemorySize()Not implemented. | 
| boolean | isDistinct()Find out if the bag is distinct. | 
| boolean | isSorted()Find out if the bag is sorted. | 
| Iterator<Tuple> | iterator()Get an iterator to the bag. | 
| void | markStale(boolean stale)Not implemented. | 
| void | readFields(DataInput in)Read a bag from disk. | 
| protected void | reportProgress()Report progress to HDFS. | 
| long | size()Get the number of elements in the bag in memory. | 
| long | spill()Not implemented. | 
| String | toString()Write the bag into a string. | 
| void | write(DataOutput out)Write a bag's contents to disk. | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic LimitedSortedDataBag(Comparator<Tuple> comp, long limit)
comp - Comparator to use to do the sorting.
 If null, DefaultComparator will be used.public long size()
public boolean isSorted()
public boolean isDistinct()
isDistinct in interface DataBagpublic Iterator<Tuple> iterator()
public void add(Tuple t)
public void addAll(DataBag b)
public void clear()
public void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.Writableout - DataOutput to write data to.IOException - (passes it on from underlying calls).public void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.Writablein - DataInput to read data from.IOException - (passes it on from underlying calls).public int compareTo(Object other)
compareTo in interface Comparablepublic void markStale(boolean stale)
public long spill()
public long getMemorySize()
getMemorySize in interface Spillableprotected void reportProgress()
Copyright © 2007-2017 The Apache Software Foundation