org.apache.pig.data
Class BinSedesTupleFactory

java.lang.Object
  extended by org.apache.pig.data.TupleFactory
      extended by org.apache.pig.data.BinSedesTupleFactory
Direct Known Subclasses:
DefaultTupleFactory

@InterfaceAudience.Private
public class BinSedesTupleFactory
extends TupleFactory

Default implementation of TupleFactory.


Constructor Summary
BinSedesTupleFactory()
           
 
Method Summary
 Tuple newTuple()
          Create an empty tuple.
 Tuple newTuple(int size)
          Create a tuple with size fields.
 Tuple newTuple(List c)
          Create a tuple from the provided list of objects.
 Tuple newTuple(Object datum)
          Create a tuple with a single element.
 Tuple newTupleNoCopy(List list)
          Create a tuple from a provided list of objects, keeping the provided list.
 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 org.apache.pig.data.TupleFactory
getInstance, resetSelf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinSedesTupleFactory

public BinSedesTupleFactory()
Method Detail

newTuple

public Tuple newTuple()
Description copied from class: TupleFactory
Create an empty tuple. This should be used as infrequently as possible, use newTuple(int) instead.

Specified by:
newTuple in class TupleFactory
Returns:
Empty new tuple.

newTuple

public Tuple newTuple(int size)
Description copied from class: TupleFactory
Create a tuple with size fields. Whenever possible this is preferred over the null constructor, as the constructor can preallocate the size of the container holding the fields. Once this is called, it is legal to call Tuple.set(x, object), where x < size.

Specified by:
newTuple in class TupleFactory
Parameters:
size - Number of fields in the tuple.
Returns:
Tuple with size fields

newTuple

public Tuple newTuple(List c)
Description copied from class: TupleFactory
Create a tuple from the provided list of objects. The underlying list will be copied.

Specified by:
newTuple in class TupleFactory
Parameters:
c - List of objects to use as the fields of the tuple.
Returns:
A tuple with the list objects as its fields

newTupleNoCopy

public Tuple newTupleNoCopy(List list)
Description copied from class: TupleFactory
Create a tuple from a provided list of objects, keeping the provided list. The new tuple will take over ownership of the provided list.

Specified by:
newTupleNoCopy in class TupleFactory
Parameters:
list - List of objects that will become the fields of the tuple.
Returns:
A tuple with the list objects as its fields

newTuple

public Tuple newTuple(Object datum)
Description copied from class: TupleFactory
Create a tuple with a single element. This is useful because of the fact that bags (currently) only take tuples, we often end up sticking a single element in a tuple in order to put it in a bag.

Specified by:
newTuple in class TupleFactory
Parameters:
datum - Datum to put in the tuple.
Returns:
A tuple with one field

tupleClass

public Class<? extends Tuple> tupleClass()
Description copied from class: TupleFactory
Return the actual class representing a tuple that the implementing factory will be returning. This is needed because Hadoop needs to know the exact class we will be using for input and output.

Specified by:
tupleClass in class TupleFactory
Returns:
Class that implements tuple.

tupleRawComparatorClass

public Class<? extends TupleRawComparator> tupleRawComparatorClass()
Description copied from class: TupleFactory
Return the actual class implementing the raw comparator for tuples that the factory will be returning. Ovverride this to allow Hadoop to speed up tuple sorting. The actual returned class should know the serialization details for the tuple. The default implementation (PigTupleDefaultRawComparator) will serialize the data before comparison

Overrides:
tupleRawComparatorClass in class TupleFactory
Returns:
Class that implements tuple raw comparator.


Copyright © 2007-2012 The Apache Software Foundation