public class ReadOnceBag extends Object implements DataBag
| Modifier and Type | Class and Description |
|---|---|
protected class |
ReadOnceBag.ReadOnceBagIterator |
| Modifier and Type | Field and Description |
|---|---|
protected PigNullableWritable |
keyWritable |
protected Packager |
pkgr |
protected Iterator<NullableTuple> |
tupIter |
| Constructor and Description |
|---|
ReadOnceBag() |
ReadOnceBag(Packager pkgr,
Iterator<NullableTuple> tupIter,
PigNullableWritable keyWritable)
This constructor creates a bag out of an existing iterator
of tuples by taking ownership of the iterator and NOT
copying the elements of the iterator.
|
| 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 o) |
boolean |
equals(Object other) |
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.
|
void |
write(DataOutput out) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorprotected Packager pkgr
protected transient Iterator<NullableTuple> tupIter
protected PigNullableWritable keyWritable
public ReadOnceBag()
public ReadOnceBag(Packager pkgr, Iterator<NullableTuple> tupIter, PigNullableWritable keyWritable)
pkg - POPackageLitetupIter - Iteratorkey - Objectpublic long getMemorySize()
SpillablegetMemorySize in interface Spillablepublic long spill()
Spillablepublic void addAll(DataBag b)
DataBagpublic void clear()
DataBagpublic boolean isDistinct()
DataBagisDistinct in interface DataBagpublic boolean isSorted()
DataBagpublic Iterator<Tuple> iterator()
DataBagpublic void markStale(boolean stale)
DataBagpublic long size()
DataBagpublic void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionpublic void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic int compareTo(Object o)
compareTo in interface ComparableCopyright © 2007-2017 The Apache Software Foundation