org.apache.pig.data
Class DefaultBagFactory

java.lang.Object
  extended by org.apache.pig.data.BagFactory
      extended by org.apache.pig.data.DefaultBagFactory

public class DefaultBagFactory
extends BagFactory

Default implementation of BagFactory.


Method Summary
 DataBag newDefaultBag()
          Get a default (unordered, not distinct) data bag.
 DataBag newDefaultBag(List<Tuple> listOfTuples)
          Get a default (unordered, not distinct) data bag from an existing list of tuples.
 DataBag newDistinctBag()
          Get a distinct data bag.
 DataBag newSortedBag(Comparator<Tuple> comp)
          Get a sorted data bag.
 
Methods inherited from class org.apache.pig.data.BagFactory
getInstance, registerBag, resetSelf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newDefaultBag

public DataBag newDefaultBag()
Get a default (unordered, not distinct) data bag.

Specified by:
newDefaultBag in class BagFactory
Returns:
default data bag.

newDefaultBag

public DataBag newDefaultBag(List<Tuple> listOfTuples)
Get a default (unordered, not distinct) data bag from an existing list of tuples. Note that the bag does NOT copy the tuples but uses the provided list as its backing store. So it takes ownership of the list.

Specified by:
newDefaultBag in class BagFactory
Parameters:
listOfTuples - list of tuples to be placed in the bag. This list may not be copied, it may be used directly by the created bag.
Returns:
default data bag.

newSortedBag

public DataBag newSortedBag(Comparator<Tuple> comp)
Get a sorted data bag.

Specified by:
newSortedBag in class BagFactory
Parameters:
comp - Comparator that controls how the data is sorted. If null, default comparator will be used.
Returns:
a sorted data bag

newDistinctBag

public DataBag newDistinctBag()
Get a distinct data bag.

Specified by:
newDistinctBag in class BagFactory
Returns:
distinct data bag


Copyright © 2007-2012 The Apache Software Foundation