public class NonSpillableDataBag extends java.lang.Object implements DataBag
Constructor and Description |
---|
NonSpillableDataBag() |
NonSpillableDataBag(int tupleCount)
Use this constructor if you know upfront how many tuples you are going
to put in this bag.
|
NonSpillableDataBag(java.util.List<Tuple> listOfTuples)
This constructor creates a bag out of an existing list
of tuples by taking ownership of the list and NOT
copying the contents of the list.
|
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) |
boolean |
equals(java.lang.Object obj) |
long |
getMemorySize()
Requests that an object return an estimate of its in memory size.
|
int |
hashCode() |
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)
This is used by FuncEvalSpec.FakeDataBag.
|
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, both in memory and on disk.
|
long |
spill()
Instructs an object to spill whatever it can to disk and release
references to any data structures it spills.
|
java.lang.String |
toString()
Write the bag into a string.
|
void |
write(java.io.DataOutput out)
Write a bag's contents to disk.
|
public NonSpillableDataBag()
public NonSpillableDataBag(int tupleCount)
tupleCount
- public NonSpillableDataBag(java.util.List<Tuple> listOfTuples)
listOfTuples
- Listpublic boolean isSorted()
DataBag
public boolean isDistinct()
DataBag
isDistinct
in interface DataBag
public java.util.Iterator<Tuple> iterator()
DataBag
protected void reportProgress()
public void addAll(DataBag b)
DataBag
public void clear()
DataBag
public void markStale(boolean stale)
DataBag
public long size()
DataBag
public long getMemorySize()
Spillable
getMemorySize
in interface Spillable
public long spill()
Spillable
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 boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2007-2017 The Apache Software Foundation