|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.pig.data.TupleFactory
@InterfaceAudience.Public @InterfaceStability.Stable public abstract class TupleFactory
A factory to construct tuples. This class is abstract so that users can
override the tuple factory if they desire to provide their own that
returns their implementation of a tuple. If the property
pig.data.tuple.factory.name is set to a class name and
pig.data.tuple.factory.jar is set to a URL pointing to a jar that
contains the above named class, then getInstance() will create a
an instance of the named class using the indicated jar. Otherwise, it
will create an instance of DefaultTupleFactory.
| Constructor Summary | |
|---|---|
protected |
TupleFactory()
|
| Method Summary | |
|---|---|
static TupleFactory |
getInstance()
Get a reference to the singleton factory. |
abstract boolean |
isFixedSize()
This method is used to inspect whether the Tuples created by this factory will be of a fixed size when they are created. |
abstract Tuple |
newTuple()
Create an empty tuple. |
abstract Tuple |
newTuple(int size)
Create a tuple with size fields. |
abstract Tuple |
newTuple(List c)
Create a tuple from the provided list of objects. |
abstract Tuple |
newTuple(Object datum)
Create a tuple with a single element. |
abstract Tuple |
newTupleNoCopy(List list)
Create a tuple from a provided list of objects, keeping the provided list. |
static void |
resetSelf()
Provided for testing purposes only. |
abstract Class<? extends Tuple> |
tupleClass()
Return the actual class representing a tuple that the implementing factory will be returning. |
Class<? extends TupleRawComparator> |
tupleRawComparatorClass()
Return the actual class implementing the raw comparator for tuples that the factory will be returning. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected TupleFactory()
| Method Detail |
|---|
public static TupleFactory getInstance()
public abstract Tuple newTuple()
newTuple in interface TupleMaker<Tuple>public abstract Tuple newTuple(int size)
newTuple in interface TupleMaker<Tuple>size - Number of fields in the tuple.
public abstract Tuple newTuple(List c)
c - List of objects to use as the fields of the tuple.
public abstract Tuple newTupleNoCopy(List list)
list - List of objects that will become the fields of the tuple.
public abstract Tuple newTuple(Object datum)
datum - Datum to put in the tuple.
public abstract Class<? extends Tuple> tupleClass()
public static void resetSelf()
public Class<? extends TupleRawComparator> tupleRawComparatorClass()
public abstract boolean isFixedSize()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||