org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators
Class MultiQueryPackager

java.lang.Object
  extended by org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.Packager
      extended by org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.MultiQueryPackager
All Implemented Interfaces:
Serializable, Cloneable, Illustrable

public class MultiQueryPackager
extends Packager

The package operator that packages the globally rearranged tuples into output format as required by multi-query de-multiplexer.

This operator is used when merging multiple Map-Reduce splittees into a Map-only splitter during multi-query optimization. The package operators of the reduce plans of the splittees form an indexed package list inside this operator. When this operator receives an input, it extracts the index from the key and calls the corresponding package to get the output data.

Due to the recursive nature of multi-query optimization, this operator may be contained in another multi-query packager.

The successor of this operator must be a PODemux operator which knows how to consume the output of this operator.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.Packager
Packager.PackageType
 
Field Summary
 
Fields inherited from class org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.Packager
bags, distinct, illustrator, isKeyCompound, isKeyTuple, keyInfo, mBagFactory, mTupleFactory, parent, readOnce
 
Constructor Summary
MultiQueryPackager()
           
 
Method Summary
 void addIsKeyWrappedList(List<Boolean> lst)
          Adds a list of IsKeyWrapped boolean values
 void addPackager(Packager pkgr)
          Appends the specified package object to the end of the package list.
 void addPackager(Packager pkgr, byte mapKeyType)
          Appends the specified package object to the end of the package list.
 List<Boolean> getIsKeyWrappedList()
          Returns the list of booleans that indicates if the key needs to unwrapped for the corresponding plan.
 Result getNext()
          Constructs the output tuple from the inputs.
 int getNumInputs(byte index)
           
 List<Packager> getPackagers()
          Returns the list of packages.
 Tuple getValueTuple(PigNullableWritable keyWritable, NullableTuple ntup, int index)
           
 boolean isInCombiner()
           
 boolean isSameMapKeyType()
           
 void setInCombiner(boolean inCombiner)
           
 void setSameMapKeyType(boolean sameMapKeyType)
           
 
Methods inherited from class org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.Packager
attachInput, checkBagType, clone, detachInput, getBag, getIllustrator, getInner, getKey, getKey, getKeyAsTuple, getKeyInfo, getKeyTuple, getKeyType, getNumInputs, getPackageType, illustratorMarkup, illustratorMarkup2, isDistinct, name, numberOfEquivalenceClasses, setDistinct, setIllustrator, setInner, setKeyCompound, setKeyInfo, setKeyTuple, setKeyType, setNumInputs, setPackageType, setParent, setUseSecondaryKey, starMarkup
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiQueryPackager

public MultiQueryPackager()
Method Detail

addPackager

public void addPackager(Packager pkgr)
Appends the specified package object to the end of the package list.

Parameters:
pack - package to be appended to the list

addPackager

public void addPackager(Packager pkgr,
                        byte mapKeyType)
Appends the specified package object to the end of the package list.

Parameters:
pack - package to be appended to the list
mapKeyType - the map key type associated with the package

getPackagers

public List<Packager> getPackagers()
Returns the list of packages.

Returns:
the list of the packages

getNext

public Result getNext()
               throws ExecException
Constructs the output tuple from the inputs.

The output is consumed by for the demultiplexer operator (PODemux) in the format (key, {bag of tuples}) where key is an indexed WritableComparable, not the wrapped value as a pig type.

Overrides:
getNext in class Packager
Throws:
ExecException

getIsKeyWrappedList

public List<Boolean> getIsKeyWrappedList()
Returns the list of booleans that indicates if the key needs to unwrapped for the corresponding plan.

Returns:
the list of isKeyWrapped boolean values

addIsKeyWrappedList

public void addIsKeyWrappedList(List<Boolean> lst)
Adds a list of IsKeyWrapped boolean values

Parameters:
lst - the list of boolean values to add

setInCombiner

public void setInCombiner(boolean inCombiner)

isInCombiner

public boolean isInCombiner()

setSameMapKeyType

public void setSameMapKeyType(boolean sameMapKeyType)

isSameMapKeyType

public boolean isSameMapKeyType()

getNumInputs

public int getNumInputs(byte index)
Overrides:
getNumInputs in class Packager

getValueTuple

public Tuple getValueTuple(PigNullableWritable keyWritable,
                           NullableTuple ntup,
                           int index)
                    throws ExecException
Overrides:
getValueTuple in class Packager
Throws:
ExecException


Copyright © 2007-2012 The Apache Software Foundation