|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.data.SingleTupleBag
public class SingleTupleBag
A simple performant implementation of the DataBag interface which only holds a single tuple. This will be used from POPreCombinerLocalRearrange and wherever else a single Tuple non-serializable DataBag is required.
Constructor Summary | |
---|---|
SingleTupleBag(Tuple t)
|
Method Summary | |
---|---|
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 o)
|
boolean |
equals(Object o)
|
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. |
Iterator<Tuple> |
iterator()
Get an iterator to the bag. |
void |
markStale(boolean stale)
This is used by FuncEvalSpec.FakeDataBag. |
void |
readFields(DataInput in)
|
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. |
String |
toString()
Write the bag into a string. |
void |
write(DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SingleTupleBag(Tuple t)
Method Detail |
---|
public void add(Tuple t)
DataBag
add
in interface DataBag
t
- tuple to add.public void addAll(DataBag b)
DataBag
addAll
in interface DataBag
b
- bag to add contents of.public void clear()
DataBag
clear
in interface DataBag
public boolean isDistinct()
DataBag
isDistinct
in interface DataBag
public boolean isSorted()
DataBag
isSorted
in interface DataBag
public Iterator<Tuple> iterator()
DataBag
iterator
in interface Iterable<Tuple>
iterator
in interface DataBag
public void markStale(boolean stale)
DataBag
markStale
in interface DataBag
stale
- Set stale state.public long size()
DataBag
size
in interface DataBag
public long getMemorySize()
Spillable
getMemorySize
in interface Spillable
public long spill()
Spillable
spill
in interface Spillable
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public int compareTo(Object o)
compareTo
in interface Comparable
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |