public class LimitedSortedDataBag extends java.lang.Object implements DataBag
Constructor and Description |
---|
LimitedSortedDataBag(java.util.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(java.lang.Object other) |
long |
getMemorySize()
Not implemented.
|
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.
|
void |
markStale(boolean stale)
Not implemented.
|
void |
readFields(java.io.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.
|
java.lang.String |
toString()
Write the bag into a string.
|
void |
write(java.io.DataOutput out)
Write a bag's contents to disk.
|
public LimitedSortedDataBag(java.util.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 DataBag
public java.util.Iterator<Tuple> iterator()
public void add(Tuple t)
public void addAll(DataBag b)
public void clear()
public void write(java.io.DataOutput out) throws java.io.IOException
write
in interface org.apache.hadoop.io.Writable
out
- DataOutput to write data to.java.io.IOException
- (passes it on from underlying calls).public void readFields(java.io.DataInput in) throws java.io.IOException
readFields
in interface org.apache.hadoop.io.Writable
in
- DataInput to read data from.java.io.IOException
- (passes it on from underlying calls).public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
public void markStale(boolean stale)
public long spill()
public long getMemorySize()
getMemorySize
in interface Spillable
protected void reportProgress()
Copyright © 2007-2025 The Apache Software Foundation