@InterfaceAudience.Public @InterfaceStability.Stable public abstract class BagFactory extends Object
Modifier | Constructor and Description |
---|---|
protected |
BagFactory()
Construct a new BagFactory
|
Modifier and Type | Method and Description |
---|---|
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)
Deprecated.
As of Pig 0.11, bags register with the
SpillableMemoryManager themselves.
Register a bag with the
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. |
static void |
resetSelf()
Provided for testing purposes only.
|
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()
@Deprecated protected void registerBag(DataBag b)
SpillableMemoryManager
themselves.
Register a bag with the
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()
Copyright © 2007-2012 The Apache Software Foundation