|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.data.BagFactory
@InterfaceAudience.Public @InterfaceStability.Stable public abstract class BagFactory
Factory for constructing different types of bags. This class is abstract so that users can override the bag factory if they desire to provide their own that returns their implementation of a bag. If the property pig.data.bag.factory.name is set to a class name and pig.data.bag.factory.jar is set to a URL pointing to a jar that contains the above named class, then getInstance() will create an instance of the named class using the indicated jar. Otherwise, it will create an instance of DefaultBagFactory.
Constructor Summary | |
---|---|
protected |
BagFactory()
Construct a new BagFactory |
Method Summary | |
---|---|
static BagFactory |
getInstance()
Get a reference to the singleton factory. |
abstract DataBag |
newDefaultBag()
Get a default (unordered, not distinct) data bag. |
abstract DataBag |
newDefaultBag(List<Tuple> listOfTuples)
Get a default (unordered, not distinct) data bag with an existing list of tuples inserted into the bag. |
abstract DataBag |
newDistinctBag()
Get a distinct data bag. |
abstract DataBag |
newSortedBag(Comparator<Tuple> comp)
Get a sorted data bag. |
protected void |
registerBag(DataBag b)
Register a bag with the SpillableMemoryManager . |
static void |
resetSelf()
Provided for testing purposes only. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected BagFactory()
Method Detail |
---|
public static BagFactory getInstance()
public abstract DataBag newDefaultBag()
public abstract DataBag newDefaultBag(List<Tuple> listOfTuples)
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.
public abstract DataBag newSortedBag(Comparator<Tuple> comp)
comp
- Comparator that controls how the data is sorted.
If null, default comparator will be used.
public abstract DataBag newDistinctBag()
protected void registerBag(DataBag b)
SpillableMemoryManager
.
If the bags created by an implementation of BagFactory are managed by
the SpillableMemoryManager
then this
method should be called each time a new bag is created.
b
- bag to be registered.public static void resetSelf()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |