org.apache.pig.data
Class DefaultDataBag

java.lang.Object
  extended by org.apache.pig.data.Datum
      extended by org.apache.pig.data.DataBag
          extended by org.apache.pig.data.DefaultDataBag
All Implemented Interfaces:
Comparable, Iterable<Tuple>, Spillable

public class DefaultDataBag
extends DataBag

An unordered collection of Tuples (possibly) with multiples. The tuples are stored in an ArrayList, since there is no concern for order or distinctness.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.pig.data.DataBag
DataBag.BagDelimiterTuple, DataBag.EndBag, DataBag.StartBag
 
Field Summary
 
Fields inherited from class org.apache.pig.data.DataBag
endBag, MAX_SPILL_FILES, mContents, mMemSize, mMemSizeChanged, mSize, mSpillFiles, startBag
 
Fields inherited from class org.apache.pig.data.Datum
ATOM, BAG, MAP, OBJECT_SIZE, RECORD_1, RECORD_2, RECORD_3, REF_SIZE, TUPLE
 
Constructor Summary
DefaultDataBag()
           
 
Method Summary
 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.
 long spill()
          Instructs an object to spill whatever it can to disk and release references to any data structures it spills.
 
Methods inherited from class org.apache.pig.data.DataBag
add, addAll, cardinality, clear, compareTo, content, equals, finalize, getMemorySize, getSpillFile, hashCode, markStale, reportProgress, size, toString, write
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultDataBag

public DefaultDataBag()
Method Detail

isSorted

public boolean isSorted()
Description copied from class: DataBag
Find out if the bag is sorted.

Specified by:
isSorted in class DataBag

isDistinct

public boolean isDistinct()
Description copied from class: DataBag
Find out if the bag is distinct.

Specified by:
isDistinct in class DataBag

iterator

public Iterator<Tuple> iterator()
Description copied from class: DataBag
Get an iterator to the bag. For default and distinct bags, no particular order is guaranteed. For sorted bags the order is guaranteed to be sorted according to the provided comparator.

Specified by:
iterator in interface Iterable<Tuple>
Specified by:
iterator in class DataBag

spill

public long spill()
Description copied from interface: Spillable
Instructs an object to spill whatever it can to disk and release references to any data structures it spills.



Copyright © ${year} The Apache Software Foundation